breacharbiter_test: modify test vectors to support new structs

This commit is contained in:
Conner Fromknecht 2017-08-21 16:58:21 -07:00
parent d88804178e
commit 9cc9977f95
No known key found for this signature in database
GPG Key ID: 39DE78FBE6ACB0EF

@ -173,24 +173,21 @@ var (
breachedOutputs = []breachedOutput{ breachedOutputs = []breachedOutput{
{ {
amt: btcutil.Amount(1e7), amt: btcutil.Amount(1e7),
outpoint: breachOutPoints[0], outpoint: breachOutPoints[0],
witnessType: lnwallet.CommitmentNoDelay, witnessType: lnwallet.CommitmentNoDelay,
twoStageClaim: true,
}, },
{ {
amt: btcutil.Amount(2e9), amt: btcutil.Amount(2e9),
outpoint: breachOutPoints[1], outpoint: breachOutPoints[1],
witnessType: lnwallet.CommitmentRevoke, witnessType: lnwallet.CommitmentRevoke,
twoStageClaim: false,
}, },
{ {
amt: btcutil.Amount(3e4), amt: btcutil.Amount(3e4),
outpoint: breachOutPoints[2], outpoint: breachOutPoints[2],
witnessType: lnwallet.CommitmentDelayOutput, witnessType: lnwallet.CommitmentDelayOutput,
twoStageClaim: false,
}, },
} }
@ -240,7 +237,7 @@ func init() {
// channel point. // channel point.
for i := range retributions { for i := range retributions {
retInfo := &retributions[i] retInfo := &retributions[i]
retInfo.remoteIdentity = *breachedOutputs[i].signDescriptor.PubKey retInfo.remoteIdentity = breachedOutputs[i].signDesc.PubKey
retributionMap[retInfo.chanPoint] = *retInfo retributionMap[retInfo.chanPoint] = *retInfo
} }
} }
@ -320,7 +317,7 @@ func initBreachedOutputs() error {
breachKeys[i]) breachKeys[i])
} }
sd.PubKey = pubkey sd.PubKey = pubkey
bo.signDescriptor = *sd bo.signDesc = sd
} }
return nil return nil
@ -395,7 +392,6 @@ func copyRetInfo(retInfo *retributionInfo) *retributionInfo {
selfOutput: retInfo.selfOutput, selfOutput: retInfo.selfOutput,
revokedOutput: retInfo.revokedOutput, revokedOutput: retInfo.revokedOutput,
htlcOutputs: make([]*breachedOutput, nHtlcs), htlcOutputs: make([]*breachedOutput, nHtlcs),
doneChan: retInfo.doneChan,
} }
for i, htlco := range retInfo.htlcOutputs { for i, htlco := range retInfo.htlcOutputs {
@ -776,8 +772,8 @@ restartCheck:
foundSet[ret.chanPoint] = struct{}{} foundSet[ret.chanPoint] = struct{}{}
} else { } else {
return fmt.Errorf("unkwown retribution "+ return fmt.Errorf("unkwown retribution retrieved "+
"retrieved from db: %v", ret) "from db: %v", ret)
} }
return nil return nil