Kagome
Polkadot Runtime Engine in C++17
block_builder_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_AUTHORSHIP_IMPL_BLOCK_BUILDER_IMPL_HPP
7 #define KAGOME_CORE_AUTHORSHIP_IMPL_BLOCK_BUILDER_IMPL_HPP
8 
10 
11 #include "log/logger.hpp"
12 #include "primitives/block_id.hpp"
16 
17 namespace kagome::authorship {
18 
19  class BlockBuilderImpl : public BlockBuilder {
20  public:
21  ~BlockBuilderImpl() override = default;
22 
24  const storage::trie::RootHash &storage_state,
25  std::shared_ptr<runtime::BlockBuilder> block_builder_api);
26 
27  outcome::result<std::vector<primitives::Extrinsic>> getInherentExtrinsics(
28  const primitives::InherentData &data) const override;
29 
30  outcome::result<primitives::ExtrinsicIndex> pushExtrinsic(
31  const primitives::Extrinsic &extrinsic) override;
32 
33  outcome::result<primitives::Block> bake() const override;
34 
35  size_t estimateBlockSize() const override;
36 
37  private:
38  size_t estimatedBlockHeaderSize() const;
39 
41  std::shared_ptr<runtime::BlockBuilder> block_builder_api_;
44 
45  std::vector<primitives::Extrinsic> extrinsics_{};
46  };
47 
48 } // namespace kagome::authorship
49 
50 #endif // KAGOME_CORE_AUTHORSHIP_IMPL_BLOCK_BUILDER_IMPL_HPP
std::shared_ptr< runtime::BlockBuilder > block_builder_api_
outcome::result< primitives::Block > bake() const override
outcome::result< std::vector< primitives::Extrinsic > > getInherentExtrinsics(const primitives::InherentData &data) const override
std::shared_ptr< soralog::Logger > Logger
Definition: logger.hpp:23
BlockBuilderImpl(primitives::BlockHeader block_header, const storage::trie::RootHash &storage_state, std::shared_ptr< runtime::BlockBuilder > block_builder_api)
outcome::result< primitives::ExtrinsicIndex > pushExtrinsic(const primitives::Extrinsic &extrinsic) override
std::vector< primitives::Extrinsic > extrinsics_
Extrinsic class represents extrinsic.
Definition: extrinsic.hpp:24