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

Function TestGetPubKeyNonce

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

Source from the content-addressed store, hash-verified

72}
73
74func TestGetPubKeyNonce(t *testing.T) {
75 Convey("translate key error", t, func() {
76 privateKey, publicKey, err := GenSecp256k1KeyPair()
77 if err != nil {
78 t.Fatal("failed to generate private key")
79 }
80 log.Infof("privateKey: %x", privateKey.Serialize())
81 log.Infof("publicKey: %x", publicKey.Serialize())
82
83 nonce := GetPubKeyNonce(publicKey, 20, 500*time.Millisecond, nil)
84 log.Infof("nonce: %v", nonce)
85 // sometimes nonce difficulty can be little bit higher than expected
86 So(nonce.Difficulty, ShouldBeLessThanOrEqualTo, 120)
87 })
88 Convey("translate key error", t, func() {
89
90 })
91}
92
93func TestGetThePubKeyNonce(t *testing.T) {
94 Convey("translate key error", t, func() {

Callers

nothing calls this directly

Calls 5

InfofFunction · 0.92
GenSecp256k1KeyPairFunction · 0.85
GetPubKeyNonceFunction · 0.85
FatalMethod · 0.80
SerializeMethod · 0.45

Tested by

no test coverage detected