Currently, I am trying to test how frame-executive is working in this repo
I add some logs in executive interface impl_runtime_apis!
: https://github.com/paritytech/substrate/blob/master/bin/node/runtime/src/lib.rs#L1811
Code:
impl sp_api::Core<Block> for Runtime {
...
fn execute_block(block: Block) {
log::info!("RUNTIME : GO IN EXECUTE BLOCK");
Executive::execute_block(block);
}
fn initialize_block(header: &<Block as BlockT>::Header) {
log::info!("RUNTIME : GO IN INITIALIZE BLOCK");
Executive::initialize_block(header)
}
}
...
impl sp_block_builder::BlockBuilder<Block> for Runtime {
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
log::info!("RUNTIME : GO IN APPLY EXTRINSIC");
Executive::apply_extrinsic(extrinsic)
}
fn finalize_block() -> <Block as BlockT>::Header {
log::info!("RUNTIME : GO IN FINALIZE BLOCK");
Executive::finalize_block()
}
Result:
Problem:
Executive::execute_block(block);
API doesn't trigger and display in the terminal (although I executed a simple transfer
extrinsic)
How should I understand? How do I trigger this execute_block()
API?