(t *testing.T)
| 72 | } |
| 73 | |
| 74 | func 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 | |
| 93 | func TestGetThePubKeyNonce(t *testing.T) { |
| 94 | Convey("translate key error", t, func() { |
nothing calls this directly
no test coverage detected