Skip to content

Commit 0647401

Browse files
committed
tapfreighter: rename state SendStateReceiverProofTransfer
Renamed the `ChainPorter` state `SendStateReceiverProofTransfer` to `SendStateTransferProofs` for better clarity. This change makes it clear that in that state the `ChainPorter` may transfer multiple proofs.
1 parent 6c88798 commit 0647401

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tapfreighter/chain_porter.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ func (p *ChainPorter) storeProofs(sendPkg *sendPackage) error {
443443
log.Debugf("Not updating proofs as there are no active " +
444444
"transfers")
445445

446-
sendPkg.SendState = SendStateReceiverProofTransfer
446+
sendPkg.SendState = SendStateTransferProofs
447447
return nil
448448
}
449449

@@ -532,7 +532,7 @@ func (p *ChainPorter) storeProofs(sendPkg *sendPackage) error {
532532
}
533533
}
534534

535-
sendPkg.SendState = SendStateReceiverProofTransfer
535+
sendPkg.SendState = SendStateTransferProofs
536536
return nil
537537
}
538538

@@ -1164,8 +1164,8 @@ func (p *ChainPorter) stateStep(currentPkg sendPackage) (*sendPackage, error) {
11641164

11651165
// At this point, the transfer transaction is confirmed on-chain, and
11661166
// we've stored the sender and receiver proofs in the proof archive.
1167-
// We'll now attempt to transfer the receiver proof to the receiver.
1168-
case SendStateReceiverProofTransfer:
1167+
// We'll now attempt to transfer one or more proofs to the receiver(s).
1168+
case SendStateTransferProofs:
11691169
// We'll set the package state to complete early here so the
11701170
// main loop breaks out. We'll continue to attempt proof
11711171
// deliver in the background.
@@ -1181,7 +1181,7 @@ func (p *ChainPorter) stateStep(currentPkg sendPackage) (*sendPackage, error) {
11811181
"proof: %v", err)
11821182

11831183
p.publishSubscriberEvent(newAssetSendErrorEvent(
1184-
err, SendStateReceiverProofTransfer,
1184+
err, SendStateTransferProofs,
11851185
currentPkg,
11861186
))
11871187
}

tapfreighter/parcel.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ const (
5555
// and receiver proofs to the proof archive.
5656
SendStateStoreProofs
5757

58-
// SendStateReceiverProofTransfer is the state in which we will commence
59-
// the receiver proof transfer process.
60-
SendStateReceiverProofTransfer
58+
// SendStateTransferProofs is the state where we attempt to transfer
59+
// on-chain transaction proof(s) to the receiving party or parties.
60+
SendStateTransferProofs
6161

6262
// SendStateComplete is the state which is reached once entire asset
6363
// transfer process is complete.
@@ -88,8 +88,8 @@ func (s SendState) String() string {
8888
case SendStateStoreProofs:
8989
return "SendStateStoreProofs"
9090

91-
case SendStateReceiverProofTransfer:
92-
return "SendStateReceiverProofTransfer"
91+
case SendStateTransferProofs:
92+
return "SendStateTransferProofs"
9393

9494
case SendStateComplete:
9595
return "SendStateComplete"

0 commit comments

Comments
 (0)