Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix endianness of getrawtransaction issuance entropy, add basic test #460

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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