You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chantools/btc/descriptors_test.go

28 lines
549 B
Go

package btc
import (
"testing"
"github.com/stretchr/testify/require"
)
var testCases = []struct {
descriptor string
expectedSum string
}{{
descriptor: "addr(mkmZxiEcEd8ZqjQWVZuC6so5dFMKEFpN2j)",
expectedSum: "#02wpgw69",
}, {
descriptor: "tr(cRhCT5vC5NdnSrQ2Jrah6NPCcth41uT8DWFmA6uD8R4x2ufucnYX)",
expectedSum: "#gwfmkgga",
}}
func TestDescriptorSum(t *testing.T) {
for _, tc := range testCases {
sum := DescriptorSumCreate(tc.descriptor)
require.Equal(t, tc.descriptor+tc.expectedSum, sum)
DescriptorSumCheck(sum, true)
}
}