frontier_template_node/
client.rs

1use scale_codec::Codec;
2// Substrate
3use sc_executor::WasmExecutor;
4use sp_runtime::traits::{Block as BlockT, MaybeDisplay};
5
6use crate::eth::EthCompatRuntimeApiCollection;
7
8/// Full backend.
9pub type FullBackend<B> = sc_service::TFullBackend<B>;
10/// Full client.
11pub type FullClient<B, RA, HF> = sc_service::TFullClient<B, RA, WasmExecutor<HF>>;
12
13/// A set of APIs that every runtime must implement.
14pub 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
24impl<Block, Api> BaseRuntimeApiCollection<Block> for Api
25where
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 template runtime must implement.
37pub 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{
51}
52
53impl<Block, AuraId, AccountId, Nonce, Balance, Api>
54	RuntimeApiCollection<Block, AuraId, AccountId, Nonce, Balance> for Api
55where
56	Block: BlockT,
57	AuraId: Codec,
58	AccountId: Codec,
59	Nonce: Codec,
60	Balance: Codec + MaybeDisplay,
61	Api: BaseRuntimeApiCollection<Block>
62		+ EthCompatRuntimeApiCollection<Block>
63		+ sp_consensus_aura::AuraApi<Block, AuraId>
64		+ sp_consensus_grandpa::GrandpaApi<Block>
65		+ frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
66		+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>,
67{
68}