itest: use random hash gen helper

This commit is contained in:
Elle Mouton
2025-07-14 08:38:43 +02:00
parent 5bb2277749
commit 223cec442b

View File

@@ -1,7 +1,6 @@
package itest package itest
import ( import (
"crypto/rand"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"os" "os"
@@ -1355,14 +1354,11 @@ func testGRPCNotFound(ht *lntest.HarnessTest) {
notFoundErr = codes.NotFound.String() notFoundErr = codes.NotFound.String()
unknownPub = "0286098b97bc843372b4426d4b276cea9aa2f48f0428d6" + unknownPub = "0286098b97bc843372b4426d4b276cea9aa2f48f0428d6" +
"f5b66ae101befc14f8b4" "f5b66ae101befc14f8b4"
rHash = make([]byte, 32) rHash = ht.Random32Bytes()
) )
unknownPubBytes, err := route.NewVertexFromStr(unknownPub) unknownPubBytes, err := route.NewVertexFromStr(unknownPub)
require.NoError(ht, err) require.NoError(ht, err)
_, err = rand.Read(rHash)
require.NoError(ht, err)
alice := ht.NewNode("Alice", []string{ alice := ht.NewNode("Alice", []string{
// We add this flag so that we can test the // We add this flag so that we can test the
// LookupHTLCResolutionAssertErr endpoint. // LookupHTLCResolutionAssertErr endpoint.