Skip to content

Add chain object#681

Merged
iamdefinitelyahuman merged 15 commits intomasterfrom
feat-chain
Jul 13, 2020
Merged

Add chain object#681
iamdefinitelyahuman merged 15 commits intomasterfrom
feat-chain

Conversation

@iamdefinitelyahuman
Copy link
Copy Markdown
Member

What I did

  • Add the chain object
  • Move time travel / snapshot / mining methods from rpc to chain, mark rpc methods as deprecated
  • Updates to documentation

Closes #611

How I did it

  • Chain is a singleton that emulates list syntax to provide access to web3.eth.blockNumber and web3.eth.getBlock
  • the revert registry has been moved from rpc to state
  • Chain.get_transaction provides a public API for generating TransactionReceipt objects when the tx didn't originate in Brownie - imo this is much nicer than having to manually import TransactionReceipt

How to verify it

Run tests. I added some new cases and converted over quite a few existing ones.

@iamdefinitelyahuman iamdefinitelyahuman merged commit 9fd74d4 into master Jul 13, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the feat-chain branch July 19, 2020 22:01
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.

Add an object for easy access to block data

1 participant