|
1 |
| -use scale_codec::Codec; |
2 |
| -// Substrate |
3 |
| -use sp_runtime::traits::{Block as BlockT, MaybeDisplay}; |
4 |
| - |
5 |
| -use crate::ethereum::EthCompatRuntimeApiCollection; |
6 |
| -use crate::service::RuntimeExecutor; |
| 1 | +use node_subtensor_runtime::{opaque::Block, RuntimeApi}; |
| 2 | +use sc_executor::WasmExecutor; |
7 | 3 |
|
8 | 4 | /// Full backend.
|
9 |
| -pub type FullBackend<B> = sc_service::TFullBackend<B>; |
| 5 | +pub type FullBackend = sc_service::TFullBackend<Block>; |
10 | 6 | /// Full client.
|
11 |
| -pub type FullClient<B, RA> = sc_service::TFullClient<B, RA, RuntimeExecutor>; |
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, RuntimeExecutor>; |
| 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 | +pub type HostFunctions = ( |
| 14 | + sp_io::SubstrateHostFunctions, |
| 15 | + sp_crypto_ec_utils::bls12_381::host_calls::HostFunctions, |
| 16 | + frame_benchmarking::benchmarking::HostFunctions, |
| 17 | +); |
| 18 | +pub type RuntimeExecutor = WasmExecutor<HostFunctions>; |
0 commit comments