Skip to content

Commit

Permalink
fix endianness of getrawtransaction issuance entropy, add basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs committed Nov 8, 2018
1 parent 5fe9c2c commit 8b0ebae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions qa/rpc-tests/confidential_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ def run_test(self):
# Quick unblinded reissuance check, making 2*COIN total
self.nodes[0].reissueasset(issued["asset"], 1)

# Compare resulting fields with getrawtransaction
raw_details = self.nodes[0].getrawtransaction(issued["txid"], 1)
assert_equal(issued["entropy"], raw_details["vin"][issued["vin"]]["issuance"]["assetEntropy"])
assert_equal(issued["asset"], raw_details["vin"][issued["vin"]]["issuance"]["asset"])
assert_equal(issued["token"], raw_details["vin"][issued["vin"]]["issuance"]["token"])

testAssetHex = issued["asset"]
self.nodes[0].generate(1)
self.sync_all()
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
uint256 entropy;
if (issuance.assetBlindingNonce.IsNull()) {
GenerateAssetEntropy(entropy, txin.prevout, issuance.assetEntropy);
issue.push_back(Pair("assetEntropy", HexStr(entropy)));
issue.push_back(Pair("assetEntropy", entropy.GetHex()));
CalculateAsset(asset, entropy);
CalculateReissuanceToken(token, entropy, issuance.nAmount.IsCommitment());
issue.push_back(Pair("isreissuance", false));
Expand Down

0 comments on commit 8b0ebae

Please sign in to comment.