From 691d025f263e39d18c05a7b5c6b15db541aa7620 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 9 Jul 2024 13:07:17 +0530 Subject: [PATCH] fix account creation --- libs/remix-simulator/src/methods/accounts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-simulator/src/methods/accounts.ts b/libs/remix-simulator/src/methods/accounts.ts index 61766e1631..6c99565455 100644 --- a/libs/remix-simulator/src/methods/accounts.ts +++ b/libs/remix-simulator/src/methods/accounts.ts @@ -44,7 +44,7 @@ export class Web3Accounts { async _addAccount (privateKey, balance) { try { - privateKey = toBytes('0x' + privateKey) + if (typeof privateKey === 'string') privateKey = toBytes('0x' + privateKey) const address: Uint8Array = privateToAddress(privateKey) const addressStr = toChecksumAddress(bytesToHex(address)) this.accounts[addressStr] = { privateKey, nonce: 0 }