Skip to content

Commit a02ba50

Browse files
committed
tapdb: rename FetchMintAnchorUniCommitment to FetchSupplyPreCommits
Rename SQL query to better align with "supply" terminology.
1 parent ba63071 commit a02ba50

File tree

5 files changed

+96
-96
lines changed

5 files changed

+96
-96
lines changed

tapdb/asset_minting.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ type (
116116
// database ID.
117117
ProofUpdateByID = sqlc.UpsertAssetProofByIDParams
118118

119-
// FetchPreCommitParams is a type alias for the params used to fetch
120-
// mint anchor pre-commitments.
121-
FetchPreCommitParams = sqlc.FetchMintAnchorUniCommitmentParams
119+
// FetchPreCommitsParams is a type alias for the params used to fetch
120+
// mint anchor supply pre-commitments.
121+
FetchPreCommitsParams = sqlc.FetchSupplyPreCommitsParams
122122

123123
// FetchAssetID is used to fetch the primary key ID of an asset, by
124124
// outpoint and tweaked script key.
@@ -248,10 +248,10 @@ type PendingAssetStore interface {
248248
FetchAssetMetaForAsset(ctx context.Context,
249249
assetID []byte) (sqlc.FetchAssetMetaForAssetRow, error)
250250

251-
// FetchMintAnchorUniCommitment fetches mint anchor pre-commitments.
252-
FetchMintAnchorUniCommitment(ctx context.Context,
253-
arg FetchPreCommitParams) (
254-
[]sqlc.FetchMintAnchorUniCommitmentRow, error)
251+
// FetchSupplyPreCommits fetches mint anchor pre-commitments.
252+
FetchSupplyPreCommits(ctx context.Context,
253+
arg FetchPreCommitsParams) (
254+
[]sqlc.FetchSupplyPreCommitsRow, error)
255255

256256
// UpsertMintAnchorUniCommitment inserts a new or updates an existing
257257
// mint anchor uni commitment on disk.
@@ -1347,8 +1347,8 @@ func marshalMintingBatch(ctx context.Context, q PendingAssetStore,
13471347
// the pre-commitment output index from the database.
13481348
var preCommitOut fn.Option[tapgarden.PreCommitmentOutput]
13491349
if dbBatch.UniverseCommitments {
1350-
fetchRes, err := q.FetchMintAnchorUniCommitment(
1351-
ctx, FetchPreCommitParams{
1350+
fetchRes, err := q.FetchSupplyPreCommits(
1351+
ctx, FetchPreCommitsParams{
13521352
BatchKey: dbBatch.RawKey,
13531353
},
13541354
)
@@ -1545,8 +1545,8 @@ func (a *AssetMintingStore) FetchDelegationKey(ctx context.Context,
15451545

15461546
readOpts := NewAssetStoreReadTx()
15471547
dbErr := a.db.ExecTx(ctx, &readOpts, func(q PendingAssetStore) error {
1548-
fetchRow, err := q.FetchMintAnchorUniCommitment(
1549-
ctx, FetchPreCommitParams{
1548+
fetchRow, err := q.FetchSupplyPreCommits(
1549+
ctx, FetchPreCommitsParams{
15501550
GroupKey: groupKeyBytes,
15511551
},
15521552
)

tapdb/asset_minting_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,10 +1883,10 @@ func assertSupplyPreCommit(t *testing.T, assetStore AssetMintingStore,
18831883
ctx := context.Background()
18841884
readOpts := NewAssetStoreReadTx()
18851885

1886-
var preCommit *sqlc.FetchMintAnchorUniCommitmentRow
1886+
var preCommit *sqlc.FetchSupplyPreCommitsRow
18871887
readMintAnchorCommitment := func(q PendingAssetStore) error {
1888-
fetchRes, err := q.FetchMintAnchorUniCommitment(
1889-
ctx, FetchPreCommitParams{
1888+
fetchRes, err := q.FetchSupplyPreCommits(
1889+
ctx, FetchPreCommitsParams{
18901890
BatchKey: batchKey,
18911891
},
18921892
)

tapdb/sqlc/assets.sql.go

Lines changed: 78 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tapdb/sqlc/querier.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tapdb/sqlc/queries/assets.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ ON CONFLICT(batch_id, tx_output_index) DO UPDATE SET
10871087
outpoint = EXCLUDED.outpoint
10881088
RETURNING id;
10891089

1090-
-- name: FetchMintAnchorUniCommitment :many
1090+
-- name: FetchSupplyPreCommits :many
10911091
-- Fetch records from the supply_pre_commits table with optional
10921092
-- filtering.
10931093
SELECT

0 commit comments

Comments
 (0)