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 get_transaction_receipt method to Chain API #1722

Merged
merged 1 commit into from
Feb 21, 2019

Conversation

Bhargavasomu
Copy link
Contributor

What was wrong?

Currently, if we want to implement the getTransactionReceipt JSON RPC functionality, then we would have to go all the way to the ChainDB part of the Chain API. This PR aims to make this functionality available as part of the Chain API, so that the convention of JSON RPC implementations using only the Chain API and not the chaindb part of the Chain, is followed.

How was it fixed?

The get_receipt_by_index of chaindb was used in the Chain API, so as to abstract the usage.

Cute Animal Picture

put a cute animal picture link inside the parentheses

@Bhargavasomu
Copy link
Contributor Author

@cburgdorf could you please review this? This is a part of the PR ethereum/trinity#122

Copy link
Contributor

@cburgdorf cburgdorf left a comment

Choose a reason for hiding this comment

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

This looks good to me but I wouldn't mind @pipermerriam giving it a second look just because it's adding a method to one of the core abstractions of the EVM (which I do agree is needed).

eth/db/chain.py Outdated
@@ -143,6 +143,12 @@ def get_transaction_by_index(
def get_transaction_index(self, transaction_hash: Hash32) -> Tuple[BlockNumber, int]:
raise NotImplementedError("ChainDB classes must implement this method")

@abstractmethod
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: would be nice to have this directly next to get_receipts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 👍

@Bhargavasomu
Copy link
Contributor Author

@pipermerriam review please. Thankyou.

@cburgdorf cburgdorf merged commit eaa3f61 into ethereum:master Feb 21, 2019
@cburgdorf
Copy link
Contributor

@Bhargavasomu went ahead and merged it in preparation of a new release being cut within the next few days.

@Bhargavasomu Bhargavasomu deleted the chain_methods branch February 26, 2019 13:28
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.

2 participants