Skip to content

Commit c969e59

Browse files
committed
Fix linting error
1 parent 9a73667 commit c969e59

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

lib/evm/opFns.ts

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,10 @@ function getContractStorage(runState: RunState, address: Buffer, key: Buffer) {
912912
}
913913
runState.stateManager.getContractStorage(address, key, (err: Error, current: Buffer) => {
914914
if (err) return cb(err, null)
915-
if (runState._common.hardfork() === 'constantinople' || runState._common.gteHardfork('istanbul')) {
915+
if (
916+
runState._common.hardfork() === 'constantinople' ||
917+
runState._common.gteHardfork('istanbul')
918+
) {
916919
runState.stateManager.getOriginalContractStorage(
917920
address,
918921
key,
@@ -980,42 +983,60 @@ function updateSstoreGas(runState: RunState, found: any, value: Buffer) {
980983
const original = found.original
981984
const current = found.current
982985
// Fail if not enough gas is left
983-
if (runState.eei.getGasLeft().lten(runState._common.param('gasPrices', 'sstoreSentryGasEIP2200'))) {
986+
if (
987+
runState.eei.getGasLeft().lten(runState._common.param('gasPrices', 'sstoreSentryGasEIP2200'))
988+
) {
984989
trap(ERROR.OUT_OF_GAS)
985990
}
986991

987992
// Noop
988993
if (current.equals(value)) {
989-
return runState.eei.useGas(new BN(runState._common.param('gasPrices', 'sstoreNoopGasEIP2200')))
994+
return runState.eei.useGas(
995+
new BN(runState._common.param('gasPrices', 'sstoreNoopGasEIP2200')),
996+
)
990997
}
991998
if (original.equals(current)) {
992999
// Create slot
9931000
if (original.length === 0) {
994-
return runState.eei.useGas(new BN(runState._common.param('gasPrices', 'sstoreInitGasEIP2200')))
1001+
return runState.eei.useGas(
1002+
new BN(runState._common.param('gasPrices', 'sstoreInitGasEIP2200')),
1003+
)
9951004
}
9961005
// Delete slot
9971006
if (value.length === 0) {
998-
runState.eei.refundGas(new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200')))
1007+
runState.eei.refundGas(
1008+
new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200')),
1009+
)
9991010
}
10001011
// Write existing slot
1001-
return runState.eei.useGas(new BN(runState._common.param('gasPrices', 'sstoreCleanGasEIP2200')))
1012+
return runState.eei.useGas(
1013+
new BN(runState._common.param('gasPrices', 'sstoreCleanGasEIP2200')),
1014+
)
10021015
}
10031016
if (original.length > 0) {
1004-
// Recreate slot
10051017
if (current.length === 0) {
1006-
runState.eei.subRefund(new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200')))
1007-
// Delete slot
1018+
// Recreate slot
1019+
runState.eei.subRefund(
1020+
new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200')),
1021+
)
10081022
} else if (value.length === 0) {
1009-
runState.eei.refundGas(new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200')))
1023+
// Delete slot
1024+
runState.eei.refundGas(
1025+
new BN(runState._common.param('gasPrices', 'sstoreClearRefundEIP2200')),
1026+
)
10101027
}
10111028
}
10121029
if (original.equals(value)) {
1013-
// Reset to original non-existent slot
10141030
if (original.length === 0) {
1015-
runState.eei.refundGas(new BN(runState._common.param('gasPrices', 'sstoreInitRefundEIP2200')))
1016-
// Reset to original existing slot
1031+
// Reset to original non-existent slot
1032+
runState.eei.refundGas(
1033+
new BN(runState._common.param('gasPrices', 'sstoreInitRefundEIP2200')),
1034+
)
10171035
} else {
1018-
runState.eei.refundGas(new BN(runState._common.param('gasPrices', 'sstoreCleanRefundEIP2200')))
1036+
// Reset to original existing slot
1037+
runState.eei.refundGas(
1038+
new BN(runState._common.param('gasPrices', 'sstoreCleanRefundEIP2200')),
1039+
)
10191040
}
10201041
}
10211042
// Dirty update

lib/exceptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export enum ERROR {
1010
INTERNAL_ERROR = 'internal error',
1111
CREATE_COLLISION = 'create collision',
1212
STOP = 'stop',
13-
REFUND_EXHAUSTED = 'refund exhausted'
13+
REFUND_EXHAUSTED = 'refund exhausted',
1414
}
1515

1616
export class VmError {

0 commit comments

Comments
 (0)