-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fa5de6
commit c7fae6e
Showing
3 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...ation/src/main/java/net/consensys/linea/zktracer/module/hub/signals/GasCostSingleton.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package net.consensys.linea.zktracer.module.hub.signals; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class GasCostSingleton { | ||
private static GasCostSingleton instance; | ||
private long gasCost = 0; | ||
|
||
private GasCostSingleton() { | ||
// private constructor to prevent instantiation | ||
} | ||
|
||
public void incrementGasCost(long gasCost) { | ||
this.gasCost += gasCost; | ||
} | ||
|
||
public static GasCostSingleton getInstance() { | ||
if (instance == null) { | ||
instance = new GasCostSingleton(); | ||
} | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters