Created
March 25, 2018 20:54
-
-
Save jacqueswww/33cc17e49c3e8dd3682dd093de6da893 to your computer and use it in GitHub Desktop.
Test a vyper contract with pyethereum.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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