BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
adds a signature to a transaction More...
#include <transaction.hpp>
Public Member Functions | |
signed_transaction (const transaction &trx=transaction()) | |
virtual | ~signed_transaction ()=default |
const signature_type & | sign (const private_key_type &key, const chain_id_type &chain_id) |
signature_type | sign (const private_key_type &key, const chain_id_type &chain_id) const |
set< public_key_type > | get_required_signatures (const chain_id_type &chain_id, const flat_set< public_key_type > &available_keys, const std::function< const authority *(account_id_type)> &get_active, const std::function< const authority *(account_id_type)> &get_owner, bool allow_non_immediate_owner, bool ignore_custom_operation_required_authorities, uint32_t max_recursion=GRAPHENE_MAX_SIG_CHECK_DEPTH) const |
void | verify_authority (const chain_id_type &chain_id, const std::function< const authority *(account_id_type)> &get_active, const std::function< const authority *(account_id_type)> &get_owner, const custom_authority_lookup &get_custom, bool allow_non_immediate_owner, bool ignore_custom_operation_required_auths, uint32_t max_recursion=GRAPHENE_MAX_SIG_CHECK_DEPTH) const |
set< public_key_type > | minimize_required_signatures (const chain_id_type &chain_id, const flat_set< public_key_type > &available_keys, const std::function< const authority *(account_id_type)> &get_active, const std::function< const authority *(account_id_type)> &get_owner, const custom_authority_lookup &get_custom, bool allow_non_immediate_owner, bool ignore_custom_operation_required_auths, uint32_t max_recursion=GRAPHENE_MAX_SIG_CHECK_DEPTH) const |
virtual const flat_set< public_key_type > & | get_signature_keys (const chain_id_type &chain_id) const |
Extract public keys from signatures with given chain ID. More... | |
void | clear () |
void | clear_signatures () |
Public Member Functions inherited from graphene::protocol::transaction | |
virtual | ~transaction ()=default |
digest_type | digest () const |
Calculate the digest for a transaction. More... | |
virtual const transaction_id_type & | id () const |
virtual void | validate () const |
void | set_expiration (fc::time_point_sec expiration_time) |
void | set_reference_block (const block_id_type &reference_block) |
template<typename Visitor > | |
vector< typename Visitor::result_type > | visit (Visitor &&visitor) |
visit all operations More... | |
template<typename Visitor > | |
vector< typename Visitor::result_type > | visit (Visitor &&visitor) const |
void | get_required_authorities (flat_set< account_id_type > &active, flat_set< account_id_type > &owner, vector< authority > &other, bool ignore_custom_operation_required_auths) const |
virtual uint64_t | get_packed_size () const |
Public Attributes | |
vector< signature_type > | signatures |
Public Attributes inherited from graphene::protocol::transaction | |
uint16_t | ref_block_num = 0 |
uint32_t | ref_block_prefix = 0 |
fc::time_point_sec | expiration |
vector< operation > | operations |
extensions_type | extensions |
Protected Attributes | |
flat_set< public_key_type > | _signees |
Protected Attributes inherited from graphene::protocol::transaction | |
transaction_id_type | _tx_id_buffer |
Additional Inherited Members | |
Protected Member Functions inherited from graphene::protocol::transaction | |
digest_type | sig_digest (const chain_id_type &chain_id) const |
adds a signature to a transaction
Definition at line 134 of file transaction.hpp.
|
inline |
Definition at line 137 of file transaction.hpp.
|
virtualdefault |
|
inline |
Removes all operations and signatures
Definition at line 220 of file transaction.hpp.
|
inline |
Removes all signatures
Definition at line 223 of file transaction.hpp.
set< public_key_type > graphene::protocol::signed_transaction::get_required_signatures | ( | const chain_id_type & | chain_id, |
const flat_set< public_key_type > & | available_keys, | ||
const std::function< const authority *(account_id_type)> & | get_active, | ||
const std::function< const authority *(account_id_type)> & | get_owner, | ||
bool | allow_non_immediate_owner, | ||
bool | ignore_custom_operation_required_authorities, | ||
uint32_t | max_recursion = GRAPHENE_MAX_SIG_CHECK_DEPTH |
||
) | const |
The purpose of this method is to identify some subset of available_keys
that will produce sufficient signatures for a transaction. The result is not always a minimal set of signatures, but any non-minimal result will still pass validation.
Definition at line 366 of file transaction.cpp.
|
virtual |
Extract public keys from signatures with given chain ID.
chain_id | A chain ID |
chain_id
parameter will be ignored, and _signees will be returned directly. Reimplemented in graphene::protocol::precomputable_transaction.
Definition at line 350 of file transaction.cpp.
set< public_key_type > graphene::protocol::signed_transaction::minimize_required_signatures | ( | const chain_id_type & | chain_id, |
const flat_set< public_key_type > & | available_keys, | ||
const std::function< const authority *(account_id_type)> & | get_active, | ||
const std::function< const authority *(account_id_type)> & | get_owner, | ||
const custom_authority_lookup & | get_custom, | ||
bool | allow_non_immediate_owner, | ||
bool | ignore_custom_operation_required_auths, | ||
uint32_t | max_recursion = GRAPHENE_MAX_SIG_CHECK_DEPTH |
||
) | const |
This is a slower replacement for get_required_signatures() which returns a minimal set in all cases, including some cases where get_required_signatures() returns a non-minimal set.
Definition at line 401 of file transaction.cpp.
const signature_type & graphene::protocol::signed_transaction::sign | ( | const private_key_type & | key, |
const chain_id_type & | chain_id | ||
) |
signs and appends to signatures
Definition at line 77 of file transaction.cpp.
signature_type graphene::protocol::signed_transaction::sign | ( | const private_key_type & | key, |
const chain_id_type & | chain_id | ||
) | const |
returns signature but does not append
Definition at line 84 of file transaction.cpp.
void graphene::protocol::signed_transaction::verify_authority | ( | const chain_id_type & | chain_id, |
const std::function< const authority *(account_id_type)> & | get_active, | ||
const std::function< const authority *(account_id_type)> & | get_owner, | ||
const custom_authority_lookup & | get_custom, | ||
bool | allow_non_immediate_owner, | ||
bool | ignore_custom_operation_required_auths, | ||
uint32_t | max_recursion = GRAPHENE_MAX_SIG_CHECK_DEPTH |
||
) | const |
Checks whether signatures in this signed transaction are sufficient to authorize the transaction. Throws an exception when failed.
chain_id | the ID of a block chain |
get_active | callback function to retrieve active authorities of a given account |
get_owner | callback function to retrieve owner authorities of a given account |
get_custom | callback function to retrieve viable custom authorities for a given account and operation |
allow_non_immediate_owner | whether to allow owner authority of non-immediately required accounts to authorize operations in the transaction |
ignore_custom_operation_required_auths | See issue #210; whether to ignore the required_auths field of custom_operation or not |
max_recursion | maximum level of recursion when verifying, since an account can have another account in active authorities and/or owner authorities |
Definition at line 464 of file transaction.cpp.
|
mutableprotected |
Public keys extracted from signatures
Definition at line 226 of file transaction.hpp.
vector<signature_type> graphene::protocol::signed_transaction::signatures |
Signatures
Definition at line 217 of file transaction.hpp.