()
| 201 | } |
| 202 | |
| 203 | func setup() { |
| 204 | rand.Seed(time.Now().UnixNano()) |
| 205 | rand.Read(genesisHash[:]) |
| 206 | f, err := ioutil.TempFile("", "keystore") |
| 207 | |
| 208 | if err != nil { |
| 209 | panic(err) |
| 210 | } |
| 211 | |
| 212 | f.Close() |
| 213 | |
| 214 | if err = kms.InitPublicKeyStore(f.Name(), nil); err != nil { |
| 215 | panic(err) |
| 216 | } |
| 217 | |
| 218 | kms.Unittest = true |
| 219 | |
| 220 | if testingPrivateKey, testingPublicKey, err = asymmetric.GenSecp256k1KeyPair(); err == nil { |
| 221 | kms.SetLocalKeyPair(testingPrivateKey, testingPublicKey) |
| 222 | } else { |
| 223 | panic(err) |
| 224 | } |
| 225 | |
| 226 | log.SetOutput(os.Stdout) |
| 227 | log.SetLevel(log.DebugLevel) |
| 228 | } |
| 229 | |
| 230 | func TestMain(m *testing.M) { |
| 231 | setup() |
no test coverage detected