Added -trimprefix and NonceChangeReason stringer too

This commit is contained in:
Matthieu Vachon 2025-02-21 13:06:01 -05:00
parent 9beca6c227
commit 29d57c1c02
4 changed files with 40 additions and 9 deletions

View file

@ -1,4 +1,4 @@
// Code generated by "stringer -type=BalanceChangeReason -output gen_balance_change_reason_stringer.go"; DO NOT EDIT. // Code generated by "stringer -type=BalanceChangeReason -trimprefix=BalanceChange -output gen_balance_change_reason_stringer.go"; DO NOT EDIT.
package tracing package tracing
@ -26,9 +26,9 @@ func _() {
_ = x[BalanceChangeRevert-15] _ = x[BalanceChangeRevert-15]
} }
const _BalanceChangeReason_name = "BalanceChangeUnspecifiedBalanceIncreaseRewardMineUncleBalanceIncreaseRewardMineBlockBalanceIncreaseWithdrawalBalanceIncreaseGenesisBalanceBalanceIncreaseRewardTransactionFeeBalanceDecreaseGasBuyBalanceIncreaseGasReturnBalanceIncreaseDaoContractBalanceDecreaseDaoAccountBalanceChangeTransferBalanceChangeTouchAccountBalanceIncreaseSelfdestructBalanceDecreaseSelfdestructBalanceDecreaseSelfdestructBurnBalanceChangeRevert" const _BalanceChangeReason_name = "UnspecifiedBalanceIncreaseRewardMineUncleBalanceIncreaseRewardMineBlockBalanceIncreaseWithdrawalBalanceIncreaseGenesisBalanceBalanceIncreaseRewardTransactionFeeBalanceDecreaseGasBuyBalanceIncreaseGasReturnBalanceIncreaseDaoContractBalanceDecreaseDaoAccountTransferTouchAccountBalanceIncreaseSelfdestructBalanceDecreaseSelfdestructBalanceDecreaseSelfdestructBurnRevert"
var _BalanceChangeReason_index = [...]uint16{0, 24, 54, 84, 109, 138, 173, 194, 218, 244, 269, 290, 315, 342, 369, 400, 419} var _BalanceChangeReason_index = [...]uint16{0, 11, 41, 71, 96, 125, 160, 181, 205, 231, 256, 264, 276, 303, 330, 361, 367}
func (i BalanceChangeReason) String() string { func (i BalanceChangeReason) String() string {
if i >= BalanceChangeReason(len(_BalanceChangeReason_index)-1) { if i >= BalanceChangeReason(len(_BalanceChangeReason_index)-1) {

View file

@ -1,4 +1,4 @@
// Code generated by "stringer -type=GasChangeReason -output gen_gas_change_reason_stringer.go"; DO NOT EDIT. // Code generated by "stringer -type=GasChangeReason -trimprefix=GasChange -output gen_gas_change_reason_stringer.go"; DO NOT EDIT.
package tracing package tracing
@ -32,12 +32,12 @@ func _() {
} }
const ( const (
_GasChangeReason_name_0 = "GasChangeUnspecifiedGasChangeTxInitialBalanceGasChangeTxIntrinsicGasGasChangeTxRefundsGasChangeTxLeftOverReturnedGasChangeCallInitialBalanceGasChangeCallLeftOverReturnedGasChangeCallLeftOverRefundedGasChangeCallContractCreationGasChangeCallContractCreation2GasChangeCallCodeStorageGasChangeCallOpCodeGasChangeCallPrecompiledContractGasChangeCallStorageColdAccessGasChangeCallFailedExecutionGasChangeWitnessContractInitGasChangeWitnessContractCreationGasChangeWitnessCodeChunkGasChangeWitnessContractCollisionCheckGasChangeTxDataFloor" _GasChangeReason_name_0 = "UnspecifiedTxInitialBalanceTxIntrinsicGasTxRefundsTxLeftOverReturnedCallInitialBalanceCallLeftOverReturnedCallLeftOverRefundedCallContractCreationCallContractCreation2CallCodeStorageCallOpCodeCallPrecompiledContractCallStorageColdAccessCallFailedExecutionWitnessContractInitWitnessContractCreationWitnessCodeChunkWitnessContractCollisionCheckTxDataFloor"
_GasChangeReason_name_1 = "GasChangeIgnored" _GasChangeReason_name_1 = "Ignored"
) )
var ( 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} _GasChangeReason_index_0 = [...]uint16{0, 11, 27, 41, 50, 68, 86, 106, 126, 146, 167, 182, 192, 215, 236, 255, 274, 297, 313, 342, 353}
) )
func (i GasChangeReason) String() string { func (i GasChangeReason) String() string {

View file

@ -0,0 +1,29 @@
// Code generated by "stringer -type=NonceChangeReason -trimprefix NonceChange -output gen_nonce_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[NonceChangeUnspecified-0]
_ = x[NonceChangeGenesis-1]
_ = x[NonceChangeEoACall-2]
_ = x[NonceChangeContractCreator-3]
_ = x[NonceChangeNewContract-4]
_ = x[NonceChangeAuthorization-5]
_ = x[NonceChangeRevert-6]
}
const _NonceChangeReason_name = "UnspecifiedGenesisEoACallContractCreatorNewContractAuthorizationRevert"
var _NonceChangeReason_index = [...]uint8{0, 11, 18, 25, 40, 51, 64, 70}
func (i NonceChangeReason) String() string {
if i >= NonceChangeReason(len(_NonceChangeReason_index)-1) {
return "NonceChangeReason(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _NonceChangeReason_name[_NonceChangeReason_index[i]:_NonceChangeReason_index[i+1]]
}

View file

@ -221,7 +221,7 @@ type Hooks struct {
// for tracing and reporting. // for tracing and reporting.
type BalanceChangeReason byte type BalanceChangeReason byte
//go:generate go run golang.org/x/tools/cmd/stringer -type=BalanceChangeReason -output gen_balance_change_reason_stringer.go //go:generate go run golang.org/x/tools/cmd/stringer -type=BalanceChangeReason -trimprefix=BalanceChange -output gen_balance_change_reason_stringer.go
const ( const (
BalanceChangeUnspecified BalanceChangeReason = 0 BalanceChangeUnspecified BalanceChangeReason = 0
@ -282,7 +282,7 @@ 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 //go:generate go run golang.org/x/tools/cmd/stringer -type=GasChangeReason -trimprefix=GasChange -output gen_gas_change_reason_stringer.go
const ( const (
GasChangeUnspecified GasChangeReason = 0 GasChangeUnspecified GasChangeReason = 0
@ -348,6 +348,8 @@ const (
// NonceChangeReason is used to indicate the reason for a nonce change. // NonceChangeReason is used to indicate the reason for a nonce change.
type NonceChangeReason byte type NonceChangeReason byte
//go:generate go run golang.org/x/tools/cmd/stringer -type=NonceChangeReason -trimprefix NonceChange -output gen_nonce_change_reason_stringer.go
const ( const (
NonceChangeUnspecified NonceChangeReason = 0 NonceChangeUnspecified NonceChangeReason = 0