Skip to content

Commit fd84f6f

Browse files
committed
tapdb: rename UpsertMintAnchorUniCommitment to UpsertSupplyPreCommit
Rename SQL query to better align with "suppl" terminology.
1 parent a02ba50 commit fd84f6f

File tree

6 files changed

+68
-68
lines changed

6 files changed

+68
-68
lines changed

tapdb/asset_minting.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ type (
132132
// disk.
133133
NewAssetMeta = sqlc.UpsertAssetMetaParams
134134

135-
// MintAnchorUniCommitParams wraps the params needed to insert a new
136-
// mint anchor uni commitment on disk.
137-
MintAnchorUniCommitParams = sqlc.UpsertMintAnchorUniCommitmentParams
135+
// UpsertPreCommitParams wraps the params needed to insert a new
136+
// supply pre-commit on disk.
137+
UpsertPreCommitParams = sqlc.UpsertSupplyPreCommitParams
138138
)
139139

140140
// PendingAssetStore is a sub-set of the main sqlc.Querier interface that
@@ -253,10 +253,10 @@ type PendingAssetStore interface {
253253
arg FetchPreCommitsParams) (
254254
[]sqlc.FetchSupplyPreCommitsRow, error)
255255

256-
// UpsertMintAnchorUniCommitment inserts a new or updates an existing
256+
// UpsertSupplyPreCommit inserts a new or updates an existing
257257
// mint anchor uni commitment on disk.
258-
UpsertMintAnchorUniCommitment(ctx context.Context,
259-
arg MintAnchorUniCommitParams) (int64, error)
258+
UpsertSupplyPreCommit(ctx context.Context,
259+
arg UpsertPreCommitParams) (int64, error)
260260
}
261261

262262
var (
@@ -448,8 +448,8 @@ func insertMintAnchorTx(ctx context.Context, q PendingAssetStore,
448448
return fmt.Errorf("unable to encode outpoint: %w", err)
449449
}
450450

451-
_, err = q.UpsertMintAnchorUniCommitment(
452-
ctx, MintAnchorUniCommitParams{
451+
_, err = q.UpsertSupplyPreCommit(
452+
ctx, UpsertPreCommitParams{
453453
BatchKey: rawBatchKey,
454454
TxOutputIndex: int32(preCommitOut.OutIdx),
455455
TaprootInternalKeyID: internalKeyID,
@@ -1644,8 +1644,8 @@ func upsertPreCommit(ctx context.Context, q PendingAssetStore,
16441644
return fmt.Errorf("unable to encode outpoint: %w", err)
16451645
}
16461646

1647-
_, err = q.UpsertMintAnchorUniCommitment(
1648-
ctx, MintAnchorUniCommitParams{
1647+
_, err = q.UpsertSupplyPreCommit(
1648+
ctx, UpsertPreCommitParams{
16491649
BatchKey: batchKey,
16501650
TxOutputIndex: int32(preCommit.OutIdx),
16511651
TaprootInternalKeyID: internalKeyID,

tapdb/asset_minting_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,8 +1858,8 @@ func storeSupplyPreCommit(t *testing.T, assetStore AssetMintingStore,
18581858
opBytes, err := encodeOutpoint(outpoint)
18591859
require.NoError(t, err)
18601860

1861-
_, err = q.UpsertMintAnchorUniCommitment(
1862-
ctx, sqlc.UpsertMintAnchorUniCommitmentParams{
1861+
_, err = q.UpsertSupplyPreCommit(
1862+
ctx, UpsertPreCommitParams{
18631863
BatchKey: batchKey,
18641864
TxOutputIndex: txOutputIndex,
18651865
TaprootInternalKeyID: internalKeyID,

tapdb/sqlc/assets.sql.go

Lines changed: 49 additions & 49 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: 4 additions & 4 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
@@ -1062,7 +1062,7 @@ JOIN genesis_assets
10621062
ON genesis_assets.meta_data_id = assets_meta.meta_id
10631063
ORDER BY assets_meta.meta_id;
10641064

1065-
-- name: UpsertMintAnchorUniCommitment :one
1065+
-- name: UpsertSupplyPreCommit :one
10661066
-- Upsert a record into the supply_pre_commits table.
10671067
-- If a record with the same batch ID and tx output index already exists, update
10681068
-- the existing record. Otherwise, insert a new record.

tapdb/supply_commit_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ func (h *supplyCommitTestHarness) addTestMintAnchorUniCommitment(
242242
err = wire.WriteOutPoint(&outpointBuf, 0, 0, &outpoint)
243243
require.NoError(h.t, err)
244244

245-
anchorCommitID, err := h.db.UpsertMintAnchorUniCommitment(
246-
h.ctx, sqlc.UpsertMintAnchorUniCommitmentParams{
245+
anchorCommitID, err := h.db.UpsertSupplyPreCommit(
246+
h.ctx, UpsertPreCommitParams{
247247
BatchKey: batchKeyBytes,
248248
TxOutputIndex: txOutputIndex,
249249
TaprootInternalKeyID: internalKeyID,

0 commit comments

Comments
 (0)