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

Function setup

types/xxx_test.go:203–228  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

201}
202
203func 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
230func TestMain(m *testing.M) {
231 setup()

Callers 1

TestMainFunction · 0.70

Calls 8

InitPublicKeyStoreFunction · 0.92
GenSecp256k1KeyPairFunction · 0.92
SetLocalKeyPairFunction · 0.92
SetOutputFunction · 0.92
SetLevelFunction · 0.92
NameMethod · 0.80
ReadMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected