forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 5
/
test_keys.go
37 lines (31 loc) · 901 Bytes
/
test_keys.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package crypto
import (
"github.com/MetalBlockchain/metalgo/utils/cb58"
)
func BuildTestKeys() []*PrivateKeySECP256K1R {
var (
keyStrings = []string{
"24jUJ9vZexUM6expyMcT48LBx27k1m7xpraoV62oSQAHdziao5",
"2MMvUMsxx6zsHSNXJdFD8yc5XkancvwyKPwpw4xUK3TCGDuNBY",
"cxb7KpGWhDMALTjNNSJ7UQkkomPesyWAPUaWRGdyeBNzR6f35",
"ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN",
"2RWLv6YVEXDiWLpaCbXhhqxtLbnFaKQsWPSSMSPhpWo47uJAeV",
}
keys = make([]*PrivateKeySECP256K1R, len(keyStrings))
factory = FactorySECP256K1R{}
)
for i, key := range keyStrings {
privKeyBytes, err := cb58.Decode(key)
if err != nil {
panic(err)
}
pk, err := factory.ToPrivateKey(privKeyBytes)
if err != nil {
panic(err)
}
keys[i] = pk.(*PrivateKeySECP256K1R)
}
return keys
}