Skip to content

Commit

Permalink
Merge pull request #640 from lightninglabs/rename-asset-leaf-issuance…
Browse files Browse the repository at this point in the history
…-proof

multi: rename RPC AssetLeaf proof field to account for transfer proofs
  • Loading branch information
ffranr authored Nov 2, 2023
2 parents 6379c0d + 088fb32 commit e3cf11e
Show file tree
Hide file tree
Showing 7 changed files with 395 additions and 396 deletions.
4 changes: 2 additions & 2 deletions cmd/tapcli/universe.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ func universeProofInsert(ctx *cli.Context) error {
LeafKey: assetKey,
},
AssetLeaf: &unirpc.AssetLeaf{
Asset: rpcAsset,
IssuanceProof: rawProof,
Asset: rpcAsset,
Proof: rawProof,
},
}
resp, err := client.InsertProof(ctxc, req)
Expand Down
4 changes: 2 additions & 2 deletions itest/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1186,8 +1186,8 @@ func AssertUniverseLeavesEqual(t *testing.T, uniIDs []*unirpc.ID,
)

require.Equal(
t, aLeaves.Leaves[i].IssuanceProof,
bLeaves.Leaves[i].IssuanceProof,
t, aLeaves.Leaves[i].Proof,
bLeaves.Leaves[i].Proof,
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions proof/courier.go
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,8 @@ func (c *UniverseRpcCourier) DeliverProof(ctx context.Context,
}

assetLeaf := unirpc.AssetLeaf{
Asset: rpcAsset,
IssuanceProof: proofBuf.Bytes(),
Asset: rpcAsset,
Proof: proofBuf.Bytes(),
}

// Construct universe key.
Expand Down Expand Up @@ -1202,7 +1202,7 @@ func (c *UniverseRpcCourier) ReceiveProof(ctx context.Context,
err)
}

proofBlob = resp.AssetLeaf.IssuanceProof
proofBlob = resp.AssetLeaf.Proof

return nil
}
Expand Down
6 changes: 3 additions & 3 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3314,8 +3314,8 @@ func marshalAssetLeaf(ctx context.Context, keys taprpc.KeyLookup,
}

return &unirpc.AssetLeaf{
Asset: rpcAsset,
IssuanceProof: buf.Bytes(),
Asset: rpcAsset,
Proof: buf.Bytes(),
}, nil
}

Expand Down Expand Up @@ -3622,7 +3622,7 @@ func unmarshalAssetLeaf(leaf *unirpc.AssetLeaf) (*universe.Leaf, error) {
// itself.
var assetProof proof.Proof
if err := assetProof.Decode(
bytes.NewReader(leaf.IssuanceProof),
bytes.NewReader(leaf.Proof),
); err != nil {
return nil, err
}
Expand Down
759 changes: 379 additions & 380 deletions taprpc/universerpc/universe.pb.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions taprpc/universerpc/universe.proto
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ message AssetLeaf {

// TODO(roasbeef): only needed for display? can get from proof below ^

// The asset issuance proof, which proves that the asset specified above
// was issued properly. This is always just an individual mint/transfer
// proof and never a proof file.
bytes issuance_proof = 2;
// The asset issuance or transfer proof, which proves that the asset
// specified above was issued or transferred properly. This is always just
// an individual mint/transfer proof and never a proof file.
bytes proof = 2;
}

message AssetLeafResponse {
Expand Down
4 changes: 2 additions & 2 deletions taprpc/universerpc/universe.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1590,10 +1590,10 @@
"$ref": "#/definitions/taprpcAsset",
"description": "The asset included in the leaf."
},
"issuance_proof": {
"proof": {
"type": "string",
"format": "byte",
"description": "The asset issuance proof, which proves that the asset specified above\nwas issued properly. This is always just an individual mint/transfer\nproof and never a proof file."
"description": "The asset issuance or transfer proof, which proves that the asset\nspecified above was issued or transferred properly. This is always just\nan individual mint/transfer proof and never a proof file."
}
}
},
Expand Down

0 comments on commit e3cf11e

Please sign in to comment.