Skip to content

Commit ef4011a

Browse files
committed
tapfreighter+tapdb: rename ConfirmParcelDelivery to LogAnchorTxConfirm
This commit renames the ExportLog method from ConfirmParcelDelivery to LogAnchorTxConfirm. The purpose of this change is to clarify that the method does not confirm parcel delivery to disk, as transfer proofs may still be pending. Instead, it updates the send package on disk to indicate that the transfer anchoring transaction has been confirmed on-chain.
1 parent 093f9b7 commit ef4011a

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

tapdb/assets_store.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,9 +2809,10 @@ func (a *AssetStore) ConfirmProofDelivery(ctx context.Context,
28092809
return nil
28102810
}
28112811

2812-
// ConfirmParcelDelivery marks a spend event on disk as confirmed. This updates
2813-
// the on-chain reference information on disk to point to this new spend.
2814-
func (a *AssetStore) ConfirmParcelDelivery(ctx context.Context,
2812+
// LogAnchorTxConfirm updates the send package state on disk to reflect the
2813+
// confirmation of the anchor transaction, ensuring the on-chain reference
2814+
// information is up to date.
2815+
func (a *AssetStore) LogAnchorTxConfirm(ctx context.Context,
28152816
conf *tapfreighter.AssetConfirmEvent) error {
28162817

28172818
var (

tapdb/assets_store_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@ func TestAssetExportLog(t *testing.T) {
15241524
fakeBlockHash := chainhash.Hash(sha256.Sum256([]byte("fake")))
15251525
blockHeight := int32(100)
15261526
txIndex := int32(10)
1527-
err = assetsStore.ConfirmParcelDelivery(
1527+
err = assetsStore.LogAnchorTxConfirm(
15281528
ctx, &tapfreighter.AssetConfirmEvent{
15291529
AnchorTXID: firstOutputAnchor.OutPoint.Hash,
15301530
TxIndex: txIndex,

tapfreighter/chain_porter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ func (p *ChainPorter) storePackageAnchorTxConf(pkg *sendPackage) error {
650650
// parcel delivery as completed in the database.
651651
anchorTXID := pkg.OutboundPkg.AnchorTx.TxHash()
652652
anchorTxBlockHeight := int32(pkg.TransferTxConfEvent.BlockHeight)
653-
err := p.cfg.ExportLog.ConfirmParcelDelivery(ctx, &AssetConfirmEvent{
653+
err := p.cfg.ExportLog.LogAnchorTxConfirm(ctx, &AssetConfirmEvent{
654654
AnchorTXID: anchorTXID,
655655
BlockHash: *pkg.TransferTxConfEvent.BlockHash,
656656
BlockHeight: anchorTxBlockHeight,

tapfreighter/interface.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,10 @@ type ExportLog interface {
421421
// transferred.
422422
ConfirmProofDelivery(context.Context, wire.OutPoint, uint64) error
423423

424-
// ConfirmParcelDelivery marks a spend event on disk as confirmed. This
425-
// updates the on-chain reference information on disk to point to this
426-
// new spend.
427-
ConfirmParcelDelivery(context.Context, *AssetConfirmEvent) error
424+
// LogAnchorTxConfirm updates the send package state on disk to reflect
425+
// the confirmation of the anchor transaction, ensuring the on-chain
426+
// reference information is up to date.
427+
LogAnchorTxConfirm(context.Context, *AssetConfirmEvent) error
428428

429429
// QueryParcels returns the set of confirmed or unconfirmed parcels.
430430
QueryParcels(ctx context.Context, anchorTxHash *chainhash.Hash,

0 commit comments

Comments
 (0)