Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit e30ecea

Browse files
authored
Cleanup: CalcCallGasCost to NonZeroValueCall (#46)
1 parent f17f1d7 commit e30ecea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/gas/overhead.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ func (ov *Overhead) CalcPreVerificationGas(op *userop.UserOperation) *big.Int {
3939
return big.NewInt(int64(math.Round(pvg)))
4040
}
4141

42-
// CalcCallGasCost returns an expected gas cost of using the CALL opcode in the context of EIP-4337. See
43-
// https://github.com/wolflo/evm-opcodes/blob/main/gas.md#aa-1-call.
44-
func (ov *Overhead) CalcCallGasCost() *big.Int {
42+
// NonZeroValueCall returns an expected gas cost of using the CALL opcode in the context of EIP-4337.
43+
// See https://github.com/wolflo/evm-opcodes/blob/main/gas.md#aa-1-call.
44+
func (ov *Overhead) NonZeroValueCall() *big.Int {
4545
return big.NewInt(int64(ov.warmStorageRead + ov.nonZeroValueCall + ov.callOpcode + ov.nonZeroValueStipend))
4646
}
4747

pkg/modules/checks/sanitychecks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func checkPaymasterAndData(eth *ethclient.Client, ep *entrypoint.Entrypoint, op
9090

9191
// Checks the callGasLimit is at least the cost of a CALL with non-zero value.
9292
func checkCallGasLimit(op *userop.UserOperation) error {
93-
cg := gas.NewDefaultOverhead().CalcCallGasCost()
93+
cg := gas.NewDefaultOverhead().NonZeroValueCall()
9494
if op.CallGasLimit.Cmp(cg) < 0 {
9595
return fmt.Errorf("callGasLimit: below expected gas of %s", cg.String())
9696
}

0 commit comments

Comments
 (0)