16 using primitives::events::InBlockEventParams;
21 std::shared_ptr<runtime::BlockBuilder> block_builder_api)
22 : block_header_{std::move(block_header)},
29 outcome::result<std::vector<primitives::Extrinsic>>
49 "Extrinsic {} was not pushed to block. Error during xt application: " 52 apply_res.error().message());
53 return apply_res.error();
57 using return_type = outcome::result<primitives::ExtrinsicIndex>;
58 return visit_in_place(
59 apply_res.value().result,
65 "Extrinsic {} pushed to the block, but dispatch error occurred",
73 return visit_in_place(
85 "Extrinsic {} cannot be applied and was not pushed to " 86 "the block. (InvalidTransaction response, code {})",
88 static_cast<uint8_t
>(reason));
95 "Extrinsic {} cannot be applied and was not pushed to " 96 "the block. (UnknownTransaction response, code {})",
98 static_cast<uint8_t
>(reason));
105 OUTCOME_TRY(finalized_header,
107 {block_header_.number - 1, block_header_.parent_hash},
113 scale::ScaleEncoderStream s(
true);
121 static std::optional<size_t> size = std::nullopt;
123 scale::ScaleEncoderStream s(
true);
std::shared_ptr< runtime::BlockBuilder > block_builder_api_
Block class represents polkadot block primitive.
subscription::SubscriptionEngine< SubscribedExtrinsicId, std::shared_ptr< api::Session >, primitives::events::ExtrinsicLifecycleEvent > ExtrinsicSubscriptionEngine
boost::variant< InvalidTransaction, UnknownTransaction > TransactionValidityError
boost::variant< DispatchSuccess, DispatchError > DispatchOutcome
outcome::result< primitives::Block > bake() const override
common::Buffer data
extrinsic content as byte array
size_t estimateBlockSize() const override
UnknownTransaction
An unknown transaction validity.
outcome::result< std::vector< primitives::Extrinsic > > getInherentExtrinsics(const primitives::InherentData &data) const override
BlockBuilderImpl(primitives::BlockHeader block_header, const storage::trie::RootHash &storage_state, std::shared_ptr< runtime::BlockBuilder > block_builder_api)
std::string toHex() const
encode bytearray as hex
outcome::result< primitives::ExtrinsicIndex > pushExtrinsic(const primitives::Extrinsic &extrinsic) override
std::vector< primitives::Extrinsic > extrinsics_
size_t estimatedBlockHeaderSize() const
primitives::BlockHeader block_header_
Extrinsic class represents extrinsic.
Logger createLogger(const std::string &tag)
storage::trie::RootHash storage_state_
InvalidTransaction
Transaction is invalid. Details are described by the error code.