mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 09:51:36 +00:00
core: turn gas into a vector <regularGas, stateGas>
This commit is contained in:
parent
eb124a4fec
commit
aa0489ae87
1 changed files with 17 additions and 0 deletions
17
core/vm/gascosts.go
Normal file
17
core/vm/gascosts.go
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package vm
|
||||
|
||||
import "fmt"
|
||||
|
||||
type GasCosts struct {
|
||||
RegularGas uint64
|
||||
StateGas uint64
|
||||
}
|
||||
|
||||
// Sum returns the total gas (regular + state).
|
||||
func (g GasCosts) Sum() uint64 {
|
||||
return g.RegularGas + g.StateGas
|
||||
}
|
||||
|
||||
func (g GasCosts) String() string {
|
||||
return fmt.Sprintf("<%v,%v>", g.RegularGas, g.StateGas)
|
||||
}
|
||||
Loading…
Reference in a new issue