15 std::shared_ptr<Executor> executor,
16 std::shared_ptr<storage::changes_trie::ChangesTracker> changes_tracker,
17 std::shared_ptr<const blockchain::BlockHeaderRepository> header_repo)
18 : executor_{std::move(executor)},
39 return parent_res.has_value()
40 and parent_res.value().number == block.
header.
number - 1;
43 OUTCOME_TRY(
executor_->persistentCallAt<
void>(
45 return outcome::success();
51 const auto res =
executor_->persistentCallAt<
void>(
52 header.
parent_hash,
"Core_initialize_block", header);
53 if (res.has_value()) {
54 return res.value().new_storage_root;
Block class represents polkadot block primitive.
std::shared_ptr< storage::changes_trie::ChangesTracker > changes_tracker_
std::shared_ptr< Executor > executor_
outcome::result< primitives::Version > version() override
Returns the version of the runtime - version for nested calls, such as in MiscExtension.
outcome::result< storage::trie::RootHash > initialize_block(const primitives::BlockHeader &header) override
Initialize a block with the given header.
CoreImpl(std::shared_ptr< Executor > executor, std::shared_ptr< storage::changes_trie::ChangesTracker > changes_tracker, std::shared_ptr< const blockchain::BlockHeaderRepository > header_repo)
BlockHeader header
block header
outcome::result< void > execute_block(const primitives::Block &block) override
Executes the given block.
std::shared_ptr< const blockchain::BlockHeaderRepository > header_repo_