mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-01 16:41:39 +01:00
multi: move Input interface and related code
This commit is a step to split the lnwallet package. It puts the Input interface and implementations in a separate package along with all their dependencies from lnwallet.
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/keychain"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
@@ -94,8 +95,8 @@ var (
|
||||
{
|
||||
amt: btcutil.Amount(1e7),
|
||||
outpoint: breachOutPoints[0],
|
||||
witnessType: lnwallet.CommitmentNoDelay,
|
||||
signDesc: lnwallet.SignDescriptor{
|
||||
witnessType: input.CommitmentNoDelay,
|
||||
signDesc: input.SignDescriptor{
|
||||
SingleTweak: []byte{
|
||||
0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
|
||||
0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
|
||||
@@ -138,8 +139,8 @@ var (
|
||||
{
|
||||
amt: btcutil.Amount(2e9),
|
||||
outpoint: breachOutPoints[1],
|
||||
witnessType: lnwallet.CommitmentRevoke,
|
||||
signDesc: lnwallet.SignDescriptor{
|
||||
witnessType: input.CommitmentRevoke,
|
||||
signDesc: input.SignDescriptor{
|
||||
SingleTweak: []byte{
|
||||
0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
|
||||
0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
|
||||
@@ -182,8 +183,8 @@ var (
|
||||
{
|
||||
amt: btcutil.Amount(3e4),
|
||||
outpoint: breachOutPoints[2],
|
||||
witnessType: lnwallet.CommitmentDelayOutput,
|
||||
signDesc: lnwallet.SignDescriptor{
|
||||
witnessType: input.CommitmentDelayOutput,
|
||||
signDesc: input.SignDescriptor{
|
||||
SingleTweak: []byte{
|
||||
0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
|
||||
0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
|
||||
@@ -1009,7 +1010,7 @@ func TestBreachHandoffSuccess(t *testing.T) {
|
||||
ProcessACK: make(chan error, 1),
|
||||
BreachRetribution: &lnwallet.BreachRetribution{
|
||||
BreachTransaction: bobClose.CloseTx,
|
||||
LocalOutputSignDesc: &lnwallet.SignDescriptor{
|
||||
LocalOutputSignDesc: &input.SignDescriptor{
|
||||
Output: &wire.TxOut{
|
||||
PkScript: breachKeys[0],
|
||||
},
|
||||
@@ -1041,7 +1042,7 @@ func TestBreachHandoffSuccess(t *testing.T) {
|
||||
ProcessACK: make(chan error, 1),
|
||||
BreachRetribution: &lnwallet.BreachRetribution{
|
||||
BreachTransaction: bobClose.CloseTx,
|
||||
LocalOutputSignDesc: &lnwallet.SignDescriptor{
|
||||
LocalOutputSignDesc: &input.SignDescriptor{
|
||||
Output: &wire.TxOut{
|
||||
PkScript: breachKeys[0],
|
||||
},
|
||||
@@ -1090,7 +1091,7 @@ func TestBreachHandoffFail(t *testing.T) {
|
||||
ProcessACK: make(chan error, 1),
|
||||
BreachRetribution: &lnwallet.BreachRetribution{
|
||||
BreachTransaction: bobClose.CloseTx,
|
||||
LocalOutputSignDesc: &lnwallet.SignDescriptor{
|
||||
LocalOutputSignDesc: &input.SignDescriptor{
|
||||
Output: &wire.TxOut{
|
||||
PkScript: breachKeys[0],
|
||||
},
|
||||
@@ -1130,7 +1131,7 @@ func TestBreachHandoffFail(t *testing.T) {
|
||||
ProcessACK: make(chan error, 1),
|
||||
BreachRetribution: &lnwallet.BreachRetribution{
|
||||
BreachTransaction: bobClose.CloseTx,
|
||||
LocalOutputSignDesc: &lnwallet.SignDescriptor{
|
||||
LocalOutputSignDesc: &input.SignDescriptor{
|
||||
Output: &wire.TxOut{
|
||||
PkScript: breachKeys[0],
|
||||
},
|
||||
@@ -1444,7 +1445,7 @@ func createInitChannels(revocationWindow int) (*lnwallet.LightningChannel, *lnwa
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
bobCommitPoint := lnwallet.ComputeCommitmentPoint(bobFirstRevoke[:])
|
||||
bobCommitPoint := input.ComputeCommitmentPoint(bobFirstRevoke[:])
|
||||
|
||||
aliceRoot, err := chainhash.NewHash(aliceKeyPriv.Serialize())
|
||||
if err != nil {
|
||||
@@ -1455,7 +1456,7 @@ func createInitChannels(revocationWindow int) (*lnwallet.LightningChannel, *lnwa
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
aliceCommitPoint := lnwallet.ComputeCommitmentPoint(aliceFirstRevoke[:])
|
||||
aliceCommitPoint := input.ComputeCommitmentPoint(aliceFirstRevoke[:])
|
||||
|
||||
aliceCommitTx, bobCommitTx, err := lnwallet.CreateCommitmentTxns(channelBal,
|
||||
channelBal, &aliceCfg, &bobCfg, aliceCommitPoint, bobCommitPoint,
|
||||
|
||||
Reference in New Issue
Block a user