diff options
author | Aaron Buchwald <[email protected]> | 2020-11-25 11:20:36 -0500 |
---|---|---|
committer | Aaron Buchwald <[email protected]> | 2020-11-25 11:25:20 -0500 |
commit | 61479754d935e36993f7144d70d7c518cdb26a36 (patch) | |
tree | ce38ae6325561029628e09929615e141e7f3b144 /plugin/evm/vm_test.go | |
parent | 44c27ae8f05bb7f1076d9159d4106afd41e2e010 (diff) |
Add avax API client and upgrade to avalanchego v1.0.5-client
Diffstat (limited to 'plugin/evm/vm_test.go')
-rw-r--r-- | plugin/evm/vm_test.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/plugin/evm/vm_test.go b/plugin/evm/vm_test.go index 020b663..1b894ce 100644 --- a/plugin/evm/vm_test.go +++ b/plugin/evm/vm_test.go @@ -36,7 +36,7 @@ var ( ) func init() { - cb58 := formatting.CB58{} + var b []byte factory := crypto.FactorySECP256K1R{} for _, key := range []string{ @@ -44,8 +44,8 @@ func init() { "2MMvUMsxx6zsHSNXJdFD8yc5XkancvwyKPwpw4xUK3TCGDuNBY", "cxb7KpGWhDMALTjNNSJ7UQkkomPesyWAPUaWRGdyeBNzR6f35", } { - _ = cb58.FromString(key) - pk, _ := factory.ToPrivateKey(cb58.Bytes) + b, _ = formatting.Decode(formatting.CB58, key) + pk, _ := factory.ToPrivateKey(b) secpKey := pk.(*crypto.PrivateKeySECP256K1R) testKeys = append(testKeys, secpKey) testEthAddrs = append(testEthAddrs, GetEthAddress(secpKey)) @@ -63,11 +63,11 @@ func BuildGenesisTest(t *testing.T) []byte { if err := json.Unmarshal([]byte(genesisJSON), genesis); err != nil { t.Fatalf("Problem unmarshaling genesis JSON: %s", err) } - genesisReply, err := ss.BuildGenesis(nil, genesis) + genesisBytes, err := ss.BuildGenesis(nil, genesis) if err != nil { t.Fatalf("Failed to create test genesis") } - return genesisReply.Bytes + return genesisBytes } func NewContext() *snow.Context { @@ -102,7 +102,10 @@ func GenesisVM(t *testing.T, finishBootstrapping bool) (chan engCommon.Message, // The caller of this function is responsible for unlocking. ctx.Lock.Lock() - userKeystore := keystore.CreateTestKeystore() + userKeystore, err := keystore.CreateTestKeystore() + if err != nil { + t.Fatal(err) + } if err := userKeystore.AddUser(username, password); err != nil { t.Fatal(err) } @@ -112,7 +115,7 @@ func GenesisVM(t *testing.T, finishBootstrapping bool) (chan engCommon.Message, vm := &VM{ txFee: testTxFee, } - err := vm.Initialize( + err = vm.Initialize( ctx, prefixdb.New([]byte{1}, baseDB), genesisBytes, |