Skip to content

Commit 17afcc0

Browse files
committed
tapdb: rename unit test functionality for new term "supply"
1 parent 1c9da69 commit 17afcc0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tapdb/asset_minting_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,8 +1835,8 @@ func TestTapscriptTreeManager(t *testing.T) {
18351835
loadTapscriptTreeChecked(t, ctx, assetStore, tree5, tree5Hash)
18361836
}
18371837

1838-
// storeMintAnchorUniCommitment stores a mint anchor commitment in the DB.
1839-
func storeMintAnchorUniCommitment(t *testing.T, assetStore AssetMintingStore,
1838+
// storeSupplyPreCommit stores a mint anchor commitment in the DB.
1839+
func storeSupplyPreCommit(t *testing.T, assetStore AssetMintingStore,
18401840
batchKey []byte, txOutputIndex int32,
18411841
taprootInternalKey keychain.KeyDescriptor, groupKey []byte) {
18421842

@@ -1869,9 +1869,9 @@ func storeMintAnchorUniCommitment(t *testing.T, assetStore AssetMintingStore,
18691869
_ = assetStore.db.ExecTx(ctx, &writeTxOpts, upsertMintAnchorPreCommit)
18701870
}
18711871

1872-
// assertMintAnchorUniCommitment is a helper function that reads a mint anchor
1872+
// assertSupplyPreCommit is a helper function that reads a mint anchor
18731873
// commitment from the DB and asserts that it matches the expected values.
1874-
func assertMintAnchorUniCommitment(t *testing.T, assetStore AssetMintingStore,
1874+
func assertSupplyPreCommit(t *testing.T, assetStore AssetMintingStore,
18751875
batchKey []byte, txOutputIndex int32,
18761876
preCommitInternalKey keychain.KeyDescriptor, groupPubKeyBytes []byte) {
18771877

@@ -1914,10 +1914,10 @@ func assertMintAnchorUniCommitment(t *testing.T, assetStore AssetMintingStore,
19141914
require.Equal(t, groupPubKeyBytes, preCommit.GroupKey)
19151915
}
19161916

1917-
// TestUpsertMintAnchorUniCommitment tests the UpsertMintAnchorUniCommitment
1918-
// FetchMintAnchorUniCommitment and SQL queries. In particular, it tests that
1919-
// upsert works correctly.
1920-
func TestUpsertMintAnchorUniCommitment(t *testing.T) {
1917+
// TestUpsertSupplyPreCommit tests the UpsertSupplyPreCommit and
1918+
// FetchSupplyPreCommits SQL queries. In particular, it tests that upsert works
1919+
// correctly.
1920+
func TestUpsertSupplyPreCommit(t *testing.T) {
19211921
t.Parallel()
19221922

19231923
ctx := context.Background()
@@ -1955,13 +1955,13 @@ func TestUpsertMintAnchorUniCommitment(t *testing.T) {
19551955

19561956
// Upsert a mint anchor commitment for the batch.
19571957
txOutputIndex := int32(2)
1958-
storeMintAnchorUniCommitment(
1958+
storeSupplyPreCommit(
19591959
t, *assetStore, batchKey, txOutputIndex,
19601960
preCommitInternalKey, groupPubKeyBytes,
19611961
)
19621962

19631963
// Retrieve and inspect the mint anchor commitment we just inserted.
1964-
assertMintAnchorUniCommitment(
1964+
assertSupplyPreCommit(
19651965
t, *assetStore, batchKey, txOutputIndex,
19661966
preCommitInternalKey, groupPubKeyBytes,
19671967
)
@@ -1970,12 +1970,12 @@ func TestUpsertMintAnchorUniCommitment(t *testing.T) {
19701970
// overwrite the existing one.
19711971
internalKey2, _ := test.RandKeyDesc(t)
19721972

1973-
storeMintAnchorUniCommitment(
1973+
storeSupplyPreCommit(
19741974
t, *assetStore, batchKey, txOutputIndex, internalKey2,
19751975
groupPubKeyBytes,
19761976
)
19771977

1978-
assertMintAnchorUniCommitment(
1978+
assertSupplyPreCommit(
19791979
t, *assetStore, batchKey, txOutputIndex, internalKey2,
19801980
groupPubKeyBytes,
19811981
)
@@ -1985,12 +1985,12 @@ func TestUpsertMintAnchorUniCommitment(t *testing.T) {
19851985
groupPubKey2 := test.RandPubKey(t)
19861986
groupPubKey2Bytes := groupPubKey2.SerializeCompressed()
19871987

1988-
storeMintAnchorUniCommitment(
1988+
storeSupplyPreCommit(
19891989
t, *assetStore, batchKey, txOutputIndex, internalKey2,
19901990
groupPubKey2Bytes,
19911991
)
19921992

1993-
assertMintAnchorUniCommitment(
1993+
assertSupplyPreCommit(
19941994
t, *assetStore, batchKey, txOutputIndex, internalKey2,
19951995
groupPubKey2Bytes,
19961996
)

0 commit comments

Comments
 (0)