Files
lspd/itest/test_common.go
2022-12-10 11:41:52 +01:00

28 lines
465 B
Go

package itest
import (
"crypto/rand"
"testing"
"github.com/stretchr/testify/assert"
)
func GenerateRandomBytes(n int) ([]byte, error) {
b := make([]byte, n)
_, err := rand.Read(b)
// Note that err == nil only if we read len(b) bytes.
if err != nil {
return nil, err
}
return b, nil
}
func AssertChannelCapacity(
t *testing.T,
outerAmountMsat uint64,
capacityMsat uint64,
) {
assert.Equal(t, ((outerAmountMsat/1000)+100000)*1000, capacityMsat)
}