Skip to content

Commit aee16ab

Browse files
committed
fix eth_estimateGas
1 parent 04b147f commit aee16ab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libs/remix-simulator/src/methods/transactions.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,12 @@ export class Transactions {
143143
return cb('revert ' + reason)
144144
} catch (e) {
145145
return cb(e.message)
146-
}
146+
}
147+
}
148+
let gasUsed = result.result.execResult.gasUsed.toNumber()
149+
if (result.result.execResult.gasRefund) {
150+
gasUsed += result.result.execResult.gasRefund.toNumber()
147151
}
148-
const gasUsed = result.result.execResult.gasUsed.toNumber()
149152
cb(null, Math.ceil(gasUsed + (15 * gasUsed) / 100))
150153
})
151154
}

0 commit comments

Comments
 (0)