Skip to content

Commit

Permalink
✅ Fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
William Cory authored and William Cory committed Jun 13, 2024
1 parent c3c4e49 commit 77c7a73
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
10 changes: 5 additions & 5 deletions packages/actions/src/Call/__snapshots__/callHandler.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`callHandler should handle errors returned during contract call 1`] = `
{
"amountSpent": 154763n,
"amountSpent": 180082n,
"createdAddresses": Set {},
"errors": [
[RevertError: revert
Expand All @@ -11,11 +11,11 @@ Docs: https://tevm.sh/reference/tevm/errors/classes/reverterror/
Details: {"error":"revert","errorType":"EvmError"}
Version: 1.1.0.next-73],
],
"executionGasUsed": 169n,
"gas": 29977891n,
"executionGasUsed": 3786n,
"gas": 29974274n,
"logs": [],
"rawData": "0x",
"rawData": "0xfb8f41b2000000000000000000000000232323232323232323232323232323232323232300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
"selfdestruct": Set {},
"totalGasSpent": 22109n,
"totalGasSpent": 25726n,
}
`;
15 changes: 8 additions & 7 deletions packages/actions/src/Call/callHandler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { setAccountHandler } from '../SetAccount/setAccountHandler.js'
import { callHandler } from './callHandler.js'

const ERC20_ADDRESS = `0x${'3'.repeat(40)}` as const
const ERC20_BYTECODE = TestERC20.bytecode
const ERC20_BYTECODE = TestERC20.deployedBytecode
const ERC20_ABI = TestERC20.abi

describe('callHandler', () => {
Expand Down Expand Up @@ -65,8 +65,9 @@ describe('callHandler', () => {
return res.execResult.executionGasUsed
}),
)
expect(gasUsed).toBe(2447n)
expect(gasUsed).toBe(2851n)

console.log('running test')
expect(
await callHandler(client)({
createAccessList: true,
Expand All @@ -79,24 +80,24 @@ describe('callHandler', () => {
gas: 16784800n,
}),
).toEqual({
amountSpent: 167153n,
amountSpent: 169981n,
preimages: {
'0x37d95e0aa71e34defa88b4c43498bc8b90207e31ad0ef4aa6f5bea78bd25a1ab':
'0x3333333333333333333333333333333333333333',
'0x5380c7b7ae81a58eb98d9c78de4a1fd7fd9535fc953ed2be602daaa41767312a':
'0x0000000000000000000000000000000000000000',
},
totalGasSpent: 23879n,
totalGasSpent: 24283n,
rawData: '0x0000000000000000000000000000000000000000000000000000000000000000',
gas: 29976121n,
executionGasUsed: 2447n,
executionGasUsed: 2851n,
gas: 29975717n,
selfdestruct: new Set(),
logs: [],
createdAddresses: new Set(),
accessList: Object.fromEntries([
[
'0x3333333333333333333333333333333333333333',
new Set(['0xc042e0f5eb0064bf1d9722ec18e39f827a2cf491b49d2d4c34a5ecf7a61b44b7']),
new Set(['0x0ae1369e98a926a2595ace665f90c7976b6a86afbcadb3c1ceee24998c087435']),
],
]),
})
Expand Down
2 changes: 0 additions & 2 deletions packages/vm/src/actions/runTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ function execHardfork(hardfork: Hardfork | string, preMergeHf: Hardfork | string
export const runTx =
(vm: BaseVm) =>
async (opts: RunTxOpts): Promise<RunTxResult> => {
console.log('huh what is tx doing', (opts.tx as any).maxFeePerGas)
// create a reasonable default if no block is given
opts.block = opts.block ?? Block.fromBlockData({}, { common: vm.common })

Expand Down Expand Up @@ -202,7 +201,6 @@ const _runTx =
// assert transaction.max_fee_per_gas >= block.base_fee_per_gas
const maxFeePerGas = 'maxFeePerGas' in tx ? tx.maxFeePerGas : tx.gasPrice
const baseFeePerGas = block.header.baseFeePerGas ?? 0n
console.log({ maxFeePerGas, baseFeePerGas, tx: (tx as any).maxFeePergas })
if (maxFeePerGas < baseFeePerGas) {
const msg = _errorMsg(
`Transaction's ${
Expand Down

0 comments on commit 77c7a73

Please sign in to comment.