Skip to content

Commit 850d4ef

Browse files
committed
Remove unnecessary generics
1 parent b096420 commit 850d4ef

File tree

4 files changed

+146
-358
lines changed

4 files changed

+146
-358
lines changed

node/src/client.rs

Lines changed: 12 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,16 @@
1-
use scale_codec::Codec;
2-
// Substrate
1+
use node_subtensor_runtime::{opaque::Block, RuntimeApi};
32
use sc_executor::WasmExecutor;
4-
use sp_runtime::traits::{Block as BlockT, MaybeDisplay};
5-
6-
use crate::ethereum::EthCompatRuntimeApiCollection;
73

84
/// Full backend.
9-
pub type FullBackend<B> = sc_service::TFullBackend<B>;
5+
pub type FullBackend = sc_service::TFullBackend<Block>;
106
/// Full client.
11-
pub type FullClient<B, RA, HF> = sc_service::TFullClient<B, RA, WasmExecutor<HF>>;
12-
13-
/// A set of APIs that every runtime must implement.
14-
pub trait BaseRuntimeApiCollection<Block: BlockT>:
15-
sp_api::ApiExt<Block>
16-
+ sp_api::Metadata<Block>
17-
+ sp_block_builder::BlockBuilder<Block>
18-
+ sp_offchain::OffchainWorkerApi<Block>
19-
+ sp_session::SessionKeys<Block>
20-
+ sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
21-
{
22-
}
23-
24-
impl<Block, Api> BaseRuntimeApiCollection<Block> for Api
25-
where
26-
Block: BlockT,
27-
Api: sp_api::ApiExt<Block>
28-
+ sp_api::Metadata<Block>
29-
+ sp_block_builder::BlockBuilder<Block>
30-
+ sp_offchain::OffchainWorkerApi<Block>
31-
+ sp_session::SessionKeys<Block>
32-
+ sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>,
33-
{
34-
}
35-
36-
/// A set of APIs that Subtensor runtime must implement.
37-
pub trait RuntimeApiCollection<
38-
Block: BlockT,
39-
AuraId: Codec,
40-
AccountId: Codec,
41-
Nonce: Codec,
42-
Balance: Codec + MaybeDisplay,
43-
>:
44-
BaseRuntimeApiCollection<Block>
45-
+ EthCompatRuntimeApiCollection<Block>
46-
+ sp_consensus_aura::AuraApi<Block, AuraId>
47-
+ sp_consensus_grandpa::GrandpaApi<Block>
48-
+ frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
49-
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
50-
+ subtensor_custom_rpc_runtime_api::DelegateInfoRuntimeApi<Block>
51-
+ subtensor_custom_rpc_runtime_api::NeuronInfoRuntimeApi<Block>
52-
+ subtensor_custom_rpc_runtime_api::SubnetInfoRuntimeApi<Block>
53-
+ subtensor_custom_rpc_runtime_api::SubnetRegistrationRuntimeApi<Block>
54-
{
55-
}
56-
57-
impl<Block, AuraId, AccountId, Nonce, Balance, Api>
58-
RuntimeApiCollection<Block, AuraId, AccountId, Nonce, Balance> for Api
59-
where
60-
Block: BlockT,
61-
AuraId: Codec,
62-
AccountId: Codec,
63-
Nonce: Codec,
64-
Balance: Codec + MaybeDisplay,
65-
Api: BaseRuntimeApiCollection<Block>
66-
+ EthCompatRuntimeApiCollection<Block>
67-
+ sp_consensus_aura::AuraApi<Block, AuraId>
68-
+ sp_consensus_grandpa::GrandpaApi<Block>
69-
+ frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
70-
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
71-
+ subtensor_custom_rpc_runtime_api::DelegateInfoRuntimeApi<Block>
72-
+ subtensor_custom_rpc_runtime_api::NeuronInfoRuntimeApi<Block>
73-
+ subtensor_custom_rpc_runtime_api::SubnetInfoRuntimeApi<Block>
74-
+ subtensor_custom_rpc_runtime_api::SubnetRegistrationRuntimeApi<Block>,
75-
{
76-
}
7+
pub type FullClient = sc_service::TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>;
8+
/// Always enable runtime benchmark host functions, the genesis state
9+
/// was built with them so we're stuck with them forever.
10+
///
11+
/// They're just a noop, never actually get used if the runtime was not compiled with
12+
/// `runtime-benchmarks`.
13+
type HostFunctions = (
14+
sp_io::SubstrateHostFunctions,
15+
frame_benchmarking::benchmarking::HostFunctions,
16+
);

0 commit comments

Comments
 (0)