Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit 2a513f8

Browse files
authored
change types of block number and returned keys (#320)
1 parent ce20e31 commit 2a513f8

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Diff for: ethers-providers/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -565,12 +565,12 @@ pub trait Middleware: Sync + Send + Debug {
565565
#[cfg(feature = "celo")]
566566
#[async_trait]
567567
pub trait CeloMiddleware: Middleware {
568-
async fn get_validators_bls_public_keys(
568+
async fn get_validators_bls_public_keys<T: Into<BlockId> + Send + Sync>(
569569
&self,
570-
block: Option<BlockId>,
571-
) -> Result<Vec<Vec<u8>>, ProviderError> {
570+
block_id: T,
571+
) -> Result<Vec<String>, ProviderError> {
572572
self.provider()
573-
.get_validators_bls_public_keys(block)
573+
.get_validators_bls_public_keys(block_id)
574574
.await
575575
.map_err(FromErr::from)
576576
}

Diff for: ethers-providers/src/provider.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ impl<P: JsonRpcClient> Provider<P> {
155155
#[cfg(feature = "celo")]
156156
#[async_trait]
157157
impl<P: JsonRpcClient> CeloMiddleware for Provider<P> {
158-
async fn get_validators_bls_public_keys(
158+
async fn get_validators_bls_public_keys<T: Into<BlockId> + Send + Sync>(
159159
&self,
160-
block: Option<BlockId>,
161-
) -> Result<Vec<Vec<u8>>, ProviderError> {
162-
let block = utils::serialize(&block.unwrap_or_else(|| BlockNumber::Latest.into()));
163-
self.request("istanbul_getValidatorsBLSPublicKeys", [block])
160+
block_id: T,
161+
) -> Result<Vec<String>, ProviderError> {
162+
let block_id = utils::serialize(&block_id.into());
163+
self.request("istanbul_getValidatorsBLSPublicKeys", [block_id])
164164
.await
165165
}
166166
}

0 commit comments

Comments
 (0)