Debug transaction signing
This commit is contained in:
parent
9b2c60f76c
commit
37270bfd14
1 changed files with 29 additions and 9 deletions
|
|
@ -28,6 +28,8 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <fc/io/raw.hpp>
|
#include <fc/io/raw.hpp>
|
||||||
|
|
||||||
|
#include <boost/algorithm/hex.hpp>
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
digest_type processed_transaction::merkle_digest()const
|
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)
|
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 );
|
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
|
signees.clear(); // Clear signees since it may be inconsistent after added a new signature
|
||||||
return signatures.back();
|
return signatures.back();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue