-
Notifications
You must be signed in to change notification settings - Fork 795
Conversation
ethers-providers/src/provider.rs
Outdated
}) | ||
} | ||
|
||
async fn get_uncle_gen( |
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.
async fn get_uncle_gen( | |
async fn get_uncle( |
The _gen
suffix was added to the get_block_gen
function, so that you can choose between getting just the transaction hashes or the full transaction set due to the boolean parameter supplied to it. In this case it shouldn't be necessary since uncle blocks are always w/o transactions.
ethers-providers/src/provider.rs
Outdated
@@ -164,6 +164,40 @@ impl<P: JsonRpcClient> Provider<P> { | |||
} | |||
}) | |||
} | |||
|
|||
async fn get_uncle_count_gen(&self, id: BlockId) -> Result<U256, ProviderError> { |
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.
async fn get_uncle_count_gen(&self, id: BlockId) -> Result<U256, ProviderError> { | |
async fn get_uncle_count(&self, id: BlockId) -> Result<U256, ProviderError> { |
Same comment as below
ethers-providers/src/provider.rs
Outdated
&self, | ||
block_hash_or_number: T, | ||
) -> Result<U256, Self::Error> { | ||
self.get_uncle_count_gen(block_hash_or_number.into()).await |
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.
self.get_uncle_count_gen(block_hash_or_number.into()).await | |
self.get_uncle_count(block_hash_or_number.into()).await |
ethers-providers/src/provider.rs
Outdated
block_hash_or_number: T, | ||
idx: U256, | ||
) -> Result<Option<Block<H256>>, ProviderError> { | ||
self.get_uncle_gen(block_hash_or_number.into(), idx).await |
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.
self.get_uncle_gen(block_hash_or_number.into(), idx).await | |
self.get_uncle(block_hash_or_number.into(), idx).await |
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 - thank you.
Motivation
missing uncle block related api
Solution
add uncle block related missing api