Update vyper-debug to use vyper-0.1.0b5.

This commit is contained in:
Jacques Wagener 2018-12-10 11:24:52 +02:00
parent 38c3b3087e
commit 1d8c00435f
No known key found for this signature in database
GPG Key ID: C294D1025DA0E923
6 changed files with 20 additions and 17 deletions

View File

@ -5,7 +5,7 @@ import os
import vyper
from collections import Counter
from pprint import pprint
from vyper import compiler
from vyper import compile_code
from vdb.source_map import (
produce_source_map
@ -62,8 +62,8 @@ def get_tester(code):
def get_contract(w3, source_code, *args, **kwargs):
abi = compiler.mk_full_signature(source_code)
bytecode = '0x' + compiler.compile(source_code).hex()
compiler_out = compile_code(source_code, ['abi', 'bytecode'])
abi, bytecode = compiler_out['abi'], compiler_out['bytecode']
contract = w3.eth.contract(abi=abi, bytecode=bytecode)
value = kwargs.pop('value', 0)
@ -148,7 +148,7 @@ if __name__ == '__main__':
calls.append((name, args))
abi = compiler.mk_full_signature(code)
abi = compile_code(code, ['abi'])['abi']
# Format init args.
if init_args:

View File

@ -46,9 +46,9 @@ setup(
url='https://github.com/ethereum/vyper-debug',
include_package_data=True,
install_requires=[
"py-evm==0.2.0a33",
"py-evm==0.2.0a34",
"eth-tester==0.1.0b33",
"vyper==0.1.0b4",
"vyper==0.1.0b5",
"web3==4.8.1"
],
setup_requires=['setuptools-markdown'],

View File

@ -1,6 +1,6 @@
import pytest
from vyper import compiler
from vyper import compile_code
from eth_tester import (
EthereumTester,
@ -12,7 +12,6 @@ from web3 import (
Web3,
)
from vdb.vdb import (
set_evm_opcode_debugger,
VyperDebugCmd
)
from vdb.eth_tester_debug_backend import (
@ -24,7 +23,7 @@ from vdb.source_map import (
)
@pytest.fixture(scope="module")
@pytest.fixture()
def tester():
t = EthereumTester(backend=PyEVMDebugBackend())
return t
@ -34,7 +33,7 @@ def zero_gas_price_strategy(web3, transaction_params=None):
return 0 # zero gas price makes testing simpler.
@pytest.fixture(scope="module")
@pytest.fixture()
def w3(tester):
w3 = Web3(EthereumTesterProvider(tester))
w3.eth.setGasPriceStrategy(zero_gas_price_strategy)
@ -42,8 +41,9 @@ def w3(tester):
def _get_contract(w3, source_code, *args, **kwargs):
abi = compiler.mk_full_signature(source_code)
bytecode = '0x' + compiler.compile(source_code).hex()
compiler_output = compile_code(source_code, ['bytecode', 'abi'])
abi = compiler_output['abi']
bytecode = compiler_output['bytecode']
contract = w3.eth.contract(abi=abi, bytecode=bytecode)
stdin = kwargs['stdin'] if 'stdin' in kwargs else None

View File

@ -7,6 +7,7 @@ def test_print_uint256(get_contract, get_last_out):
def test():
a: uint256 = 33343
vdb
a = 2
"""
stdin = io.StringIO(
@ -15,7 +16,7 @@ def test():
stdout = io.StringIO()
c = get_contract(code, stdin=stdin, stdout=stdout)
c.functions.test().call({"gas": 22000})
c.functions.test().transact({"gas": 22000})
assert get_last_out(stdout) == '33343'
@ -26,6 +27,7 @@ def test_print_int128(get_contract, get_last_out):
def test():
a: int128 = -123
vdb
a = 2
"""
stdin = io.StringIO(
@ -34,5 +36,6 @@ def test():
stdout = io.StringIO()
c = get_contract(code, stdin=stdin, stdout=stdout)
c.functions.test().call({"gas": 22000})
c.functions.test().transact({"gas": 22000})
assert get_last_out(stdout) == '-123'

View File

@ -55,7 +55,7 @@ class DebugComputation(ByzantiumComputation):
@classmethod
def is_breakpoint(cls, pc, continue_line_nos):
breakpoint_lines = cls.source_map['line_number_map']['breakpoints']
breakpoint_lines = set(cls.source_map['line_number_map']['breakpoints'])
line_no = cls.get_line_no(pc)
if line_no is not None:
if line_no in continue_line_nos: # already been here, skip.

View File

@ -1,7 +1,7 @@
from eth_hash.auto import keccak
from eth_utils import to_hex
from eth_abi import decode_single
from eth.utils.numeric import (
from eth_utils import (
to_hex,
big_endian_to_int,
int_to_big_endian,
)