Skip to content

Commit b476056

Browse files
committed
universe: rename BaseBackend.FetchIssuanceProof to FetchProof
Renamed method to better reflect its broader usage. It now applies to both issuance proof leaves and transfer proof leaves.
1 parent 116ac96 commit b476056

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

proof/mock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ func (m *MockProofArchive) FetchIssuanceProof(_ context.Context,
356356
}
357357

358358
// Mimic the pattern matching done with proof file paths in
359-
// FileArchiver.FetchIssuanceProof().
359+
// FileArchiver.FetchProof().
360360
matchingHashes := make([][32]byte, 0)
361361
locMatcher := func(locBytes [132]byte, locHash [32]byte) error {
362362
if bytes.Equal(locBytes[:32], id[:]) &&

tapdb/universe.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -807,11 +807,11 @@ func universeUpsertProofLeaf(ctx context.Context, dbTx BaseUniverseStore,
807807
}, nil
808808
}
809809

810-
// FetchIssuanceProof returns an issuance proof for the target key. If the key
811-
// doesn't have a script key specified, then all the proofs for the minting
812-
// outpoint will be returned. If neither are specified, then proofs for all the
813-
// inserted leaves will be returned.
814-
func (b *BaseUniverseTree) FetchIssuanceProof(ctx context.Context,
810+
// FetchProof retrieves a universe proof corresponding to the given key. If the
811+
// key omits a script key, all proofs for the specified minting outpoint will be
812+
// returned. If both the script key and minting outpoint are omitted, proofs for
813+
// all inserted leaves in the universe will be returned.
814+
func (b *BaseUniverseTree) FetchProof(ctx context.Context,
815815
universeKey universe.LeafKey) ([]*universe.Proof, error) {
816816

817817
var (

tapdb/universe_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ func TestUniverseIssuanceProofs(t *testing.T) {
328328

329329
// We should be able to fetch the issuance proof now, using
330330
// that very same target key generated.
331-
dbProof, err := baseUniverse.FetchIssuanceProof(ctx, targetKey)
331+
dbProof, err := baseUniverse.FetchProof(ctx, targetKey)
332332
require.NoError(t, err)
333333

334334
uniProof := dbProof[0]
@@ -481,7 +481,7 @@ func TestUniverseMetaBlob(t *testing.T) {
481481

482482
// We should be able to fetch the leaf based on the base key we used
483483
// above.
484-
dbProof, err := baseUniverse.FetchIssuanceProof(ctx, targetKey)
484+
dbProof, err := baseUniverse.FetchProof(ctx, targetKey)
485485
require.NoError(t, err)
486486

487487
uniProof := dbProof[0]
@@ -688,7 +688,7 @@ func TestUniverseLeafQuery(t *testing.T) {
688688

689689
// If we query for only the minting point, then all three leaves should
690690
// be returned.
691-
proofs, err := baseUniverse.FetchIssuanceProof(
691+
proofs, err := baseUniverse.FetchProof(
692692
ctx, universe.BaseLeafKey{
693693
OutPoint: rootMintingPoint,
694694
},
@@ -703,7 +703,7 @@ func TestUniverseLeafQuery(t *testing.T) {
703703
scriptKey, err := btcec.ParsePubKey(scriptKeyBytes[:])
704704
require.NoError(t, err)
705705

706-
p, err := baseUniverse.FetchIssuanceProof(
706+
p, err := baseUniverse.FetchProof(
707707
ctx, universe.BaseLeafKey{
708708
OutPoint: rootMintingPoint,
709709
ScriptKey: &asset.ScriptKey{
@@ -759,7 +759,7 @@ func TestUniverseLeafOverflow(t *testing.T) {
759759

760760
// We should be able to fetch the leaf based on the base key we used
761761
// above.
762-
_, err = baseUniverse.FetchIssuanceProof(ctx, targetKey)
762+
_, err = baseUniverse.FetchProof(ctx, targetKey)
763763
require.NoError(t, err)
764764

765765
// If we try to insert another, then this should fail, as the tree will
@@ -771,7 +771,7 @@ func TestUniverseLeafOverflow(t *testing.T) {
771771
require.ErrorIs(t, err, mssmt.ErrIntegerOverflow)
772772

773773
// We should still be able to fetch the original issuance proof.
774-
_, err = baseUniverse.FetchIssuanceProof(ctx, targetKey)
774+
_, err = baseUniverse.FetchProof(ctx, targetKey)
775775
require.NoError(t, err)
776776
}
777777

@@ -877,7 +877,7 @@ func TestUniverseRootSum(t *testing.T) {
877877
// Each of the leaves inserted should have the proper
878878
// value as well.
879879
for i, key := range keys {
880-
proofs, err := baseUniverse.FetchIssuanceProof(
880+
proofs, err := baseUniverse.FetchProof(
881881
ctx, key,
882882
)
883883
require.NoError(t, err)

universe/interface.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,14 +414,14 @@ type BaseBackend interface {
414414
RegisterIssuance(ctx context.Context, key LeafKey, leaf *Leaf,
415415
metaReveal *proof.MetaReveal) (*Proof, error)
416416

417-
// FetchIssuanceProof returns an issuance proof for the target key. If
418-
// the key doesn't have a script key specified, then all the proofs for
419-
// the minting outpoint will be returned. If neither are specified,
420-
// then proofs for all the inserted leaves will be returned.
417+
// FetchProof retrieves a universe proof corresponding to the given key.
418+
// If the key omits a script key, all proofs for the specified minting
419+
// outpoint will be returned. If both the script key and minting
420+
// outpoint are omitted, proofs for all inserted leaves in the universe
421+
// will be returned.
421422
//
422423
// TODO(roasbeef): can eventually do multi-proofs for the SMT
423-
FetchIssuanceProof(ctx context.Context,
424-
key LeafKey) ([]*Proof, error)
424+
FetchProof(ctx context.Context, key LeafKey) ([]*Proof, error)
425425

426426
// FetchKeys retrieves all keys from the universe tree.
427427
FetchKeys(ctx context.Context,

0 commit comments

Comments
 (0)