Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: namedtuple decoding for vvmcontract structs #356

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

charles-cooper
Copy link
Member

What I did

  • add namedtuple decoding for VVMContract structs
  • also namedtuple decoding for VVMContract events
    • IMPORTANT: this is different than the existing get_logs API (for VyperContract). probably VyperContract should have the namedtuple decoding for get_logs as well
  • add handle_error() in VVMDeployer.deploy() to properly raise BoaErrors that occur in the ctor

How I did it

How to verify it

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

for item_abi in event_abi["inputs"]:
is_topic = item_abi["indexed"]
assert isinstance(is_topic, bool)
if not is_topic:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double negatives are hard to read


decoded_args = abi_decode(args_selector, data)

t_i = 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

topic_index and arg_index would be much easier to read

ret[event_id] = event_abi
return ret

def decode_log(self, log_entry):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function does too many things imo it should be splitted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants