From 3418bbcef4de0fa067d36e1855f73bc1fd0f7601 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 25 Mar 2022 13:09:09 +0100 Subject: [PATCH] better selection of current account --- libs/remix-lib/src/execution/txRunnerVM.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/remix-lib/src/execution/txRunnerVM.ts b/libs/remix-lib/src/execution/txRunnerVM.ts index 2f50204503..fb4e291916 100644 --- a/libs/remix-lib/src/execution/txRunnerVM.ts +++ b/libs/remix-lib/src/execution/txRunnerVM.ts @@ -56,11 +56,12 @@ export class TxRunnerVM { runInVm (from, to, data, value, gasLimit, useCall, timestamp, callback) { const self = this - let account = self.vmaccounts[from] - if (!account && useCall && Object.keys(self.vmaccounts).length) { + let account + if (!from && useCall && Object.keys(self.vmaccounts).length) { from = Object.keys(self.vmaccounts)[0] account = self.vmaccounts[from] - } + } else account = self.vmaccounts[from] + if (!account) { return callback('Invalid account selected') }