Skip to content
Open
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
25 changes: 12 additions & 13 deletions client/rpc/src/eth/pending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,16 @@

// Substrate
use sc_client_api::backend::{Backend, StorageProvider};
use sc_transaction_pool_api::{InPoolTransaction, TransactionPool};
use sp_api::{ApiExt, ApiRef, Core, ProvideRuntimeApi};
use sc_transaction_pool_api::TransactionPool;
use sp_api::{ApiRef, ProvideRuntimeApi};
use sp_block_builder::BlockBuilder as BlockBuilderApi;
use sp_blockchain::{ApplyExtrinsicFailed, HeaderBackend};
use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider};
use sp_runtime::{
generic::Digest,
traits::{Block as BlockT, Header as HeaderT, One},
TransactionOutcome,
};
use sp_inherents::{CreateInherentDataProviders, InherentData};
use sp_runtime::{generic::Digest, traits::Block as BlockT};

use crate::eth::Eth;
use fp_rpc::EthereumRuntimeRPCApi;

const LOG_TARGET: &str = "eth-pending";

/// The generated error type for creating pending runtime api.
#[derive(Debug, thiserror::Error)]
pub(crate) enum Error {
Expand Down Expand Up @@ -65,8 +59,13 @@ where
let api = self.client.runtime_api();

let info = self.client.info();
let (best_number, best_hash) = (info.best_number, info.best_hash);

/* It is a workaround to avoid using the pending block.
In subtensor, Aura pallet can not initialize with the same slot number
since the AllowMultipleBlocksPerSlot set as false in the runtime..
https://github.com/opentensor/subtensor/issues/2303

let (best_number, best_hash) = (info.best_number, info.best_hash);
let inherent_data_provider = self
.pending_create_inherent_data_providers
.create_inherent_data_providers(best_hash, ())
Expand Down Expand Up @@ -135,9 +134,9 @@ where
)),
Err(err) => TransactionOutcome::Rollback(Err(Error::from(err))),
});
}
}*/

Ok((best_hash, api))
Ok((info.best_hash, api))
}
}

Expand Down
Loading