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

fix: change the type of block number and pub key #320

Merged
merged 1 commit into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ethers-providers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,12 +565,12 @@ pub trait Middleware: Sync + Send + Debug {
#[cfg(feature = "celo")]
#[async_trait]
pub trait CeloMiddleware: Middleware {
async fn get_validators_bls_public_keys(
async fn get_validators_bls_public_keys<T: Into<BlockId> + Send + Sync>(
&self,
block: Option<BlockId>,
) -> Result<Vec<Vec<u8>>, ProviderError> {
block_id: T,
) -> Result<Vec<String>, ProviderError> {
self.provider()
.get_validators_bls_public_keys(block)
.get_validators_bls_public_keys(block_id)
.await
.map_err(FromErr::from)
}
Expand Down
10 changes: 5 additions & 5 deletions ethers-providers/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ impl<P: JsonRpcClient> Provider<P> {
#[cfg(feature = "celo")]
#[async_trait]
impl<P: JsonRpcClient> CeloMiddleware for Provider<P> {
async fn get_validators_bls_public_keys(
async fn get_validators_bls_public_keys<T: Into<BlockId> + Send + Sync>(
&self,
block: Option<BlockId>,
) -> Result<Vec<Vec<u8>>, ProviderError> {
let block = utils::serialize(&block.unwrap_or_else(|| BlockNumber::Latest.into()));
self.request("istanbul_getValidatorsBLSPublicKeys", [block])
block_id: T,
) -> Result<Vec<String>, ProviderError> {
let block_id = utils::serialize(&block_id.into());
self.request("istanbul_getValidatorsBLSPublicKeys", [block_id])
.await
}
}
Expand Down