aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/vm_test.go
diff options
context:
space:
mode:
authoraaronbuchwald <[email protected]>2020-11-25 11:28:48 -0500
committerGitHub <[email protected]>2020-11-25 11:28:48 -0500
commit2ea6c2aeacd37f347c5794d6b300a6d1815c251b (patch)
treece38ae6325561029628e09929615e141e7f3b144 /plugin/evm/vm_test.go
parent44c27ae8f05bb7f1076d9159d4106afd41e2e010 (diff)
parent61479754d935e36993f7144d70d7c518cdb26a36 (diff)
Merge pull request #61 from ava-labs/client-api
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.go17
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,