multi: fix linter warnings

This commit is contained in:
Olaoluwa Osuntokun committed 2023-08-22 16:32:00 -07:00
1 parent da1282c17e
commit aaba144804
11 files changed
+122 -106

No files matched your search

+1 -3
View File
@@ -688,8 +688,6 @@ func (c *ChanCloser) ProcessCloseMsg(msg lnwire.Message) ([]lnwire.Message,
"new co op close offer: %w", err)
}
break
// Otherwise, if we are the initiator, and we just sent a
// signature for a taproot channel, then we'll ensure that the
// fee rate matches up exactly.
@@ -755,7 +753,7 @@ func (c *ChanCloser) ProcessCloseMsg(msg lnwire.Message) ([]lnwire.Message,
matchingSig := c.priorFeeOffers[remoteProposedFee]
if c.cfg.Channel.ChanType().IsTaproot() {
muSession := c.cfg.MusigSession
localSig, remoteSig, closeOpts, err = muSession.CombineClosingOpts( //nolint:ll
localSig, remoteSig, closeOpts, err = muSession.CombineClosingOpts( //nolint:lll
*matchingSig.PartialSig,
*closeSignedMsg.PartialSig,
)
+7 -4
View File
@@ -211,7 +211,9 @@ func (m *mockChannel) FundingTxOut() *wire.TxOut {
return nil
}
func (m *mockChannel) MultiSigKeys() (keychain.KeyDescriptor, keychain.KeyDescriptor) {
func (m *mockChannel) MultiSigKeys() (
keychain.KeyDescriptor, keychain.KeyDescriptor) {
return m.localKey, m.remoteKey
}
@@ -250,7 +252,9 @@ func newMockMusigSession() *mockMusigSession {
return &mockMusigSession{}
}
func (m *mockMusigSession) ProposalClosingOpts() ([]lnwallet.ChanCloseOpt, error) {
func (m *mockMusigSession) ProposalClosingOpts() ([]lnwallet.ChanCloseOpt,
error) {
return nil, nil
}
@@ -267,7 +271,6 @@ func (m *mockMusigSession) ClosingNonce() (*musig2.Nonces, error) {
}
func (m *mockMusigSession) InitRemoteNonce(nonce *musig2.Nonces) {
return
}
type mockCoopFeeEstimator struct {
@@ -565,7 +568,7 @@ func TestTaprootFastClose(t *testing.T) {
ogOffer := bobOffer.FeeSatoshis
bobOffer.FeeSatoshis /= 2
aliceMsgs, _, err = aliceCloser.ProcessCloseMsg(bobOffer)
_, _, err = aliceCloser.ProcessCloseMsg(bobOffer)
require.Error(t, err)
require.Contains(t, err.Error(), "was not accepted")
+6 -5
View File
@@ -27,7 +27,7 @@ type CoopFeeEstimator interface {
// Channel abstracts away from the core channel state machine by exposing an
// interface that requires only the methods we need to carry out the channel
// closing process.
type Channel interface {
type Channel interface { //nolint:interfacebloat
// ChannelPoint returns the channel point of the target channel.
ChannelPoint() *wire.OutPoint
@@ -70,10 +70,11 @@ type Channel interface {
// CreateCloseProposal creates a new co-op close proposal in the form
// of a valid signature, the chainhash of the final txid, and our final
// balance in the created state.
CreateCloseProposal(proposedFee btcutil.Amount, localDeliveryScript []byte,
remoteDeliveryScript []byte,
closeOpt ...lnwallet.ChanCloseOpt) (input.Signature, *chainhash.Hash,
btcutil.Amount, error)
CreateCloseProposal(proposedFee btcutil.Amount,
localDeliveryScript []byte, remoteDeliveryScript []byte,
closeOpt ...lnwallet.ChanCloseOpt,
) (
input.Signature, *chainhash.Hash, btcutil.Amount, error)
// CompleteCooperativeClose persistently "completes" the cooperative
// close by producing a fully signed co-op close transaction.