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

accounts/abi/backends/simulated: add more API methods (#5) #20208

Merged
merged 10 commits into from
Dec 20, 2019

Conversation

gitteri
Copy link
Contributor

@gitteri gitteri commented Oct 26, 2019

Isolated automated integration tests were hard for us with the current backend simulator. In order to have a robust test suite I added methods to the backend simulator that have been extremely helpful for testing. Additionally, I added unit tests for almost all the methods of the backend simulator (but not the ones for the filter backend).

New methods added to the simulated backend:
BlockByHash
BlockByNumber
HeaderByHash
HeaderByNumber
TransactionCount
TransactionInBlock
SubscribeNewHead

The Simulated backend now implements the following interfaces:
ChainReader, ChainStateReader, ContractBackend, ContractCaller, ContractFilterer, ContractTransactor, DeployBackend, GasEstimator, GasPricer, LogFilterer, PendingContractCaller, TransactionReader, and TransactionSender

* backends: implement more of ethclient in sim

* backends: add BlockByNumber to simulated backend

* backends: make simulated progress function agree with syncprogress interface for client

* backends: add more tests

* backends: add more comments

* backends: fix sim for index in tx and add tests
@gitteri gitteri requested a review from gballet as a code owner October 26, 2019 14:33
@fjl fjl changed the title Add more functionality to the sim (#5) accounts/abi/backends/simulated: add more API methods (#5) Oct 28, 2019
@fjl fjl self-requested a review October 28, 2019 13:53
@gitteri
Copy link
Contributor Author

gitteri commented Nov 8, 2019

@fjl Please let me know if I can provide any further details for this PR to make reviewing it easier

@gitteri
Copy link
Contributor Author

gitteri commented Nov 25, 2019

@fjl @gballet @adamschmideg Is there's anything I can provide to help push this PR forward? Thanks!

gitteri and others added 4 commits November 25, 2019 18:37
* backends: implement more of ethclient in sim

* backends: add BlockByNumber to simulated backend

* backends: make simulated progress function agree with syncprogress interface for client

* backends: add more tests

* backends: add more comments

* backends: fix sim for index in tx and add tests
@gballet
Copy link
Member

gballet commented Nov 26, 2019

@gitteri one thing you could do would be to fix the linter issue, please

@gitteri
Copy link
Contributor Author

gitteri commented Nov 27, 2019

@gballet just fixed it. Looks like the failure in ci is unrelated to this pr:
lookup proxy.golang.org on 8.8.8.8:53: read udp 192.168.0.8:57902->8.8.8.8:53: i/o timeout

@gitteri
Copy link
Contributor Author

gitteri commented Dec 6, 2019

@gballet just a friendly bump for this. Let me know if there's anyone else who can also help review this pr that I should reach out to

Copy link
Member

@gballet gballet left a comment

Choose a reason for hiding this comment

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

LGTM

@gballet gballet merged commit 93b1171 into ethereum:master Dec 20, 2019
enriquefynn pushed a commit to enriquefynn/go-ethereum that referenced this pull request Mar 10, 2021
…thereum#20208)

* Add more functionality to the sim (ethereum#5)

* backends: implement more of ethclient in sim

* backends: add BlockByNumber to simulated backend

* backends: make simulated progress function agree with syncprogress interface for client

* backends: add more tests

* backends: add more comments

* backends: fix sim for index in tx and add tests

* backends: add lock back to estimategas

* backends: goimports

* backends: go ci lint

* Add more functionality to the sim (ethereum#5)

* backends: implement more of ethclient in sim

* backends: add BlockByNumber to simulated backend

* backends: make simulated progress function agree with syncprogress interface for client

* backends: add more tests

* backends: add more comments

* backends: fix sim for index in tx and add tests

* backends: add lock back to estimategas

* backends: goimports

* backends: go ci lint

* assert errs
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.

3 participants