From dea29b069b265914fcdc57ed6b38a50780c52e72 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 1 Jun 2021 17:22:59 +0200 Subject: [PATCH] set allowUnlimitedContractSize to true & raise the gaslimit --- libs/remix-simulator/src/methods/transactions.ts | 2 +- libs/remix-simulator/src/vm-context.ts | 3 ++- libs/remix-tests/src/testRunner.ts | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/remix-simulator/src/methods/transactions.ts b/libs/remix-simulator/src/methods/transactions.ts index c3a43f5bc4..f63715b57e 100644 --- a/libs/remix-simulator/src/methods/transactions.ts +++ b/libs/remix-simulator/src/methods/transactions.ts @@ -113,7 +113,7 @@ export class Transactions { } eth_estimateGas (payload, cb) { - cb(null, 3000000) + cb(null, 9000000000000000) } eth_getCode (payload, cb) { diff --git a/libs/remix-simulator/src/vm-context.ts b/libs/remix-simulator/src/vm-context.ts index a72be89d1e..a6406b2391 100644 --- a/libs/remix-simulator/src/vm-context.ts +++ b/libs/remix-simulator/src/vm-context.ts @@ -122,7 +122,8 @@ export class VMContext { const vm = new VM({ common, activatePrecompiles: true, - stateManager: stateManager + stateManager: stateManager, + allowUnlimitedContractSize: true }) const web3vm = new remixLibVm.Web3VMProvider() diff --git a/libs/remix-tests/src/testRunner.ts b/libs/remix-tests/src/testRunner.ts index d64398b390..d4ecd3bfc0 100644 --- a/libs/remix-tests/src/testRunner.ts +++ b/libs/remix-tests/src/testRunner.ts @@ -238,7 +238,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com sender = opts.accounts[sender] } } - let sendParams: Record | null = null + let sendParams: Record | null = null if (sender) sendParams = { from: sender } if (func.inputs && func.inputs.length > 0) { return resultsCallback(new Error(`Method '${func.name}' can not have parameters inside a test contract`), { passingNum, failureNum, timePassed }) } const method = testObject.methods[func.name].apply(testObject.methods[func.name], []) @@ -280,6 +280,8 @@ export function runTest (testName: string, testObject: any, contractDetails: Com else sendParams = { value } } } + if (!sendParams) sendParams = {} + sendParams.gas = 9000000000000000 method.send(sendParams).on('receipt', (receipt) => { try { const time: number = (Date.now() - startTime) / 1000.0