mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Added generated stringer for GasChangeReason enum
This commit is contained in:
parent
95a7b396a8
commit
66d5c7ee57
2 changed files with 54 additions and 0 deletions
52
core/tracing/gen_gas_change_reason_stringer.go
Normal file
52
core/tracing/gen_gas_change_reason_stringer.go
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
// Code generated by "stringer -type=GasChangeReason -output gen_gas_change_reason_stringer.go"; DO NOT EDIT.
|
||||||
|
|
||||||
|
package tracing
|
||||||
|
|
||||||
|
import "strconv"
|
||||||
|
|
||||||
|
func _() {
|
||||||
|
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||||
|
// Re-run the stringer command to generate them again.
|
||||||
|
var x [1]struct{}
|
||||||
|
_ = x[GasChangeUnspecified-0]
|
||||||
|
_ = x[GasChangeTxInitialBalance-1]
|
||||||
|
_ = x[GasChangeTxIntrinsicGas-2]
|
||||||
|
_ = x[GasChangeTxRefunds-3]
|
||||||
|
_ = x[GasChangeTxLeftOverReturned-4]
|
||||||
|
_ = x[GasChangeCallInitialBalance-5]
|
||||||
|
_ = x[GasChangeCallLeftOverReturned-6]
|
||||||
|
_ = x[GasChangeCallLeftOverRefunded-7]
|
||||||
|
_ = x[GasChangeCallContractCreation-8]
|
||||||
|
_ = x[GasChangeCallContractCreation2-9]
|
||||||
|
_ = x[GasChangeCallCodeStorage-10]
|
||||||
|
_ = x[GasChangeCallOpCode-11]
|
||||||
|
_ = x[GasChangeCallPrecompiledContract-12]
|
||||||
|
_ = x[GasChangeCallStorageColdAccess-13]
|
||||||
|
_ = x[GasChangeCallFailedExecution-14]
|
||||||
|
_ = x[GasChangeWitnessContractInit-15]
|
||||||
|
_ = x[GasChangeWitnessContractCreation-16]
|
||||||
|
_ = x[GasChangeWitnessCodeChunk-17]
|
||||||
|
_ = x[GasChangeWitnessContractCollisionCheck-18]
|
||||||
|
_ = x[GasChangeTxDataFloor-19]
|
||||||
|
_ = x[GasChangeIgnored-255]
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
_GasChangeReason_name_0 = "GasChangeUnspecifiedGasChangeTxInitialBalanceGasChangeTxIntrinsicGasGasChangeTxRefundsGasChangeTxLeftOverReturnedGasChangeCallInitialBalanceGasChangeCallLeftOverReturnedGasChangeCallLeftOverRefundedGasChangeCallContractCreationGasChangeCallContractCreation2GasChangeCallCodeStorageGasChangeCallOpCodeGasChangeCallPrecompiledContractGasChangeCallStorageColdAccessGasChangeCallFailedExecutionGasChangeWitnessContractInitGasChangeWitnessContractCreationGasChangeWitnessCodeChunkGasChangeWitnessContractCollisionCheckGasChangeTxDataFloor"
|
||||||
|
_GasChangeReason_name_1 = "GasChangeIgnored"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_GasChangeReason_index_0 = [...]uint16{0, 20, 45, 68, 86, 113, 140, 169, 198, 227, 257, 281, 300, 332, 362, 390, 418, 450, 475, 513, 533}
|
||||||
|
)
|
||||||
|
|
||||||
|
func (i GasChangeReason) String() string {
|
||||||
|
switch {
|
||||||
|
case i <= 19:
|
||||||
|
return _GasChangeReason_name_0[_GasChangeReason_index_0[i]:_GasChangeReason_index_0[i+1]]
|
||||||
|
case i == 255:
|
||||||
|
return _GasChangeReason_name_1
|
||||||
|
default:
|
||||||
|
return "GasChangeReason(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -289,6 +289,8 @@ const (
|
||||||
// once per transaction, while those that start with `GasChangeCall` are emitted on a call basis.
|
// once per transaction, while those that start with `GasChangeCall` are emitted on a call basis.
|
||||||
type GasChangeReason byte
|
type GasChangeReason byte
|
||||||
|
|
||||||
|
//go:generate go run golang.org/x/tools/cmd/stringer -type=GasChangeReason -output gen_gas_change_reason_stringer.go
|
||||||
|
|
||||||
const (
|
const (
|
||||||
GasChangeUnspecified GasChangeReason = 0
|
GasChangeUnspecified GasChangeReason = 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue