MCPcopy Create free account
hub / github.com/cryptonomex/graphene / signTransaction

Method signTransaction

programs/light_client/GrapheneApplication.cpp:112–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112void GrapheneApplication::signTransaction(Transaction* transaction) const
113{
114 if (transaction == nullptr) return;
115
116 auto getActiveAuth = [this](graphene::chain::account_id_type id) {
117 return &model()->getAccount(id.instance.value)->accountObject().active;
118 };
119 auto getOwnerAuth = [this](graphene::chain::account_id_type id) {
120 return &model()->getAccount(id.instance.value)->accountObject().owner;
121 };
122
123 auto& chainId = model()->chain_properties().chain_id;
124 auto& trx = transaction->internalTransaction();
125 trx.set_reference_block(model()->dynamic_global_properties().head_block_id);
126 flat_set<public_key_type> pubKeys = wallet()->getAvailablePrivateKeys();
127 auto requiredKeys = trx.get_required_signatures(chainId, pubKeys, getActiveAuth, getOwnerAuth);
128 trx.signatures = wallet()->signDigest(trx.digest(), requiredKeys);
129 idump((trx));
130}
131
132
133Q_SLOT void GrapheneApplication::execute(const std::function<void()>& func)const

Callers

nothing calls this directly

Calls 5

getAccountMethod · 0.80
set_reference_blockMethod · 0.80
signDigestMethod · 0.80
digestMethod · 0.45

Tested by

no test coverage detected