Skip to content

Instantly share code, notes, and snippets.

@jacqueswww
Created March 25, 2018 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacqueswww/33cc17e49c3e8dd3682dd093de6da893 to your computer and use it in GitHub Desktop.
Save jacqueswww/33cc17e49c3e8dd3682dd093de6da893 to your computer and use it in GitHub Desktop.
Test a vyper contract with pyethereum.
from ethereum.tools import tester
from vyper import compiler
def test_merkle_proof_contract():
tester.languages['vyper'] = compiler.Compiler()
s = tester.Chain() # initialize test chain
contract_code = open('merkleproof.v.py').read() # get source code
contract = s.contract(contract_code, language='vyper') # compile code
# Note: use args=[] to pass constructor args.
contract.add_root_hash(b'test')
assert contract.get_timestamp(b't') == 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment