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

eth/contract: allow creating from file, abi, bin #83

Merged
merged 14 commits into from
May 11, 2022
Merged

Conversation

q9f
Copy link
Owner

@q9f q9f commented May 9, 2022

instead of Contract.create:

Contract.from_file(file: file)
Contract.from_bin(name: name, abi: abi, bin: bin)
Contract.from_abi(name: name, abi: abi, address: addr)

@q9f q9f requested a review from kurotaky May 9, 2022 13:43
@codecov-commenter
Copy link

codecov-commenter commented May 9, 2022

Codecov Report

Merging #83 (c32a1e4) into main (d973b5b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #83   +/-   ##
=======================================
  Coverage   99.73%   99.73%           
=======================================
  Files          67       67           
  Lines        3780     3802   +22     
=======================================
+ Hits         3770     3792   +22     
  Misses         10       10           
Impacted Files Coverage Δ
lib/eth/client.rb 100.00% <100.00%> (ø)
lib/eth/contract.rb 100.00% <100.00%> (ø)
spec/eth/client_spec.rb 100.00% <100.00%> (ø)
spec/eth/contract/event_spec.rb 100.00% <100.00%> (ø)
spec/eth/contract_spec.rb 100.00% <100.00%> (ø)

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

lib/eth/contract.rb Outdated Show resolved Hide resolved
lib/eth/contract.rb Outdated Show resolved Hide resolved
@q9f q9f marked this pull request as draft May 10, 2022 10:50
@q9f q9f marked this pull request as ready for review May 10, 2022 14:11
q9f and others added 2 commits May 10, 2022 16:12
Co-authored-by: Yuta Kurotaki <yuta.kurotaki@gmail.com>
Co-authored-by: Yuta Kurotaki <yuta.kurotaki@gmail.com>
@q9f
Copy link
Owner Author

q9f commented May 10, 2022

Ok, this works now.

lib/eth/contract.rb Outdated Show resolved Hide resolved
lib/eth/contract.rb Outdated Show resolved Hide resolved
lib/eth/contract.rb Outdated Show resolved Hide resolved
lib/eth/contract.rb Outdated Show resolved Hide resolved
lib/eth/contract.rb Outdated Show resolved Hide resolved
lib/eth/contract.rb Outdated Show resolved Hide resolved
q9f and others added 2 commits May 11, 2022 11:25
Co-authored-by: Matt Culpepper <mculp@users.noreply.github.com>
Co-authored-by: Matt Culpepper <mculp@users.noreply.github.com>
@q9f
Copy link
Owner Author

q9f commented May 11, 2022

Thank you @mculp - I applied all your suggestions!

@q9f q9f merged commit 28b7fe0 into main May 11, 2022
@q9f q9f deleted the q9f/contract/from branch May 11, 2022 14:17
@kurotaky
Copy link
Collaborator

👍

@q9f q9f added enhancement New feature or request breaking change Should clearly be documented labels May 13, 2022
mculp added a commit to mculp/eth.rb that referenced this pull request Aug 1, 2022
* eth/contract: allow creating from file, abi, bin

* eth/client: refactor contract code

* Update lib/eth/contract.rb

Co-authored-by: Yuta Kurotaki <yuta.kurotaki@gmail.com>

* Update lib/eth/contract.rb

Co-authored-by: Yuta Kurotaki <yuta.kurotaki@gmail.com>

* spec: deploy ens and call it

* spec: fix client spec for eip 1271

* docs: fix readme for contracts

* docs: fix readme for contracts

* spec: fix jsonrpc error code

* spec: fix coverage

* spec: fix coverage

* eth/contract: apply @mculp's suggestions

Co-authored-by: Matt Culpepper <mculp@users.noreply.github.com>

* eth/contract: apply @mculp's suggestions

Co-authored-by: Matt Culpepper <mculp@users.noreply.github.com>

Co-authored-by: Yuta Kurotaki <yuta.kurotaki@gmail.com>
Co-authored-by: Matt Culpepper <mculp@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Should clearly be documented enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants