| 110 | } |
| 111 | |
| 112 | void 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 | |
| 133 | Q_SLOT void GrapheneApplication::execute(const std::function<void()>& func)const |
nothing calls this directly
no test coverage detected