10 const std::shared_ptr<runtime::ParachainHost> ¶chain_api,
13 parachain_api->session_index_for_child(relay_parent));
20 std::shared_ptr<crypto::Sr25519Keypair> keypair,
21 std::shared_ptr<crypto::Hasher> hasher,
22 std::shared_ptr<crypto::Sr25519Provider> sr25519_provider)
23 : validator_index_{validator_index},
38 std::shared_ptr<runtime::ParachainHost> parachain_api,
39 std::shared_ptr<crypto::SessionKeys> session_keys,
40 std::shared_ptr<crypto::Hasher> hasher,
41 std::shared_ptr<crypto::Sr25519Provider> sr25519_provider)
42 : parachain_api_{std::move(parachain_api)},
50 if (keypair ==
nullptr) {
55 std::find(validators.begin(), validators.end(), keypair->public_key);
56 if (it == validators.end()) {
network::ValidatorIndex ValidatorIndex
outcome::result< std::optional< ValidatorSigner > > at(const primitives::BlockHash &relay_parent)
Create validator signer if keypair belongs to validator at given block.
std::shared_ptr< crypto::Sr25519Keypair > keypair_
ValidatorSigner(ValidatorIndex validator_index, SigningContext context, std::shared_ptr< crypto::Sr25519Keypair > keypair, std::shared_ptr< crypto::Hasher > hasher, std::shared_ptr< crypto::Sr25519Provider > sr25519_provider)
runtime::SessionIndex session_index
Current session index.
ValidatorIndex validatorIndex() const
Get validator index.
std::shared_ptr< crypto::Sr25519Provider > sr25519_provider_
ValidatorIndex validator_index_
std::shared_ptr< crypto::Hasher > hasher_
std::shared_ptr< runtime::ParachainHost > parachain_api_
const primitives::BlockHash & relayParent() const
Get relay parent hash.
std::shared_ptr< crypto::SessionKeys > session_keys_
std::shared_ptr< crypto::Hasher > hasher_
std::shared_ptr< crypto::Sr25519Provider > sr25519_provider_
ValidatorSignerFactory(std::shared_ptr< runtime::ParachainHost > parachain_api, std::shared_ptr< crypto::SessionKeys > session_keys, std::shared_ptr< crypto::Hasher > hasher, std::shared_ptr< crypto::Sr25519Provider > sr25519_provider)
static outcome::result< SigningContext > make(const std::shared_ptr< runtime::ParachainHost > ¶chain_api, const primitives::BlockHash &relay_parent)
Make signing context for given block.
Signs payload with signing context and validator keypair.
A type returned by runtime with current session index and a parent hash.
primitives::BlockHash relay_parent
Hash of the parent.