aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/vm_test.go
diff options
context:
space:
mode:
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,