set allowUnlimitedContractSize to true & raise the gaslimit

pull/1249/head
yann300 4 years ago
parent 0daf7f19b1
commit dea29b069b
  1. 2
      libs/remix-simulator/src/methods/transactions.ts
  2. 3
      libs/remix-simulator/src/vm-context.ts
  3. 4
      libs/remix-tests/src/testRunner.ts

@ -113,7 +113,7 @@ export class Transactions {
} }
eth_estimateGas (payload, cb) { eth_estimateGas (payload, cb) {
cb(null, 3000000) cb(null, 9000000000000000)
} }
eth_getCode (payload, cb) { eth_getCode (payload, cb) {

@ -122,7 +122,8 @@ export class VMContext {
const vm = new VM({ const vm = new VM({
common, common,
activatePrecompiles: true, activatePrecompiles: true,
stateManager: stateManager stateManager: stateManager,
allowUnlimitedContractSize: true
}) })
const web3vm = new remixLibVm.Web3VMProvider() const web3vm = new remixLibVm.Web3VMProvider()

@ -238,7 +238,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
sender = opts.accounts[sender] sender = opts.accounts[sender]
} }
} }
let sendParams: Record<string, string> | null = null let sendParams: Record<string, any> | null = null
if (sender) sendParams = { from: sender } 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 }) } 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], []) 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 } else sendParams = { value }
} }
} }
if (!sendParams) sendParams = {}
sendParams.gas = 9000000000000000
method.send(sendParams).on('receipt', (receipt) => { method.send(sendParams).on('receipt', (receipt) => {
try { try {
const time: number = (Date.now() - startTime) / 1000.0 const time: number = (Date.now() - startTime) / 1000.0

Loading…
Cancel
Save