MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestGetThePubKeyNonce

Function TestGetThePubKeyNonce

crypto/asymmetric/keypair_test.go:93–108  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

91}
92
93func TestGetThePubKeyNonce(t *testing.T) {
94 Convey("translate key error", t, func() {
95 publicKey, _ := ParsePubKey([]byte{
96 0x02,
97 0xc1, 0xdb, 0x96, 0xf2, 0xba, 0x7e, 0x1c, 0xb4,
98 0xe9, 0x82, 0x2d, 0x12, 0xde, 0x0f, 0x63, 0xfb,
99 0x66, 0x6f, 0xeb, 0x82, 0x8c, 0x7f, 0x50, 0x9e,
100 0x81, 0xfa, 0xb9, 0xbd, 0x7a, 0x34, 0x03, 0x9c,
101 })
102 nonce := GetPubKeyNonce(publicKey, 256, 1*time.Second, nil)
103
104 log.Infof("nonce: %v", nonce)
105 // sometimes nonce difficulty can be little bit higher than expected
106 So(nonce.Difficulty, ShouldBeLessThanOrEqualTo, 40)
107 })
108}
109
110func TestPubKey(t *testing.T) {
111 pubKeyTests := []struct {

Callers

nothing calls this directly

Calls 3

InfofFunction · 0.92
ParsePubKeyFunction · 0.85
GetPubKeyNonceFunction · 0.85

Tested by

no test coverage detected