From b1eceb978933182d32d4e021a9ab3455f9b5e7e9 Mon Sep 17 00:00:00 2001 From: Jacques Wagener Date: Mon, 11 Feb 2019 11:37:49 +0200 Subject: [PATCH] Upgrade vyper version to b8. --- setup.py | 2 +- vdb/source_map.py | 6 +++--- vdb/variables.py | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 7e1fecb..f35f300 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ setup( install_requires=[ "py-evm==0.2.0a34", "eth-tester==0.1.0b33", - "vyper>=0.1.0b5", + "vyper>=0.1.0b8", "web3==4.8.1" ], setup_requires=['setuptools-markdown'], diff --git a/vdb/source_map.py b/vdb/source_map.py index 14778bb..377341d 100644 --- a/vdb/source_map.py +++ b/vdb/source_map.py @@ -23,7 +23,7 @@ def serialise_var_rec(var_rec): type_str = 'tuple' _size = get_size_of_type(var_rec.typ) * 32 elif isinstance(var_rec.typ, MappingType): - type_str = 'mapping(%s)' % var_rec.typ + type_str = 'map(%s)' % var_rec.typ _size = 0 else: type_str = var_rec.typ.typ @@ -38,7 +38,7 @@ def serialise_var_rec(var_rec): def produce_source_map(code): - global_ctx = GlobalContext.get_global_context(parser.parse(code)) + global_ctx = GlobalContext.get_global_context(parser.parse_to_ast(code)) asm_list = compile_lll.compile_to_assembly(optimizer.optimize(parse_to_lll(code, runtime_only=True))) c, line_number_map = compile_lll.assembly_to_evm(asm_list) source_map = { @@ -51,7 +51,7 @@ def produce_source_map(code): for name, var_record in global_ctx._globals.items() } # Fetch context for each function. - lll = parser.parse_tree_to_lll(parser.parse(code), code, runtime_only=True) + lll = parser.parse_tree_to_lll(parser.parse_to_ast(code), code, runtime_only=True) contexts = { f.func_name: f.context for f in lll.args[1:] if hasattr(f, 'context') diff --git a/vdb/variables.py b/vdb/variables.py index a4547c7..dfea379 100644 --- a/vdb/variables.py +++ b/vdb/variables.py @@ -95,9 +95,11 @@ def parse_global(stdout, global_vars, computation, line): global_type = global_vars[var_name]['type'] slot = None + import ipdb; ipdb.set_trace() + if global_type in base_types: slot = global_vars[var_name]['position'] - elif global_type.startswith('mapping') and valid_subscript(name, global_type): + elif global_type.startswith('map') and valid_subscript(name, global_type): keys = get_keys(name) var_pos = global_vars[var_name]['position'] slot = get_hash(var_pos, keys, global_type) @@ -107,7 +109,7 @@ def parse_global(stdout, global_vars, computation, line): address=computation.msg.storage_address, slot=slot, ) - if global_type.startswith('mapping'): + if global_type.startswith('map'): global_type = global_type[global_type.find('(') + 1: global_type.find('[')] print_var(stdout, value, global_type) else: