Skip to content

Commit 651f189

Browse files
Cleanup keystore creation (#1175)
1 parent 091a2f7 commit 651f189

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

plugin/evm/atomic/vm/vm_test.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ func (vm *VM) newImportTx(
5858
baseFee *big.Int, // fee to use post-AP3
5959
keys []*secp256k1.PrivateKey, // Keys to import the funds
6060
) (*atomic.Tx, error) {
61-
kc := secp256k1fx.NewKeychain()
62-
for _, key := range keys {
63-
kc.Add(key)
64-
}
65-
61+
kc := secp256k1fx.NewKeychain(keys...)
6662
atomicUTXOs, _, _, err := avax.GetAtomicUTXOs(vm.Ctx.SharedMemory, atomic.Codec, chainID, kc.Addresses(), ids.ShortEmpty, ids.Empty, maxUTXOsToFetch)
6763
if err != nil {
6864
return nil, fmt.Errorf("problem retrieving atomic UTXOs: %w", err)
@@ -1206,8 +1202,7 @@ func TestBuildBlockDoesNotExceedAtomicGasLimit(t *testing.T) {
12061202
}
12071203
}()
12081204

1209-
kc := secp256k1fx.NewKeychain()
1210-
kc.Add(vmtest.TestKeys[0])
1205+
kc := secp256k1fx.NewKeychain(vmtest.TestKeys[0])
12111206
txID, err := ids.ToID(hashing.ComputeHash256(vmtest.TestShortIDAddrs[0][:]))
12121207
require.NoError(t, err)
12131208

@@ -1270,8 +1265,6 @@ func TestExtraStateChangeAtomicGasLimitExceeded(t *testing.T) {
12701265
}
12711266
}()
12721267

1273-
kc := secp256k1fx.NewKeychain()
1274-
kc.Add(vmtest.TestKeys[0])
12751268
txID, err := ids.ToID(hashing.ComputeHash256(vmtest.TestShortIDAddrs[0][:]))
12761269
require.NoError(t, err)
12771270

0 commit comments

Comments
 (0)