Kagome
Polkadot Runtime Engine in C++17
|
#include <author_api_impl.hpp>
Public Member Functions | |
AuthorApiImpl (sptr< runtime::SessionKeysApi > key_api, sptr< transaction_pool::TransactionPool > pool, sptr< crypto::CryptoStore > store, sptr< crypto::SessionKeys > keys, sptr< crypto::KeyFileStorage > key_store, sptr< blockchain::BlockTree > block_tree) | |
~AuthorApiImpl () override=default | |
void | setApiService (sptr< api::ApiService > const &api_service) override |
outcome::result< common::Hash256 > | submitExtrinsic (TransactionSource source, const primitives::Extrinsic &extrinsic) override |
validates and sends extrinsic to transaction pool More... | |
outcome::result< void > | insertKey (crypto::KeyTypeId key_type, const gsl::span< const uint8_t > &seed, const gsl::span< const uint8_t > &public_key) override |
insert an anonimous key pair into the keystore More... | |
outcome::result< common::Buffer > | rotateKeys () override |
Generate new session keys and returns the corresponding public keys. More... | |
outcome::result< bool > | hasSessionKeys (const gsl::span< const uint8_t > &keys) override |
checks if the keystore has private keys for the given session public keys More... | |
outcome::result< bool > | hasKey (const gsl::span< const uint8_t > &public_key, crypto::KeyTypeId key_type) override |
checks if the keystore has private keys for the given public key and key type More... | |
outcome::result< std::vector< primitives::Extrinsic > > | pendingExtrinsics () override |
outcome::result< std::vector< primitives::Extrinsic > > | removeExtrinsic (const std::vector< primitives::ExtrinsicKey > &keys) override |
outcome::result< SubscriptionId > | submitAndWatchExtrinsic (Extrinsic extrinsic) override |
outcome::result< bool > | unwatchExtrinsic (SubscriptionId subscription_id) override |
Public Member Functions inherited from kagome::api::AuthorApi | |
virtual | ~AuthorApi ()=default |
virtual void | setApiService (std::shared_ptr< api::ApiService > const &api_service)=0 |
Private Types | |
template<class T > | |
using | sptr = std::shared_ptr< T > |
template<class T > | |
using | uptr = std::unique_ptr< T > |
Private Attributes | |
sptr< runtime::SessionKeysApi > | keys_api_ |
sptr< transaction_pool::TransactionPool > | pool_ |
sptr< crypto::CryptoStore > | store_ |
sptr< crypto::SessionKeys > | keys_ |
sptr< crypto::KeyFileStorage > | key_store_ |
std::weak_ptr< api::ApiService > | api_service_ |
sptr< blockchain::BlockTree > | block_tree_ |
log::Logger | logger_ |
Additional Inherited Members | |
Protected Types inherited from kagome::api::AuthorApi | |
using | Hash256 = common::Hash256 |
using | Buffer = common::Buffer |
using | Extrinsic = primitives::Extrinsic |
using | Metadata = primitives::Metadata |
using | SubscriptionId = primitives::SubscriptionId |
using | ExtrinsicKey = primitives::ExtrinsicKey |
using | TransactionSource = primitives::TransactionSource |
Definition at line 56 of file author_api_impl.hpp.
|
private |
Definition at line 58 of file author_api_impl.hpp.
|
private |
Definition at line 60 of file author_api_impl.hpp.
kagome::api::AuthorApiImpl::AuthorApiImpl | ( | sptr< runtime::SessionKeysApi > | key_api, |
sptr< transaction_pool::TransactionPool > | pool, | ||
sptr< crypto::CryptoStore > | store, | ||
sptr< crypto::SessionKeys > | keys, | ||
sptr< crypto::KeyFileStorage > | key_store, | ||
sptr< blockchain::BlockTree > | block_tree | ||
) |
api | ttq instance shared ptr |
pool | transaction pool instance shared ptr |
hasher | hasher instance shared ptr |
block_tree | block tree instance shared ptr |
Definition at line 34 of file author_api_impl.cpp.
|
overridedefault |
|
overridevirtual |
checks if the keystore has private keys for the given public key and key type
public_key | The public key in binary |
key_type | The key type |
Implements kagome::api::AuthorApi.
Definition at line 165 of file author_api_impl.cpp.
|
overridevirtual |
checks if the keystore has private keys for the given session public keys
keys | SCALE encoded concatenated keys |
Implements kagome::api::AuthorApi.
Definition at line 136 of file author_api_impl.cpp.
|
overridevirtual |
insert an anonimous key pair into the keystore
key_type | Key type |
seed | The seed (suri) in binary |
public_key | The public key in binary |
Implements kagome::api::AuthorApi.
Definition at line 68 of file author_api_impl.cpp.
|
overridevirtual |
Implements kagome::api::AuthorApi.
Definition at line 175 of file author_api_impl.cpp.
|
overridevirtual |
Remove given extrinsic from the pool and temporarily ban it to prevent reimporting.
Implements kagome::api::AuthorApi.
Definition at line 190 of file author_api_impl.cpp.
|
overridevirtual |
Generate new session keys and returns the corresponding public keys.
Implements kagome::api::AuthorApi.
Definition at line 126 of file author_api_impl.cpp.
|
override |
Definition at line 56 of file author_api_impl.cpp.
|
overridevirtual |
Submit an extrinsic and watch.
Implements kagome::api::AuthorApi.
Definition at line 197 of file author_api_impl.cpp.
|
overridevirtual |
validates and sends extrinsic to transaction pool
source | how extrinsic was received (for example external or submitted through offchain worker) |
extrinsic | set of bytes representing either transaction or inherent |
Implements kagome::api::AuthorApi.
Definition at line 62 of file author_api_impl.cpp.
|
overridevirtual |
Unsubscribe from extrinsic watching.
Implements kagome::api::AuthorApi.
Definition at line 220 of file author_api_impl.cpp.
|
private |
Definition at line 116 of file author_api_impl.hpp.
|
private |
Definition at line 117 of file author_api_impl.hpp.
|
private |
Definition at line 115 of file author_api_impl.hpp.
|
private |
Definition at line 114 of file author_api_impl.hpp.
|
private |
Definition at line 111 of file author_api_impl.hpp.
|
private |
Definition at line 119 of file author_api_impl.hpp.
|
private |
Definition at line 112 of file author_api_impl.hpp.
|
private |
Definition at line 113 of file author_api_impl.hpp.