Skip to content

Commit 20e845d

Browse files
cgeweckeholgerd77
authored andcommitted
Lint fixes (config 2.0)
1 parent f82db4a commit 20e845d

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

packages/vm/lib/evm/opcodes/EIP1283.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function updateSstoreGasEIP1283(runState: RunState, found: any, value: Bu
4747
if (original.length === 0) {
4848
// If original value is 0, add 19800 gas to refund counter.
4949
runState.eei.refundGas(
50-
new BN(runState._common.param('gasPrices', 'netSstoreResetClearRefund')),
50+
new BN(runState._common.param('gasPrices', 'netSstoreResetClearRefund'))
5151
)
5252
} else {
5353
// Otherwise, add 4800 gas to refund counter.

packages/vm/lib/evm/opcodes/EIP2200.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -26,37 +26,37 @@ export function updateSstoreGasEIP2200(runState: RunState, found: any, value: Bu
2626
if (current.equals(value)) {
2727
const sstoreNoopCost = runState._common.param('gasPrices', 'sstoreNoopGasEIP2200')
2828
return runState.eei.useGas(
29-
new BN(adjustSstoreGasEIP2929(runState, key, sstoreNoopCost, 'noop')),
29+
new BN(adjustSstoreGasEIP2929(runState, key, sstoreNoopCost, 'noop'))
3030
)
3131
}
3232
if (original.equals(current)) {
3333
// Create slot
3434
if (original.length === 0) {
3535
return runState.eei.useGas(
36-
new BN(runState._common.param('gasPrices', 'sstoreInitGasEIP2200')),
36+
new BN(runState._common.param('gasPrices', 'sstoreInitGasEIP2200'))
3737
)
3838
}
3939
// Delete slot
4040
if (value.length === 0) {
4141
runState.eei.refundGas(
42-
new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200')),
42+
new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200'))
4343
)
4444
}
4545
// Write existing slot
4646
return runState.eei.useGas(
47-
new BN(runState._common.param('gasPrices', 'sstoreCleanGasEIP2200')),
47+
new BN(runState._common.param('gasPrices', 'sstoreCleanGasEIP2200'))
4848
)
4949
}
5050
if (original.length > 0) {
5151
if (current.length === 0) {
5252
// Recreate slot
5353
runState.eei.subRefund(
54-
new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200')),
54+
new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200'))
5555
)
5656
} else if (value.length === 0) {
5757
// Delete slot
5858
runState.eei.refundGas(
59-
new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200')),
59+
new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200'))
6060
)
6161
}
6262
}
@@ -65,13 +65,13 @@ export function updateSstoreGasEIP2200(runState: RunState, found: any, value: Bu
6565
// Reset to original non-existent slot
6666
const sstoreInitRefund = runState._common.param('gasPrices', 'sstoreInitRefundEIP2200')
6767
runState.eei.refundGas(
68-
new BN(adjustSstoreGasEIP2929(runState, key, sstoreInitRefund, 'initRefund')),
68+
new BN(adjustSstoreGasEIP2929(runState, key, sstoreInitRefund, 'initRefund'))
6969
)
7070
} else {
7171
// Reset to original existing slot
7272
const sstoreCleanRefund = runState._common.param('gasPrices', 'sstoreCleanRefundEIP2200')
7373
runState.eei.refundGas(
74-
new BN(adjustSstoreGasEIP2929(runState, key, sstoreCleanRefund, 'cleanRefund')),
74+
new BN(adjustSstoreGasEIP2929(runState, key, sstoreCleanRefund, 'cleanRefund'))
7575
)
7676
}
7777
}

packages/vm/lib/evm/opcodes/EIP2929.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function accessAddressEIP2929(runState: RunState, address: BN | Buffer, b
2222
// selfdestruct beneficiary address reads are charged an *additional* cold access
2323
if (baseFee !== undefined) {
2424
runState.eei.useGas(
25-
new BN(runState._common.param('gasPrices', 'coldaccountaccess') - baseFee),
25+
new BN(runState._common.param('gasPrices', 'coldaccountaccess') - baseFee)
2626
)
2727
}
2828
// Warm: (selfdestruct beneficiary address reads are not charged when warm)
@@ -74,7 +74,7 @@ export function adjustSstoreGasEIP2929(
7474
runState: RunState,
7575
key: Buffer,
7676
defaultCost: number,
77-
costName: string,
77+
costName: string
7878
): number {
7979
if (!runState._common.eips().includes(2929)) return defaultCost
8080

packages/vm/lib/evm/opcodes/functions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ export const handlers: Map<number, OpHandler> = new Map([
10781078
accessAddressEIP2929(
10791079
runState,
10801080
toAddressBuf,
1081-
runState._common.param('gasPrices', 'delegatecall'),
1081+
runState._common.param('gasPrices', 'delegatecall')
10821082
)
10831083

10841084
gasLimit = maxCallGas(gasLimit, runState.eei.getGasLeft(), runState)
@@ -1111,7 +1111,7 @@ export const handlers: Map<number, OpHandler> = new Map([
11111111
accessAddressEIP2929(
11121112
runState,
11131113
toAddressBuf,
1114-
runState._common.param('gasPrices', 'staticcall'),
1114+
runState._common.param('gasPrices', 'staticcall')
11151115
)
11161116
gasLimit = maxCallGas(gasLimit, runState.eei.getGasLeft(), runState) // we set TangerineWhistle or later to true here, as STATICCALL was available from Byzantium (which is after TangerineWhistle)
11171117

0 commit comments

Comments
 (0)