Skip to content

Commit

Permalink
Fix ABI
Browse files Browse the repository at this point in the history
  • Loading branch information
tvorogme committed Oct 22, 2024
1 parent d599eb7 commit 31eb2fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tonpy/abi/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def abi_for_getters(self, getters: List[int]) -> set[ABIInterfaceInstance]:
def get_parsers(self, code_hash: str, getters: List[int]) -> set[ABIInterfaceInstance]:
parsers = set()

if code_hash in self.by_code_hash:
if code_hash in self.by_code_hash and self.by_code_hash[code_hash]:
for parser in self.by_code_hash[code_hash]:
parsers.add(parser)
else:
Expand Down
7 changes: 5 additions & 2 deletions src/tonpy/tvm/tvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def run(self, unpack_stack=True, allow_non_success=False) -> Union[Stack, List]:
st = Stack(prev_stack=self.tvm.run_vm())

if allow_non_success is False:
assert self.exit_code in [-1, 0], f"TVM run failed with exit code: {self.exit_code}"
assert self.exit_code in [-1, 0], f"TVM run failed with exit code: {self.exit_code} ({self.exit_code_description()})"

if self.enable_stack_dump:
self.fetch_detailed_step_info()
Expand Down Expand Up @@ -171,7 +171,10 @@ def exit_code_description(self):
"Description": "The maximum number of cells in the library is exceeded or the maximum depth of the Merkle tree is exceeded."}
}

return exit_codes[self.exit_code]
if self.exit_code in exit_codes:
return exit_codes[self.exit_code]
else:
return ''

@property
def vm_steps(self) -> int:
Expand Down

0 comments on commit 31eb2fe

Please sign in to comment.