channeldb+htlcswitch: don't use fastsha256 in tests

The btcsuite/fastsha256 registers itself in the crypto package of
golang as a replacement for sha256. This causes problems in TLS1.3
connections that require the hash implementations to be serializable
and results in the "tls: internal error: failed to clone hash" error.
By removing all uses of the library we fix that error.
This commit is contained in:
Oliver Gugger
2020-05-20 11:07:38 +02:00
parent afc60353a1
commit a17ddc5dd1
5 changed files with 17 additions and 22 deletions

View File

@@ -2,6 +2,7 @@ package channeldb
import (
"crypto/rand"
"crypto/sha256"
"fmt"
"io"
"io/ioutil"
@@ -9,7 +10,6 @@ import (
"testing"
"time"
"github.com/btcsuite/fastsha256"
"github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/record"
@@ -46,7 +46,7 @@ func genInfo() (*PaymentCreationInfo, *HTLCAttemptInfo,
"generate preimage: %v", err)
}
rhash := fastsha256.Sum256(preimage[:])
rhash := sha256.Sum256(preimage[:])
return &PaymentCreationInfo{
PaymentHash: rhash,
Value: testRoute.ReceiverAmt(),