Skip to content

Commit 093f9b7

Browse files
committed
tapfreighter: rename ChainPorter state to SendStateStorePostAnchorTxConf
This commit renames the ChainPorter state from SendStateStoreProofs to SendStateStorePostAnchorTxConf. The new name more accurately represents its function, reflecting that this state now performs broader storage updates beyond just storing proofs. Additionally, the name indicates that this state is triggered after the confirmation of the transfer anchoring transaction on-chain, without delving into the specific details of the operations performed within the state.
1 parent 4d504a0 commit 093f9b7

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

tapfreighter/chain_porter.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ func (p *ChainPorter) waitForTransferTxConf(pkg *sendPackage) error {
415415
confEvent.BlockHash,
416416
)
417417

418-
pkg.SendState = SendStateStoreProofs
418+
pkg.SendState = SendStateStorePostAnchorTxConf
419419

420420
case err := <-errChan:
421421
return fmt.Errorf("error whilst waiting for package tx "+
@@ -1233,9 +1233,10 @@ func (p *ChainPorter) stateStep(currentPkg sendPackage) (*sendPackage, error) {
12331233
err := p.waitForTransferTxConf(&currentPkg)
12341234
return &currentPkg, err
12351235

1236-
// At this point, the transfer transaction is confirmed on-chain. We go
1237-
// on to store the sender and receiver proofs in the proof archive.
1238-
case SendStateStoreProofs:
1236+
// The transfer transaction is now confirmed on-chain. We'll update the
1237+
// package state on disk to reflect this. This step frees up the change
1238+
// outputs so that they can be used in future transactions.
1239+
case SendStateStorePostAnchorTxConf:
12391240
err := p.storeProofs(&currentPkg)
12401241
if err != nil {
12411242
return nil, fmt.Errorf("unable to store proofs: %w",

tapfreighter/parcel.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,12 @@ const (
5151
// transaction to confirm on-chain.
5252
SendStateWaitTxConf
5353

54-
// SendStateStoreProofs is the state in which we will write the sender
55-
// and receiver proofs to the proof archive.
56-
SendStateStoreProofs
54+
// SendStateStorePostAnchorTxConf is the state in which we will update
55+
// the send package in store to reflect the confirmation of the anchor
56+
// transaction. This includes:
57+
// * writing the sender and receiver proofs to the proof archive
58+
// * marking the transfer change outputs as spendable.
59+
SendStateStorePostAnchorTxConf
5760

5861
// SendStateTransferProofs is the state where we attempt to transfer
5962
// on-chain transaction proof(s) to the receiving party or parties.
@@ -85,8 +88,8 @@ func (s SendState) String() string {
8588
case SendStateWaitTxConf:
8689
return "SendStateWaitTxConf"
8790

88-
case SendStateStoreProofs:
89-
return "SendStateStoreProofs"
91+
case SendStateStorePostAnchorTxConf:
92+
return "SendStateStorePostAnchorTxConf"
9093

9194
case SendStateTransferProofs:
9295
return "SendStateTransferProofs"

0 commit comments

Comments
 (0)