From 0d6e791042c7b6220e94349119035be6d11c6d85 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Fri, 29 Jul 2022 18:20:05 +0200 Subject: [PATCH] lntest+lnwallet: add ImportTaprootScript to wallet interface --- lntest/mock/walletcontroller.go | 7 +++++++ lnwallet/interface.go | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/lntest/mock/walletcontroller.go b/lntest/mock/walletcontroller.go index c935e7662..9e8d63240 100644 --- a/lntest/mock/walletcontroller.go +++ b/lntest/mock/walletcontroller.go @@ -132,6 +132,13 @@ func (w *WalletController) ImportPublicKey(*btcec.PublicKey, return nil } +// ImportTaprootScript currently returns a dummy value. +func (w *WalletController) ImportTaprootScript(waddrmgr.KeyScope, + *waddrmgr.Tapscript) (waddrmgr.ManagedAddress, error) { + + return nil, nil +} + // SendOutputs currently returns dummy values. func (w *WalletController) SendOutputs([]*wire.TxOut, chainfee.SatPerKWeight, int32, string) (*wire.MsgTx, error) { diff --git a/lnwallet/interface.go b/lnwallet/interface.go index bbaf5c430..21b01086c 100644 --- a/lnwallet/interface.go +++ b/lnwallet/interface.go @@ -316,6 +316,15 @@ type WalletController interface { ImportPublicKey(pubKey *btcec.PublicKey, addrType waddrmgr.AddressType) error + // ImportTaprootScript imports a user-provided taproot script into the + // wallet. The imported script will act as a pay-to-taproot address. + // + // NOTE: Taproot keys imported through this RPC currently _cannot_ be + // used for funding PSBTs. Only tracking the balance and UTXOs is + // currently supported. + ImportTaprootScript(scope waddrmgr.KeyScope, + tapscript *waddrmgr.Tapscript) (waddrmgr.ManagedAddress, error) + // SendOutputs funds, signs, and broadcasts a Bitcoin transaction paying // out to the specified outputs. In the case the wallet has insufficient // funds, or the outputs are non-standard, an error should be returned.