This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
RPC: parity_getBlockReceipts #9527
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f8742e4
Block receipts RPC.
tomusdrw 4311b4e
Merge branch 'master' into td-blockreceipts
tomusdrw 799d56c
Use lazy evaluation of block receipts (ecrecover).
tomusdrw 1dd3b94
Optimize transaction_receipt to prevent performance regression.
tomusdrw a066b53
Merge branch 'master' into td-blockreceipts
tomusdrw 7619f30
Merge branch 'master' into td-blockreceipts
tomusdrw fd3e7be
Fix RPC grumbles.
tomusdrw f287e58
Add block & transaction receipt tests.
tomusdrw 8bb8e78
Fix conversion to block id.
tomusdrw 87de315
Merge branch 'master' into td-blockreceipts
tomusdrw 14c50f6
Merge branch 'master' into td-blockreceipts
debris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,22 @@ impl BlockNumber { | |
_ => None, | ||
} | ||
} | ||
|
||
/// Convert block number to block id. | ||
pub fn to_block_id(self) -> BlockId { | ||
// NOTE Here we treat `Pending` as `Latest`. | ||
// Since light clients don't produce pending blocks | ||
// (they don't have state) we can safely fallback to `Latest`. | ||
match self { | ||
BlockNumber::Num(n) => BlockId::Number(n), | ||
BlockNumber::Earliest => BlockId::Earliest, | ||
BlockNumber::Latest => BlockId::Latest, | ||
BlockNumber::Pending => { | ||
warn!("`Pending` is deprecated and may be removed in future versions. Falling back to `Latest`"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, this should only get logged when accessed from the light client impl. So maybe move back to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved it to a trait, so it explicitly says it's for light client only. |
||
BlockId::Latest | ||
} | ||
} | ||
} | ||
} | ||
|
||
impl Serialize for BlockNumber { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Trailing
== latest?