test: update createTestPeer to adhere to new channeldb API's
This commit is contained in:
parent
e337a329cd
commit
a39825db3f
@ -136,24 +136,54 @@ func createTestPeer(notifier chainntnfs.ChainNotifier,
|
|||||||
|
|
||||||
estimator := &lnwallet.StaticFeeEstimator{FeeRate: 50}
|
estimator := &lnwallet.StaticFeeEstimator{FeeRate: 50}
|
||||||
feePerKw := btcutil.Amount(estimator.EstimateFeePerWeight(1) * 1000)
|
feePerKw := btcutil.Amount(estimator.EstimateFeePerWeight(1) * 1000)
|
||||||
|
// TODO(roasbeef): need to factor in commit fee?
|
||||||
|
aliceCommit := channeldb.ChannelCommitment{
|
||||||
|
CommitHeight: 0,
|
||||||
|
LocalBalance: lnwire.NewMSatFromSatoshis(channelBal),
|
||||||
|
RemoteBalance: lnwire.NewMSatFromSatoshis(channelBal),
|
||||||
|
FeePerKw: feePerKw,
|
||||||
|
CommitTx: aliceCommitTx,
|
||||||
|
CommitSig: bytes.Repeat([]byte{1}, 71),
|
||||||
|
}
|
||||||
|
bobCommit := channeldb.ChannelCommitment{
|
||||||
|
CommitHeight: 0,
|
||||||
|
LocalBalance: lnwire.NewMSatFromSatoshis(channelBal),
|
||||||
|
RemoteBalance: lnwire.NewMSatFromSatoshis(channelBal),
|
||||||
|
FeePerKw: feePerKw,
|
||||||
|
CommitTx: bobCommitTx,
|
||||||
|
CommitSig: bytes.Repeat([]byte{1}, 71),
|
||||||
|
}
|
||||||
|
|
||||||
aliceChannelState := &channeldb.OpenChannel{
|
aliceChannelState := &channeldb.OpenChannel{
|
||||||
LocalChanCfg: aliceCfg,
|
LocalChanCfg: aliceCfg,
|
||||||
RemoteChanCfg: bobCfg,
|
RemoteChanCfg: bobCfg,
|
||||||
IdentityPub: aliceKeyPub,
|
IdentityPub: aliceKeyPub,
|
||||||
FundingOutpoint: *prevOut,
|
FundingOutpoint: *prevOut,
|
||||||
ChanType: channeldb.SingleFunder,
|
ChanType: channeldb.SingleFunder,
|
||||||
FeePerKw: feePerKw,
|
|
||||||
IsInitiator: true,
|
IsInitiator: true,
|
||||||
Capacity: channelCapacity,
|
Capacity: channelCapacity,
|
||||||
LocalBalance: lnwire.NewMSatFromSatoshis(channelBal),
|
|
||||||
RemoteBalance: lnwire.NewMSatFromSatoshis(channelBal),
|
|
||||||
CommitTx: *aliceCommitTx,
|
|
||||||
CommitSig: bytes.Repeat([]byte{1}, 71),
|
|
||||||
RemoteCurrentRevocation: bobCommitPoint,
|
RemoteCurrentRevocation: bobCommitPoint,
|
||||||
RevocationProducer: alicePreimageProducer,
|
RevocationProducer: alicePreimageProducer,
|
||||||
RevocationStore: shachain.NewRevocationStore(),
|
RevocationStore: shachain.NewRevocationStore(),
|
||||||
|
LocalCommitment: aliceCommit,
|
||||||
|
RemoteCommitment: aliceCommit,
|
||||||
Db: dbAlice,
|
Db: dbAlice,
|
||||||
}
|
}
|
||||||
|
bobChannelState := &channeldb.OpenChannel{
|
||||||
|
LocalChanCfg: bobCfg,
|
||||||
|
RemoteChanCfg: aliceCfg,
|
||||||
|
IdentityPub: bobKeyPub,
|
||||||
|
FundingOutpoint: *prevOut,
|
||||||
|
ChanType: channeldb.SingleFunder,
|
||||||
|
IsInitiator: false,
|
||||||
|
Capacity: channelCapacity,
|
||||||
|
RemoteCurrentRevocation: aliceCommitPoint,
|
||||||
|
RevocationProducer: bobPreimageProducer,
|
||||||
|
RevocationStore: shachain.NewRevocationStore(),
|
||||||
|
LocalCommitment: bobCommit,
|
||||||
|
RemoteCommitment: bobCommit,
|
||||||
|
Db: dbBob,
|
||||||
|
}
|
||||||
|
|
||||||
addr := &net.TCPAddr{
|
addr := &net.TCPAddr{
|
||||||
IP: net.ParseIP("127.0.0.1"),
|
IP: net.ParseIP("127.0.0.1"),
|
||||||
@ -164,25 +194,6 @@ func createTestPeer(notifier chainntnfs.ChainNotifier,
|
|||||||
return nil, nil, nil, nil, err
|
return nil, nil, nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
bobChannelState := &channeldb.OpenChannel{
|
|
||||||
LocalChanCfg: bobCfg,
|
|
||||||
RemoteChanCfg: aliceCfg,
|
|
||||||
IdentityPub: bobKeyPub,
|
|
||||||
FeePerKw: feePerKw,
|
|
||||||
FundingOutpoint: *prevOut,
|
|
||||||
ChanType: channeldb.SingleFunder,
|
|
||||||
IsInitiator: false,
|
|
||||||
Capacity: channelCapacity,
|
|
||||||
LocalBalance: lnwire.NewMSatFromSatoshis(channelBal),
|
|
||||||
RemoteBalance: lnwire.NewMSatFromSatoshis(channelBal),
|
|
||||||
CommitTx: *bobCommitTx,
|
|
||||||
CommitSig: bytes.Repeat([]byte{1}, 71),
|
|
||||||
RemoteCurrentRevocation: aliceCommitPoint,
|
|
||||||
RevocationProducer: bobPreimageProducer,
|
|
||||||
RevocationStore: shachain.NewRevocationStore(),
|
|
||||||
Db: dbBob,
|
|
||||||
}
|
|
||||||
|
|
||||||
addr = &net.TCPAddr{
|
addr = &net.TCPAddr{
|
||||||
IP: net.ParseIP("127.0.0.1"),
|
IP: net.ParseIP("127.0.0.1"),
|
||||||
Port: 18556,
|
Port: 18556,
|
||||||
|
Loading…
Reference in New Issue
Block a user