frame_benchmarking_cli/overhead/
fake_runtime_api.rs1use sp_core::OpaqueMetadata;
23use sp_runtime::{
24 generic,
25 traits::{BlakeTwo256, Block as BlockT},
26 transaction_validity::{TransactionSource, TransactionValidity},
27 ApplyExtrinsicResult, OpaqueExtrinsic,
28};
29
30type BlockNumber = u32;
32type Header = generic::Header<BlockNumber, BlakeTwo256>;
34type Block = generic::Block<Header, OpaqueExtrinsic>;
36
37#[allow(unused)]
38pub struct Runtime;
39
40sp_api::impl_runtime_apis! {
41 impl sp_api::Core<Block> for Runtime {
42 fn version() -> sp_version::RuntimeVersion {
43 unimplemented!()
44 }
45
46 fn execute_block(_: Block) {
47 unimplemented!()
48 }
49
50 fn initialize_block(_: &<Block as BlockT>::Header) -> sp_runtime::ExtrinsicInclusionMode {
51 unimplemented!()
52 }
53 }
54
55 impl sp_api::Metadata<Block> for Runtime {
56 fn metadata() -> OpaqueMetadata {
57 unimplemented!()
58 }
59
60 fn metadata_at_version(_: u32) -> Option<OpaqueMetadata> {
61 unimplemented!()
62 }
63
64 fn metadata_versions() -> Vec<u32> {
65 unimplemented!()
66 }
67 }
68 impl sp_block_builder::BlockBuilder<Block> for Runtime {
69 fn apply_extrinsic(_: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
70 unimplemented!()
71 }
72
73 fn finalize_block() -> <Block as BlockT>::Header {
74 unimplemented!()
75 }
76
77 fn inherent_extrinsics(_: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
78 unimplemented!()
79 }
80
81 fn check_inherents(_: Block, _: sp_inherents::InherentData) -> sp_inherents::CheckInherentsResult {
82 unimplemented!()
83 }
84 }
85
86 impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {
87 fn validate_transaction(
88 _: TransactionSource,
89 _: <Block as BlockT>::Extrinsic,
90 _: <Block as BlockT>::Hash,
91 ) -> TransactionValidity {
92 unimplemented!()
93 }
94 }
95
96 impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
97 fn build_state(_: Vec<u8>) -> sp_genesis_builder::Result {
98 unimplemented!()
99 }
100
101 fn get_preset(_id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
102 unimplemented!()
103 }
104
105 fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
106 unimplemented!()
107 }
108 }
109}