chore: regenerate umbrella crate, fix feature propagation
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
use crate::{
|
||||
client::{SubscriptionType, BizinikiwiBlock, BizinikiwiBlockNumber},
|
||||
client::{BizinikiwiBlock, BizinikiwiBlockNumber, SubscriptionType},
|
||||
subxt_client::SrcChainConfig,
|
||||
ClientError,
|
||||
};
|
||||
@@ -50,7 +50,8 @@ pub trait BlockInfoProvider: Send + Sync {
|
||||
) -> Result<Option<Arc<BizinikiwiBlock>>, ClientError>;
|
||||
|
||||
/// Get block by block hash.
|
||||
async fn block_by_hash(&self, hash: &H256) -> Result<Option<Arc<BizinikiwiBlock>>, ClientError>;
|
||||
async fn block_by_hash(&self, hash: &H256)
|
||||
-> Result<Option<Arc<BizinikiwiBlock>>, ClientError>;
|
||||
}
|
||||
|
||||
/// Provides information about blocks.
|
||||
@@ -86,7 +87,11 @@ impl SubxtBlockInfoProvider {
|
||||
|
||||
#[async_trait]
|
||||
impl BlockInfoProvider for SubxtBlockInfoProvider {
|
||||
async fn update_latest(&self, block: Arc<BizinikiwiBlock>, subscription_type: SubscriptionType) {
|
||||
async fn update_latest(
|
||||
&self,
|
||||
block: Arc<BizinikiwiBlock>,
|
||||
subscription_type: SubscriptionType,
|
||||
) {
|
||||
let mut latest = match subscription_type {
|
||||
SubscriptionType::FinalizedBlocks => self.latest_finalized_block.write().await,
|
||||
SubscriptionType::BestBlocks => self.latest_block.write().await,
|
||||
@@ -127,7 +132,10 @@ impl BlockInfoProvider for SubxtBlockInfoProvider {
|
||||
}
|
||||
}
|
||||
|
||||
async fn block_by_hash(&self, hash: &H256) -> Result<Option<Arc<BizinikiwiBlock>>, ClientError> {
|
||||
async fn block_by_hash(
|
||||
&self,
|
||||
hash: &H256,
|
||||
) -> Result<Option<Arc<BizinikiwiBlock>>, ClientError> {
|
||||
let latest = self.latest_block().await;
|
||||
if hash == &latest.hash() {
|
||||
return Ok(Some(latest));
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// limitations under the License.
|
||||
//! The Ethereum JSON-RPC server.
|
||||
use crate::{
|
||||
client::{connect, Client, SubscriptionType, BizinikiwiBlockNumber},
|
||||
client::{connect, BizinikiwiBlockNumber, Client, SubscriptionType},
|
||||
DebugRpcServer, DebugRpcServerImpl, EthRpcServer, EthRpcServerImpl, ReceiptExtractor,
|
||||
ReceiptProvider, SubxtBlockInfoProvider, SystemHealthRpcServer, SystemHealthRpcServerImpl,
|
||||
LOG_TARGET,
|
||||
@@ -270,7 +270,11 @@ fn rpc_module(is_dev: bool, client: Client) -> Result<RpcModule<()>, pezsc_servi
|
||||
|
||||
let mut module = RpcModule::new(());
|
||||
module.merge(eth_api).map_err(|e| pezsc_service::Error::Application(e.into()))?;
|
||||
module.merge(health_api).map_err(|e| pezsc_service::Error::Application(e.into()))?;
|
||||
module.merge(debug_api).map_err(|e| pezsc_service::Error::Application(e.into()))?;
|
||||
module
|
||||
.merge(health_api)
|
||||
.map_err(|e| pezsc_service::Error::Application(e.into()))?;
|
||||
module
|
||||
.merge(debug_api)
|
||||
.map_err(|e| pezsc_service::Error::Application(e.into()))?;
|
||||
Ok(module)
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ use pezpallet_revive::{
|
||||
},
|
||||
EthTransactError,
|
||||
};
|
||||
use runtime_api::RuntimeApi;
|
||||
use pezsp_runtime::traits::Block as BlockT;
|
||||
use pezsp_weights::Weight;
|
||||
use runtime_api::RuntimeApi;
|
||||
use std::{ops::Range, sync::Arc, time::Duration};
|
||||
use storage_api::StorageApi;
|
||||
use subxt::{
|
||||
@@ -514,7 +514,10 @@ impl Client {
|
||||
}
|
||||
|
||||
/// Get receipts count per block.
|
||||
pub async fn receipts_count_per_block(&self, block_hash: &BizinikiwiBlockHash) -> Option<usize> {
|
||||
pub async fn receipts_count_per_block(
|
||||
&self,
|
||||
block_hash: &BizinikiwiBlockHash,
|
||||
) -> Option<usize> {
|
||||
self.receipt_provider.receipts_count_per_block(block_hash).await
|
||||
}
|
||||
|
||||
@@ -710,8 +713,8 @@ impl Client {
|
||||
// This could potentially fail under below circumstances:
|
||||
// - state has been pruned
|
||||
// - the block author cannot be obtained from the digest logs (highly unlikely)
|
||||
// - the node we are targeting has an outdated revive pezpallet (or ETH block functionality is
|
||||
// disabled)
|
||||
// - the node we are targeting has an outdated revive pezpallet (or ETH block functionality
|
||||
// is disabled)
|
||||
match self.runtime_api(block.hash()).eth_block().await {
|
||||
Ok(mut eth_block) => {
|
||||
log::trace!(target: LOG_TARGET, "Ethereum block from runtime API hash {:?}", eth_block.hash);
|
||||
|
||||
@@ -611,8 +611,8 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::test::{MockBlockInfo, MockBlockInfoProvider};
|
||||
use pezpallet_revive::evm::{ReceiptInfo, TransactionSigned};
|
||||
use pretty_assertions::assert_eq;
|
||||
use pezsp_core::{H160, H256};
|
||||
use pretty_assertions::assert_eq;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
async fn count(pool: &SqlitePool, table: &str, block_hash: Option<H256>) -> usize {
|
||||
|
||||
Reference in New Issue
Block a user