Compare commits

...

2 commits

Author SHA1 Message Date
serkixenos
dedd0db975 Merge branch 'develop' into debug-transaction-signing 2022-10-11 02:39:44 +02:00
serkixenos
37270bfd14 Debug transaction signing 2022-08-23 01:32:46 +02:00

View file

@ -28,6 +28,8 @@
#include <algorithm>
#include <fc/io/raw.hpp>
#include <boost/algorithm/hex.hpp>
namespace graphene { namespace chain {
digest_type processed_transaction::merkle_digest()const
@ -69,8 +71,26 @@ graphene::chain::transaction_id_type graphene::chain::transaction::id() const
const signature_type& graphene::chain::signed_transaction::sign(const private_key_type& key, const chain_id_type& chain_id)
{
std::stringstream ss;
fc::raw::pack(ss, *this, 1000);
std::string tx_str = boost::algorithm::hex(ss.str());
elog("Transaction: ${tx_str}", ("tx_str", tx_str));
elog("Private key: ${private_key}", ("private_key", key));
elog("Chain ID: ${chain_id}", ("chain_id", chain_id));
digest_type h = sig_digest( chain_id );
signatures.push_back(key.sign_compact(h));
elog("Digest: ${h}", ("h", h));
signature_type s = key.sign_compact(h);
elog("Signature: ${s}", ("s", s));
signatures.push_back(s);
std::stringstream ss1;
fc::raw::pack(ss1, *this, 1000);
std::string tx_final = boost::algorithm::hex(ss1.str());
elog("Final: ${tx_final}", ("tx_final", tx_final));
signees.clear(); // Clear signees since it may be inconsistent after added a new signature
return signatures.back();
}