mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-05 20:32:39 +02:00
multi: fix formatting
This commit is contained in:
@@ -14,8 +14,8 @@ type Signer interface {
|
|||||||
// according to the data within the passed SignDescriptor.
|
// according to the data within the passed SignDescriptor.
|
||||||
//
|
//
|
||||||
// NOTE: The resulting signature should be void of a sighash byte.
|
// NOTE: The resulting signature should be void of a sighash byte.
|
||||||
SignOutputRaw(tx *wire.MsgTx,
|
SignOutputRaw(tx *wire.MsgTx, signDesc *SignDescriptor) (Signature,
|
||||||
signDesc *SignDescriptor) (Signature, error)
|
error)
|
||||||
|
|
||||||
// ComputeInputScript generates a complete InputIndex for the passed
|
// ComputeInputScript generates a complete InputIndex for the passed
|
||||||
// transaction with the signature as defined within the passed
|
// transaction with the signature as defined within the passed
|
||||||
@@ -26,7 +26,8 @@ type Signer interface {
|
|||||||
// NOTE: This method will ignore any tweak parameters set within the
|
// NOTE: This method will ignore any tweak parameters set within the
|
||||||
// passed SignDescriptor as it assumes a set of typical script
|
// passed SignDescriptor as it assumes a set of typical script
|
||||||
// templates (p2wkh, np2wkh, etc).
|
// templates (p2wkh, np2wkh, etc).
|
||||||
ComputeInputScript(tx *wire.MsgTx, signDesc *SignDescriptor) (*Script, error)
|
ComputeInputScript(tx *wire.MsgTx, signDesc *SignDescriptor) (*Script,
|
||||||
|
error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Script represents any script inputs required to redeem a previous
|
// Script represents any script inputs required to redeem a previous
|
||||||
|
@@ -238,7 +238,8 @@ func (r *ServerShell) CreateSubServer(configRegistry lnrpc.SubServerConfigDispat
|
|||||||
// provides an invalid transaction, then we'll return with an error.
|
// provides an invalid transaction, then we'll return with an error.
|
||||||
//
|
//
|
||||||
// NOTE: The resulting signature should be void of a sighash byte.
|
// NOTE: The resulting signature should be void of a sighash byte.
|
||||||
func (s *Server) SignOutputRaw(ctx context.Context, in *SignReq) (*SignResp, error) {
|
func (s *Server) SignOutputRaw(ctx context.Context, in *SignReq) (*SignResp,
|
||||||
|
error) {
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
// If the client doesn't specify a transaction, then there's nothing to
|
// If the client doesn't specify a transaction, then there's nothing to
|
||||||
|
@@ -54,14 +54,15 @@ func (w *WalletController) FetchInputInfo(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ConfirmedBalance currently returns dummy values.
|
// ConfirmedBalance currently returns dummy values.
|
||||||
func (w *WalletController) ConfirmedBalance(confs int32,
|
func (w *WalletController) ConfirmedBalance(int32, string) (btcutil.Amount,
|
||||||
_ string) (btcutil.Amount, error) {
|
error) {
|
||||||
|
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewAddress is called to get new addresses for delivery, change etc.
|
// NewAddress is called to get new addresses for delivery, change etc.
|
||||||
func (w *WalletController) NewAddress(addrType lnwallet.AddressType,
|
func (w *WalletController) NewAddress(lnwallet.AddressType, bool,
|
||||||
change bool, _ string) (btcutil.Address, error) {
|
string) (btcutil.Address, error) {
|
||||||
|
|
||||||
addr, _ := btcutil.NewAddressPubKey(
|
addr, _ := btcutil.NewAddressPubKey(
|
||||||
w.RootKey.PubKey().SerializeCompressed(), &chaincfg.MainNetParams,
|
w.RootKey.PubKey().SerializeCompressed(), &chaincfg.MainNetParams,
|
||||||
@@ -70,19 +71,21 @@ func (w *WalletController) NewAddress(addrType lnwallet.AddressType,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// LastUnusedAddress currently returns dummy values.
|
// LastUnusedAddress currently returns dummy values.
|
||||||
func (w *WalletController) LastUnusedAddress(addrType lnwallet.AddressType,
|
func (w *WalletController) LastUnusedAddress(lnwallet.AddressType,
|
||||||
_ string) (btcutil.Address, error) {
|
string) (btcutil.Address, error) {
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsOurAddress currently returns a dummy value.
|
// IsOurAddress currently returns a dummy value.
|
||||||
func (w *WalletController) IsOurAddress(a btcutil.Address) bool {
|
func (w *WalletController) IsOurAddress(btcutil.Address) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListAccounts currently returns a dummy value.
|
// ListAccounts currently returns a dummy value.
|
||||||
func (w *WalletController) ListAccounts(_ string,
|
func (w *WalletController) ListAccounts(string,
|
||||||
_ *waddrmgr.KeyScope) ([]*waddrmgr.AccountProperties, error) {
|
*waddrmgr.KeyScope) ([]*waddrmgr.AccountProperties, error) {
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,33 +93,35 @@ func (w *WalletController) ListAccounts(_ string,
|
|||||||
func (w *WalletController) ImportAccount(string, *hdkeychain.ExtendedKey,
|
func (w *WalletController) ImportAccount(string, *hdkeychain.ExtendedKey,
|
||||||
uint32, *waddrmgr.AddressType, bool) (*waddrmgr.AccountProperties,
|
uint32, *waddrmgr.AddressType, bool) (*waddrmgr.AccountProperties,
|
||||||
[]btcutil.Address, []btcutil.Address, error) {
|
[]btcutil.Address, []btcutil.Address, error) {
|
||||||
|
|
||||||
return nil, nil, nil, nil
|
return nil, nil, nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImportPublicKey currently returns a dummy value.
|
// ImportPublicKey currently returns a dummy value.
|
||||||
func (w *WalletController) ImportPublicKey(*btcec.PublicKey,
|
func (w *WalletController) ImportPublicKey(*btcec.PublicKey,
|
||||||
waddrmgr.AddressType) error {
|
waddrmgr.AddressType) error {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendOutputs currently returns dummy values.
|
// SendOutputs currently returns dummy values.
|
||||||
func (w *WalletController) SendOutputs(outputs []*wire.TxOut,
|
func (w *WalletController) SendOutputs([]*wire.TxOut,
|
||||||
_ chainfee.SatPerKWeight, _ int32, _ string) (*wire.MsgTx, error) {
|
chainfee.SatPerKWeight, int32, string) (*wire.MsgTx, error) {
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateSimpleTx currently returns dummy values.
|
// CreateSimpleTx currently returns dummy values.
|
||||||
func (w *WalletController) CreateSimpleTx(outputs []*wire.TxOut,
|
func (w *WalletController) CreateSimpleTx([]*wire.TxOut,
|
||||||
_ chainfee.SatPerKWeight, _ int32, _ bool) (*txauthor.AuthoredTx, error) {
|
chainfee.SatPerKWeight, int32, bool) (*txauthor.AuthoredTx, error) {
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListUnspentWitness is called by the wallet when doing coin selection. We just
|
// ListUnspentWitness is called by the wallet when doing coin selection. We just
|
||||||
// need one unspent for the funding transaction.
|
// need one unspent for the funding transaction.
|
||||||
func (w *WalletController) ListUnspentWitness(minConfs,
|
func (w *WalletController) ListUnspentWitness(int32, int32,
|
||||||
maxConfs int32, _ string) ([]*lnwallet.Utxo, error) {
|
string) ([]*lnwallet.Utxo, error) {
|
||||||
|
|
||||||
// If the mock already has a list of utxos, return it.
|
// If the mock already has a list of utxos, return it.
|
||||||
if w.Utxos != nil {
|
if w.Utxos != nil {
|
||||||
@@ -140,8 +145,8 @@ func (w *WalletController) ListUnspentWitness(minConfs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ListTransactionDetails currently returns dummy values.
|
// ListTransactionDetails currently returns dummy values.
|
||||||
func (w *WalletController) ListTransactionDetails(_,
|
func (w *WalletController) ListTransactionDetails(int32, int32,
|
||||||
_ int32, _ string) ([]*lnwallet.TransactionDetail, error) {
|
string) ([]*lnwallet.TransactionDetail, error) {
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -169,8 +174,8 @@ func (w *WalletController) ListLeasedOutputs() ([]*wtxmgr.LockedOutput, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FundPsbt currently does nothing.
|
// FundPsbt currently does nothing.
|
||||||
func (w *WalletController) FundPsbt(_ *psbt.Packet, _ int32,
|
func (w *WalletController) FundPsbt(*psbt.Packet, int32, chainfee.SatPerKWeight,
|
||||||
_ chainfee.SatPerKWeight, _ string) (int32, error) {
|
string) (int32, error) {
|
||||||
|
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
@@ -187,8 +192,8 @@ func (w *WalletController) PublishTransaction(tx *wire.MsgTx, _ string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// LabelTransaction currently does nothing.
|
// LabelTransaction currently does nothing.
|
||||||
func (w *WalletController) LabelTransaction(_ chainhash.Hash, _ string,
|
func (w *WalletController) LabelTransaction(chainhash.Hash, string,
|
||||||
_ bool) error {
|
bool) error {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@@ -66,7 +66,9 @@ func deriveFromKeyLoc(scopedMgr *waddrmgr.ScopedKeyManager,
|
|||||||
|
|
||||||
// deriveKeyByLocator attempts to derive a key stored in the wallet given a
|
// deriveKeyByLocator attempts to derive a key stored in the wallet given a
|
||||||
// valid key locator.
|
// valid key locator.
|
||||||
func (b *BtcWallet) deriveKeyByLocator(keyLoc keychain.KeyLocator) (*btcec.PrivateKey, error) {
|
func (b *BtcWallet) deriveKeyByLocator(
|
||||||
|
keyLoc keychain.KeyLocator) (*btcec.PrivateKey, error) {
|
||||||
|
|
||||||
// We'll assume the special lightning key scope in this case.
|
// We'll assume the special lightning key scope in this case.
|
||||||
scopedMgr, err := b.wallet.Manager.FetchScopedKeyManager(
|
scopedMgr, err := b.wallet.Manager.FetchScopedKeyManager(
|
||||||
b.chainKeyScope,
|
b.chainKeyScope,
|
||||||
|
@@ -168,7 +168,8 @@ type WalletController interface {
|
|||||||
// NOTE: Only witness outputs should be included in the computation of
|
// NOTE: Only witness outputs should be included in the computation of
|
||||||
// the total spendable balance of the wallet. We require this as only
|
// the total spendable balance of the wallet. We require this as only
|
||||||
// witness inputs can be used for funding channels.
|
// witness inputs can be used for funding channels.
|
||||||
ConfirmedBalance(confs int32, accountFilter string) (btcutil.Amount, error)
|
ConfirmedBalance(confs int32, accountFilter string) (btcutil.Amount,
|
||||||
|
error)
|
||||||
|
|
||||||
// NewAddress returns the next external or internal address for the
|
// NewAddress returns the next external or internal address for the
|
||||||
// wallet dictated by the value of the `change` parameter. If change is
|
// wallet dictated by the value of the `change` parameter. If change is
|
||||||
@@ -197,7 +198,8 @@ type WalletController interface {
|
|||||||
// ListAccounts retrieves all accounts belonging to the wallet by
|
// ListAccounts retrieves all accounts belonging to the wallet by
|
||||||
// default. A name and key scope filter can be provided to filter
|
// default. A name and key scope filter can be provided to filter
|
||||||
// through all of the wallet accounts and return only those matching.
|
// through all of the wallet accounts and return only those matching.
|
||||||
ListAccounts(string, *waddrmgr.KeyScope) ([]*waddrmgr.AccountProperties, error)
|
ListAccounts(string, *waddrmgr.KeyScope) ([]*waddrmgr.AccountProperties,
|
||||||
|
error)
|
||||||
|
|
||||||
// ImportAccount imports an account backed by an account extended public
|
// ImportAccount imports an account backed by an account extended public
|
||||||
// key. The master key fingerprint denotes the fingerprint of the root
|
// key. The master key fingerprint denotes the fingerprint of the root
|
||||||
@@ -228,7 +230,8 @@ type WalletController interface {
|
|||||||
// in the case of legacy versions (xpub, tpub), an address type must be
|
// in the case of legacy versions (xpub, tpub), an address type must be
|
||||||
// specified as we intend to not support importing BIP-44 keys into the
|
// specified as we intend to not support importing BIP-44 keys into the
|
||||||
// wallet using the legacy pay-to-pubkey-hash (P2PKH) scheme.
|
// wallet using the legacy pay-to-pubkey-hash (P2PKH) scheme.
|
||||||
ImportPublicKey(pubKey *btcec.PublicKey, addrType waddrmgr.AddressType) error
|
ImportPublicKey(pubKey *btcec.PublicKey,
|
||||||
|
addrType waddrmgr.AddressType) error
|
||||||
|
|
||||||
// SendOutputs funds, signs, and broadcasts a Bitcoin transaction paying
|
// SendOutputs funds, signs, and broadcasts a Bitcoin transaction paying
|
||||||
// out to the specified outputs. In the case the wallet has insufficient
|
// out to the specified outputs. In the case the wallet has insufficient
|
||||||
@@ -237,8 +240,8 @@ type WalletController interface {
|
|||||||
// be used when crafting the transaction.
|
// be used when crafting the transaction.
|
||||||
//
|
//
|
||||||
// NOTE: This method requires the global coin selection lock to be held.
|
// NOTE: This method requires the global coin selection lock to be held.
|
||||||
SendOutputs(outputs []*wire.TxOut,
|
SendOutputs(outputs []*wire.TxOut, feeRate chainfee.SatPerKWeight,
|
||||||
feeRate chainfee.SatPerKWeight, minConfs int32, label string) (*wire.MsgTx, error)
|
minConfs int32, label string) (*wire.MsgTx, error)
|
||||||
|
|
||||||
// CreateSimpleTx creates a Bitcoin transaction paying to the specified
|
// CreateSimpleTx creates a Bitcoin transaction paying to the specified
|
||||||
// outputs. The transaction is not broadcasted to the network. In the
|
// outputs. The transaction is not broadcasted to the network. In the
|
||||||
|
Reference in New Issue
Block a user