sweep: fix typos

This commit is contained in:
yyforyongyu
2025-07-08 23:38:35 +03:00
committed by Oliver Gugger
parent 83d33f4b30
commit 5a22549bee
2 changed files with 20 additions and 20 deletions

View File

@@ -111,8 +111,8 @@ const (
// error, which means they cannot be retried with increased budget. // error, which means they cannot be retried with increased budget.
TxFatal TxFatal
// sentinalEvent is used to check if an event is unknown. // sentinelEvent is used to check if an event is unknown.
sentinalEvent sentinelEvent
) )
// String returns a human-readable string for the event. // String returns a human-readable string for the event.
@@ -137,13 +137,13 @@ func (e BumpEvent) String() string {
// Unknown returns true if the event is unknown. // Unknown returns true if the event is unknown.
func (e BumpEvent) Unknown() bool { func (e BumpEvent) Unknown() bool {
return e >= sentinalEvent return e >= sentinelEvent
} }
// BumpRequest is used by the caller to give the Bumper the necessary info to // BumpRequest is used by the caller to give the Bumper the necessary info to
// create and manage potential fee bumps for a set of inputs. // create and manage potential fee bumps for a set of inputs.
type BumpRequest struct { type BumpRequest struct {
// Budget givens the total amount that can be used as fees by these // Budget gives the total amount that can be used as fees by these
// inputs. // inputs.
Budget btcutil.Amount Budget btcutil.Amount
@@ -589,7 +589,7 @@ func (t *TxPublisher) createRBFCompliantTx(
// used up the budget, we will return an error // used up the budget, we will return an error
// indicating this tx cannot be made. The // indicating this tx cannot be made. The
// sweeper should handle this error and try to // sweeper should handle this error and try to
// cluster these inputs differetly. // cluster these inputs differently.
increased, err = f.Increment() increased, err = f.Increment()
if err != nil { if err != nil {
return nil, err return nil, err
@@ -1332,7 +1332,7 @@ func (t *TxPublisher) createAndPublishTx(
// the fee bumper retry it at next block. // the fee bumper retry it at next block.
// //
// NOTE: we may get this error if we've bypassed the mempool check, // NOTE: we may get this error if we've bypassed the mempool check,
// which means we are suing neutrino backend. // which means we are using neutrino backend.
if errors.Is(result.Err, chain.ErrInsufficientFee) || if errors.Is(result.Err, chain.ErrInsufficientFee) ||
errors.Is(result.Err, lnwallet.ErrMempoolFee) { errors.Is(result.Err, lnwallet.ErrMempoolFee) {

View File

@@ -73,7 +73,7 @@ func TestBumpResultValidate(t *testing.T) {
// Unknown event type will give an error. // Unknown event type will give an error.
b = BumpResult{ b = BumpResult{
Tx: &wire.MsgTx{}, Tx: &wire.MsgTx{},
Event: sentinalEvent, Event: sentinelEvent,
} }
require.ErrorIs(t, b.Validate(), ErrInvalidBumpResult) require.ErrorIs(t, b.Validate(), ErrInvalidBumpResult)
@@ -457,7 +457,7 @@ func TestCreateAndCheckTx(t *testing.T) {
// //
// NOTE: we are not testing the utility of creating valid txes here, so // NOTE: we are not testing the utility of creating valid txes here, so
// this is fine to be mocked. This behaves essentially as skipping the // this is fine to be mocked. This behaves essentially as skipping the
// Signer check and alaways assume the tx has a valid sig. // Signer check and always assume the tx has a valid sig.
script := &input.Script{} script := &input.Script{}
m.signer.On("ComputeInputScript", mock.Anything, m.signer.On("ComputeInputScript", mock.Anything,
mock.Anything).Return(script, nil) mock.Anything).Return(script, nil)
@@ -550,7 +550,7 @@ func TestCreateRBFCompliantTx(t *testing.T) {
// //
// NOTE: we are not testing the utility of creating valid txes here, so // NOTE: we are not testing the utility of creating valid txes here, so
// this is fine to be mocked. This behaves essentially as skipping the // this is fine to be mocked. This behaves essentially as skipping the
// Signer check and alaways assume the tx has a valid sig. // Signer check and always assume the tx has a valid sig.
script := &input.Script{} script := &input.Script{}
m.signer.On("ComputeInputScript", mock.Anything, m.signer.On("ComputeInputScript", mock.Anything,
mock.Anything).Return(script, nil) mock.Anything).Return(script, nil)
@@ -1120,9 +1120,9 @@ func TestBroadcastImmediate(t *testing.T) {
require.Empty(t, tp.subscriberChans.Len()) require.Empty(t, tp.subscriberChans.Len())
} }
// TestCreateAnPublishFail checks all the error cases are handled properly in // TestCreateAndPublishFail checks all the error cases are handled properly in
// the method createAndPublish. // the method createAndPublishTx.
func TestCreateAnPublishFail(t *testing.T) { func TestCreateAndPublishFail(t *testing.T) {
t.Parallel() t.Parallel()
// Create a publisher using the mocks. // Create a publisher using the mocks.
@@ -1152,7 +1152,7 @@ func TestCreateAnPublishFail(t *testing.T) {
// //
// NOTE: we are not testing the utility of creating valid txes here, so // NOTE: we are not testing the utility of creating valid txes here, so
// this is fine to be mocked. This behaves essentially as skipping the // this is fine to be mocked. This behaves essentially as skipping the
// Signer check and alaways assume the tx has a valid sig. // Signer check and always assume the tx has a valid sig.
script := &input.Script{} script := &input.Script{}
m.signer.On("ComputeInputScript", mock.Anything, m.signer.On("ComputeInputScript", mock.Anything,
mock.Anything).Return(script, nil) mock.Anything).Return(script, nil)
@@ -1190,9 +1190,9 @@ func TestCreateAnPublishFail(t *testing.T) {
require.True(t, resultOpt.IsNone()) require.True(t, resultOpt.IsNone())
} }
// TestCreateAnPublishSuccess checks the expected result is returned from the // TestCreateAndPublishSuccess checks the expected result is returned from the
// method createAndPublish. // method createAndPublishTx.
func TestCreateAnPublishSuccess(t *testing.T) { func TestCreateAndPublishSuccess(t *testing.T) {
t.Parallel() t.Parallel()
// Create a publisher using the mocks. // Create a publisher using the mocks.
@@ -1218,7 +1218,7 @@ func TestCreateAnPublishSuccess(t *testing.T) {
// //
// NOTE: we are not testing the utility of creating valid txes here, so // NOTE: we are not testing the utility of creating valid txes here, so
// this is fine to be mocked. This behaves essentially as skipping the // this is fine to be mocked. This behaves essentially as skipping the
// Signer check and alaways assume the tx has a valid sig. // Signer check and always assume the tx has a valid sig.
script := &input.Script{} script := &input.Script{}
m.signer.On("ComputeInputScript", mock.Anything, m.signer.On("ComputeInputScript", mock.Anything,
mock.Anything).Return(script, nil) mock.Anything).Return(script, nil)
@@ -1445,7 +1445,7 @@ func TestHandleFeeBumpTx(t *testing.T) {
// //
// NOTE: we are not testing the utility of creating valid txes here, so // NOTE: we are not testing the utility of creating valid txes here, so
// this is fine to be mocked. This behaves essentially as skipping the // this is fine to be mocked. This behaves essentially as skipping the
// Signer check and alaways assume the tx has a valid sig. // Signer check and always assume the tx has a valid sig.
script := &input.Script{} script := &input.Script{}
m.signer.On("ComputeInputScript", mock.Anything, m.signer.On("ComputeInputScript", mock.Anything,
mock.Anything).Return(script, nil) mock.Anything).Return(script, nil)
@@ -1830,7 +1830,7 @@ func TestHandleInitialBroadcastSuccess(t *testing.T) {
// //
// NOTE: we are not testing the utility of creating valid txes here, so // NOTE: we are not testing the utility of creating valid txes here, so
// this is fine to be mocked. This behaves essentially as skipping the // this is fine to be mocked. This behaves essentially as skipping the
// Signer check and alaways assume the tx has a valid sig. // Signer check and always assume the tx has a valid sig.
script := &input.Script{} script := &input.Script{}
m.signer.On("ComputeInputScript", mock.Anything, m.signer.On("ComputeInputScript", mock.Anything,
mock.Anything).Return(script, nil) mock.Anything).Return(script, nil)
@@ -1916,7 +1916,7 @@ func TestHandleInitialBroadcastFail(t *testing.T) {
// //
// NOTE: we are not testing the utility of creating valid txes here, so // NOTE: we are not testing the utility of creating valid txes here, so
// this is fine to be mocked. This behaves essentially as skipping the // this is fine to be mocked. This behaves essentially as skipping the
// Signer check and alaways assume the tx has a valid sig. // Signer check and always assume the tx has a valid sig.
script := &input.Script{} script := &input.Script{}
m.signer.On("ComputeInputScript", mock.Anything, m.signer.On("ComputeInputScript", mock.Anything,
mock.Anything).Return(script, nil) mock.Anything).Return(script, nil)