-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
Conversation
* 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
@fjl Please let me know if I can provide any further details for this PR to make reviewing it easier |
@fjl @gballet @adamschmideg Is there's anything I can provide to help push this PR forward? Thanks! |
* 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
3715e1b
to
974574b
Compare
@gitteri one thing you could do would be to fix the linter issue, please |
@gballet just fixed it. Looks like the failure in ci is unrelated to this pr: |
@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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…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
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