Skip to content

Commit 5ed0298

Browse files
committed
fix using ethereumjs 10 api
1 parent 67a4787 commit 5ed0298

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

libs/remix-debug/src/code/codeUtils.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'
22
import { bytesToHex } from '@ethereumjs/util'
33
import { Common, Mainnet } from '@ethereumjs/common'
4-
// TODO fix the import when getOpcodesForHF is exported
54
import { getOpcodesForHF, paramsEVM } from '@ethereumjs/evm'
65
import getOpcodes from './opcodes'
76

@@ -27,9 +26,8 @@ export function nameOpCodes (raw, hardfork) {
2726
const jumpNum = raw[pc] - 0x5f
2827
pushData = raw.slice(pc + 1, pc + jumpNum + 1)
2928
i += jumpNum
30-
}
31-
32-
const hexCode = bytesToHex((pushData as any))
29+
}
30+
const hexCode = pushData ? bytesToHex((pushData as any)) : ''
3331
// @ts-ignore
3432
const data = hexCode !== '' ? ' ' + hexCode : ''
3533

libs/remix-lib/src/execution/txRunnerVM.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ConsensusType } from '@ethereumjs/common'
55
import { LegacyTx, createLegacyTx, createFeeMarket1559Tx, createEOACode7702Tx, createLegacyTxFromRLP, createFeeMarket1559TxFromRLP } from '@ethereumjs/tx'
66
import { Block, createBlock, createBlockFromRLP } from '@ethereumjs/block'
77
import { bytesToHex, hexToBytes, createAddressFromString } from '@ethereumjs/util'
8-
import type { AddressLike, BigIntLike } from '@ethereumjs/util'
8+
import type { AddressLike, BigIntLike, PrefixedHexString } from '@ethereumjs/util'
99
import { EventManager } from '../eventManager'
1010
import { LogsManager } from './logsManager'
1111
import type { Transaction as InternalTransaction } from './txRunner'
@@ -114,9 +114,9 @@ export class TxRunnerVM {
114114
let tx
115115
if (signed) {
116116
if (!EIP1559) {
117-
tx = createLegacyTxFromRLP(hexToBytes(data), { common: this.commonContext })
117+
tx = createLegacyTxFromRLP(hexToBytes(data as PrefixedHexString), { common: this.commonContext })
118118
} else {
119-
tx = createFeeMarket1559TxFromRLP(hexToBytes(data), { common: this.commonContext })
119+
tx = createFeeMarket1559TxFromRLP(hexToBytes(data as PrefixedHexString), { common: this.commonContext })
120120
}
121121
}
122122
else {
@@ -137,7 +137,7 @@ export class TxRunnerVM {
137137
gasLimit: gasLimit,
138138
to: (to as AddressLike),
139139
value: (value as BigIntLike),
140-
data: hexToBytes(data)
140+
data: hexToBytes(data as PrefixedHexString)
141141
}, { common: this.commonContext }).sign(account.privateKey)
142142
} else {
143143
tx = createFeeMarket1559Tx({
@@ -147,7 +147,7 @@ export class TxRunnerVM {
147147
gasLimit: gasLimit,
148148
to: (to as AddressLike),
149149
value: (value as BigIntLike),
150-
data: hexToBytes(data)
150+
data: hexToBytes(data as PrefixedHexString)
151151
}).sign(account.privateKey)
152152
}
153153
}

libs/remix-simulator/src/VmProxy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { isBigInt } from 'web3-validator'
99
import { Interface, zeroPadValue } from 'ethers'
1010
import { VMContext } from './vm-context'
1111
import type { StateManagerInterface } from '@ethereumjs/common'
12-
import type { EVMResult, InterpreterStep, Message } from '@ethereumjs/evm'
12+
import type { InterpreterStep } from '@ethereumjs/evm'
1313
import type { AfterTxEvent, VM } from '@ethereumjs/vm'
1414
import type { TypedTransaction } from '@ethereumjs/tx'
1515

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { execution } from '@remix-project/remix-lib'
55
import { AbiCoder } from 'ethers'
66
import { VMexecutionResult } from '@remix-project/remix-lib'
77
import { VMContext } from '../vm-context'
8-
import { Log, EvmError } from '@ethereumjs/evm'
8+
import { Log, EVMError } from '@ethereumjs/evm'
99
const TxRunnerVM = execution.TxRunnerVM
1010
const TxRunner = execution.TxRunner
1111

1212
export type VMExecResult = {
13-
exceptionError: EvmError
13+
exceptionError: EVMError
1414
executionGasUsed: bigint
1515
gas: bigint
1616
gasRefund: bigint

libs/remix-simulator/src/vm-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Common, ConsensusType, CommonOpts, Mainnet } from '@ethereumjs/common'
1212
import { MerklePatriciaTrie, createMPT, verifyMerkleProof } from '@ethereumjs/mpt'
1313
import { MerkleStateManager, MerkleStateManagerOpts } from '@ethereumjs/statemanager'
1414
import { StateManagerInterface, StorageDump } from '@ethereumjs/common'
15-
import { createEVM, EVM } from '@ethereumjs/evm'
15+
import { createEVM } from '@ethereumjs/evm'
1616
import { Blockchain, DBSaveLookups, createBlockchain } from '@ethereumjs/blockchain'
1717
import { Block, BlockHeader, createBlock, createBlockFromRLP } from '@ethereumjs/block'
1818
import { TypedTransaction } from '@ethereumjs/tx'

0 commit comments

Comments
 (0)