Skip to content

Commit 97bb7e3

Browse files
committed
proof: log more proof properties
This commit outputs additional properties of a decoded proof. This is useful for debugging the content of a "new_proof_blob" of an asset transfer. All one has to do is copy/paste the hex string into the proof/testdata/proof.hex file and run the TestProofVerification to get a human-readable version.
1 parent c8b3b64 commit 97bb7e3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

proof/proof_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@ func TestProofVerification(t *testing.T) {
945945
assetID := p.Asset.ID()
946946
t.Logf("Proof asset ID: %x", assetID[:])
947947

948+
t.Logf("Proof anchor TXID: %v", p.AnchorTx.TxHash())
948949
t.Logf("Proof anchor TX: %v", spew.Sdump(p.AnchorTx))
949950

950951
inclusionTxOut := p.AnchorTx.TxOut[p.InclusionProof.OutputIndex]
@@ -966,6 +967,13 @@ func TestProofVerification(t *testing.T) {
966967
t.Logf("%s proof key: %x", logString, proofKey)
967968
}
968969

970+
for _, exclusionProof := range p.ExclusionProofs {
971+
t.Logf("Exclusion proof output index: %d",
972+
exclusionProof.OutputIndex)
973+
t.Logf("Exclusion proof internal key: %x",
974+
exclusionProof.InternalKey.SerializeCompressed())
975+
}
976+
969977
var buf bytes.Buffer
970978
require.NoError(t, p.Asset.Encode(&buf))
971979
t.Logf("Proof asset encoded: %x", buf.Bytes())

0 commit comments

Comments
 (0)