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

Add missing def_delegator for constructor_inputs #96

Merged
merged 1 commit into from
May 18, 2022
Merged

Add missing def_delegator for constructor_inputs #96

merged 1 commit into from
May 18, 2022

Conversation

beacoding
Copy link
Contributor

@beacoding beacoding commented May 18, 2022

constructor_inputs when creating a contract from_file was missing.

We should probably enable passing constructor params with something like this:

    def encode_constructor_params(contract, args)
      types = contract.constructor_inputs.map { |input| input.type }
      Util.bin_to_hex(Eth::Abi.encode(types, args))
    end

as well, and appending it to data in deploy and transact.

Be happy to extend this PR if that's a direction we'd want to go.

Copy link
Collaborator

@kurotaky kurotaky left a comment

Choose a reason for hiding this comment

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

It was missing during implementation. Thank you!

@q9f
Copy link
Owner

q9f commented May 18, 2022

Be happy to extend this PR if that's a direction we'd want to go.

Please do if you are on it already! :)

@q9f q9f added the bug Something isn't working label May 18, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 18, 2022

Codecov Report

Merging #96 (41f5838) into main (854a7bc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #96   +/-   ##
=======================================
  Coverage   99.73%   99.73%           
=======================================
  Files          67       67           
  Lines        3801     3802    +1     
=======================================
+ Hits         3791     3792    +1     
  Misses         10       10           
Impacted Files Coverage Δ
lib/eth/contract.rb 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@beacoding
Copy link
Contributor Author

great! Feel free to merge this -- I'll file a separate PR for enabling constructor params @q9f / @kurotaky

@q9f q9f merged commit 595e007 into q9f:main May 18, 2022
mculp pushed a commit to mculp/eth.rb that referenced this pull request Aug 1, 2022
Co-authored-by: Bea <bea@Beas-MacBook-Pro-2.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants