mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-18 13:07:58 +02:00
paymentsdb: fix test case before testing sql backend
We are now not supporting the LegacyPayload for the onion packet anymore. All payments and their onion payload need to be tlv encoded. The sql backend assumes tlv so we have to always set the in memory presentation of a hop where the legacy parameter is still available but deprecated to false, otherwise the hops will not be equal and unit tests for the sql backend will fail when switched on in the next commits.
This commit is contained in:
parent
de50f471e8
commit
2eadbfb54d
2 changed files with 8 additions and 2 deletions
|
|
@ -59,7 +59,10 @@ var (
|
|||
ChannelID: 12345,
|
||||
OutgoingTimeLock: 111,
|
||||
AmtToForward: 555,
|
||||
LegacyPayload: true,
|
||||
|
||||
// Only tlv payloads are now supported in LND therefore we set
|
||||
// LegacyPayload to false.
|
||||
LegacyPayload: false,
|
||||
}
|
||||
|
||||
testRoute = route.Route{
|
||||
|
|
@ -2203,7 +2206,7 @@ func TestMultiShard(t *testing.T) {
|
|||
|
||||
// Finally assert we cannot register more attempts.
|
||||
_, err = paymentDB.RegisterAttempt(info.PaymentIdentifier, b)
|
||||
require.Equal(t, registerErr, err)
|
||||
require.ErrorIs(t, err, registerErr)
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
|
|
|||
|
|
@ -164,6 +164,9 @@ type Hop struct {
|
|||
// The only reason we are keeping this member is that it could be the
|
||||
// case that we have serialised hops persisted to disk where
|
||||
// LegacyPayload is true.
|
||||
//
|
||||
// TODO(ziggie): Remove this field once we phase out the kv backend
|
||||
// for payments.
|
||||
LegacyPayload bool
|
||||
|
||||
// Metadata is additional data that is sent along with the payment to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue