Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Add nameless decode to BaseContract #2355

Merged
merged 2 commits into from
Apr 27, 2023
Merged

Conversation

halo3mic
Copy link
Contributor

Motivation

BaseContract provides various methods for decoding input data: decode, decode_raw, decode_with_selector and decode_with_selector_raw.
These methods take a method name as an argument, which could be omitted as it is already provided through input-data.

Solution

Add new methods that decode input-data without requiring method-name as a parameter - decode_input_raw and decode_input.

Existing decode methods (decode, decode_raw, decode_with_selector and decode_with_selector_raw) lose functionality with the introduction of nameless decode methods. They could be removed unless I missed a viable utility or should be left in for backward compatibility.

PR Checklist

  • Added nameless decode methods to BaseContract
  • Add test
  • Remove existing decode methods?

@prestwich
Copy link
Collaborator

needs formatting with cargo +nightly fmt

Copy link
Collaborator

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

concept ACK. See comment re rustfmt

Copy link
Collaborator

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

examples failure is unrelated

@prestwich prestwich merged commit 93236fb into gakonst:master Apr 27, 2023
@halo3mic halo3mic deleted the nameless_decode branch May 29, 2023 09:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants