diff --git a/sweep/fee_bumper.go b/sweep/fee_bumper.go index 1602165ea..18d848b21 100644 --- a/sweep/fee_bumper.go +++ b/sweep/fee_bumper.go @@ -111,8 +111,8 @@ const ( // error, which means they cannot be retried with increased budget. TxFatal - // sentinalEvent is used to check if an event is unknown. - sentinalEvent + // sentinelEvent is used to check if an event is unknown. + sentinelEvent ) // 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. 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 // create and manage potential fee bumps for a set of inputs. 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. Budget btcutil.Amount @@ -589,7 +589,7 @@ func (t *TxPublisher) createRBFCompliantTx( // used up the budget, we will return an error // indicating this tx cannot be made. The // sweeper should handle this error and try to - // cluster these inputs differetly. + // cluster these inputs differently. increased, err = f.Increment() if err != nil { return nil, err @@ -1332,7 +1332,7 @@ func (t *TxPublisher) createAndPublishTx( // the fee bumper retry it at next block. // // 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) || errors.Is(result.Err, lnwallet.ErrMempoolFee) { diff --git a/sweep/fee_bumper_test.go b/sweep/fee_bumper_test.go index aa5561b5a..fb939e732 100644 --- a/sweep/fee_bumper_test.go +++ b/sweep/fee_bumper_test.go @@ -73,7 +73,7 @@ func TestBumpResultValidate(t *testing.T) { // Unknown event type will give an error. b = BumpResult{ Tx: &wire.MsgTx{}, - Event: sentinalEvent, + Event: sentinelEvent, } 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 // 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{} m.signer.On("ComputeInputScript", mock.Anything, 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 // 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{} m.signer.On("ComputeInputScript", mock.Anything, mock.Anything).Return(script, nil) @@ -1120,9 +1120,9 @@ func TestBroadcastImmediate(t *testing.T) { require.Empty(t, tp.subscriberChans.Len()) } -// TestCreateAnPublishFail checks all the error cases are handled properly in -// the method createAndPublish. -func TestCreateAnPublishFail(t *testing.T) { +// TestCreateAndPublishFail checks all the error cases are handled properly in +// the method createAndPublishTx. +func TestCreateAndPublishFail(t *testing.T) { t.Parallel() // 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 // 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{} m.signer.On("ComputeInputScript", mock.Anything, mock.Anything).Return(script, nil) @@ -1190,9 +1190,9 @@ func TestCreateAnPublishFail(t *testing.T) { require.True(t, resultOpt.IsNone()) } -// TestCreateAnPublishSuccess checks the expected result is returned from the -// method createAndPublish. -func TestCreateAnPublishSuccess(t *testing.T) { +// TestCreateAndPublishSuccess checks the expected result is returned from the +// method createAndPublishTx. +func TestCreateAndPublishSuccess(t *testing.T) { t.Parallel() // 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 // 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{} m.signer.On("ComputeInputScript", mock.Anything, 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 // 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{} m.signer.On("ComputeInputScript", mock.Anything, 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 // 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{} m.signer.On("ComputeInputScript", mock.Anything, 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 // 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{} m.signer.On("ComputeInputScript", mock.Anything, mock.Anything).Return(script, nil)