mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-20 04:21:37 +02:00
multi: fix linter issues
Fix some issues found by the new nonamedreturn rule and rename some nolint comment to the new rule name.
This commit is contained in:
@@ -531,7 +531,7 @@ func (ns *NurseryStore) GraduateKinder(height uint32, kid *kidOutput) error {
|
||||
// FetchClass returns a list of the kindergarten and crib outputs whose timeouts
|
||||
// are expiring
|
||||
func (ns *NurseryStore) FetchClass(
|
||||
height uint32) ([]kidOutput, []babyOutput, error) { // nolint:golint
|
||||
height uint32) ([]kidOutput, []babyOutput, error) { // nolint:revive
|
||||
|
||||
// Construct list of all crib and kindergarten outputs that need to be
|
||||
// processed at the provided block height.
|
||||
@@ -592,7 +592,7 @@ func (ns *NurseryStore) FetchClass(
|
||||
|
||||
// FetchPreschools returns a list of all outputs currently stored in the
|
||||
// preschool bucket.
|
||||
func (ns *NurseryStore) FetchPreschools() ([]kidOutput, error) { // nolint:golint
|
||||
func (ns *NurseryStore) FetchPreschools() ([]kidOutput, error) { // nolint:revive
|
||||
var kids []kidOutput
|
||||
if err := kvdb.View(ns.db, func(tx kvdb.RTx) error {
|
||||
// Retrieve the existing chain bucket for this nursery store.
|
||||
|
@@ -147,28 +147,27 @@ func MarshalUtxos(utxos []*lnwallet.Utxo, activeNetParams *chaincfg.Params) (
|
||||
|
||||
// MarshallOutputType translates a txscript.ScriptClass into a
|
||||
// lnrpc.OutputScriptType.
|
||||
func MarshallOutputType(o txscript.ScriptClass) (ret OutputScriptType) {
|
||||
func MarshallOutputType(o txscript.ScriptClass) OutputScriptType {
|
||||
// Translate txscript ScriptClass type to the proper gRPC proto
|
||||
// output script type.
|
||||
switch o {
|
||||
case txscript.PubKeyHashTy:
|
||||
ret = OutputScriptType_SCRIPT_TYPE_PUBKEY_HASH
|
||||
case txscript.ScriptHashTy:
|
||||
ret = OutputScriptType_SCRIPT_TYPE_SCRIPT_HASH
|
||||
return OutputScriptType_SCRIPT_TYPE_SCRIPT_HASH
|
||||
case txscript.WitnessV0PubKeyHashTy:
|
||||
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH
|
||||
return OutputScriptType_SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH
|
||||
case txscript.WitnessV0ScriptHashTy:
|
||||
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH
|
||||
return OutputScriptType_SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH
|
||||
case txscript.PubKeyTy:
|
||||
ret = OutputScriptType_SCRIPT_TYPE_PUBKEY
|
||||
return OutputScriptType_SCRIPT_TYPE_PUBKEY
|
||||
case txscript.MultiSigTy:
|
||||
ret = OutputScriptType_SCRIPT_TYPE_MULTISIG
|
||||
return OutputScriptType_SCRIPT_TYPE_MULTISIG
|
||||
case txscript.NullDataTy:
|
||||
ret = OutputScriptType_SCRIPT_TYPE_NULLDATA
|
||||
return OutputScriptType_SCRIPT_TYPE_NULLDATA
|
||||
case txscript.NonStandardTy:
|
||||
ret = OutputScriptType_SCRIPT_TYPE_NON_STANDARD
|
||||
return OutputScriptType_SCRIPT_TYPE_NON_STANDARD
|
||||
case txscript.WitnessUnknownTy:
|
||||
ret = OutputScriptType_SCRIPT_TYPE_WITNESS_UNKNOWN
|
||||
return OutputScriptType_SCRIPT_TYPE_WITNESS_UNKNOWN
|
||||
default:
|
||||
return OutputScriptType_SCRIPT_TYPE_PUBKEY_HASH
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@@ -60,8 +60,8 @@ type testContext struct {
|
||||
|
||||
// newTestContext populates a new testContext struct with the constant
|
||||
// parameters defined in the BOLT 03 spec.
|
||||
func newTestContext(t *testing.T) (tc *testContext) {
|
||||
tc = new(testContext)
|
||||
func newTestContext(t *testing.T) *testContext {
|
||||
tc := new(testContext)
|
||||
|
||||
priv := func(v string) *btcec.PrivateKey {
|
||||
k, err := privkeyFromHex(v)
|
||||
|
Reference in New Issue
Block a user