change types of block number and returned keys (#320)
This commit is contained in:
parent
ce20e312e3
commit
2a513f88d3
|
@ -565,12 +565,12 @@ pub trait Middleware: Sync + Send + Debug {
|
||||||
#[cfg(feature = "celo")]
|
#[cfg(feature = "celo")]
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait CeloMiddleware: Middleware {
|
pub trait CeloMiddleware: Middleware {
|
||||||
async fn get_validators_bls_public_keys(
|
async fn get_validators_bls_public_keys<T: Into<BlockId> + Send + Sync>(
|
||||||
&self,
|
&self,
|
||||||
block: Option<BlockId>,
|
block_id: T,
|
||||||
) -> Result<Vec<Vec<u8>>, ProviderError> {
|
) -> Result<Vec<String>, ProviderError> {
|
||||||
self.provider()
|
self.provider()
|
||||||
.get_validators_bls_public_keys(block)
|
.get_validators_bls_public_keys(block_id)
|
||||||
.await
|
.await
|
||||||
.map_err(FromErr::from)
|
.map_err(FromErr::from)
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,12 +155,12 @@ impl<P: JsonRpcClient> Provider<P> {
|
||||||
#[cfg(feature = "celo")]
|
#[cfg(feature = "celo")]
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl<P: JsonRpcClient> CeloMiddleware for Provider<P> {
|
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,
|
&self,
|
||||||
block: Option<BlockId>,
|
block_id: T,
|
||||||
) -> Result<Vec<Vec<u8>>, ProviderError> {
|
) -> Result<Vec<String>, ProviderError> {
|
||||||
let block = utils::serialize(&block.unwrap_or_else(|| BlockNumber::Latest.into()));
|
let block_id = utils::serialize(&block_id.into());
|
||||||
self.request("istanbul_getValidatorsBLSPublicKeys", [block])
|
self.request("istanbul_getValidatorsBLSPublicKeys", [block_id])
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue