From a94caa5f41e65b264265618824cbf1ac4ed44628 Mon Sep 17 00:00:00 2001 From: protolambda Date: Tue, 3 Dec 2024 13:23:01 +0100 Subject: [PATCH] tracing: fix BalanceChangeReason stringer --- .../gen_balance_change_reason_stringer.go | 18 ++++++++++++++---- fork.yaml | 4 ++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/core/tracing/gen_balance_change_reason_stringer.go b/core/tracing/gen_balance_change_reason_stringer.go index d3a515a12d..891f586715 100644 --- a/core/tracing/gen_balance_change_reason_stringer.go +++ b/core/tracing/gen_balance_change_reason_stringer.go @@ -23,15 +23,25 @@ func _() { _ = x[BalanceIncreaseSelfdestruct-12] _ = x[BalanceDecreaseSelfdestruct-13] _ = x[BalanceDecreaseSelfdestructBurn-14] + _ = x[BalanceMint-200] } -const _BalanceChangeReason_name = "BalanceChangeUnspecifiedBalanceIncreaseRewardMineUncleBalanceIncreaseRewardMineBlockBalanceIncreaseWithdrawalBalanceIncreaseGenesisBalanceBalanceIncreaseRewardTransactionFeeBalanceDecreaseGasBuyBalanceIncreaseGasReturnBalanceIncreaseDaoContractBalanceDecreaseDaoAccountBalanceChangeTransferBalanceChangeTouchAccountBalanceIncreaseSelfdestructBalanceDecreaseSelfdestructBalanceDecreaseSelfdestructBurn" +const ( + _BalanceChangeReason_name_0 = "BalanceChangeUnspecifiedBalanceIncreaseRewardMineUncleBalanceIncreaseRewardMineBlockBalanceIncreaseWithdrawalBalanceIncreaseGenesisBalanceBalanceIncreaseRewardTransactionFeeBalanceDecreaseGasBuyBalanceIncreaseGasReturnBalanceIncreaseDaoContractBalanceDecreaseDaoAccountBalanceChangeTransferBalanceChangeTouchAccountBalanceIncreaseSelfdestructBalanceDecreaseSelfdestructBalanceDecreaseSelfdestructBurn" + _BalanceChangeReason_name_1 = "BalanceMint" +) -var _BalanceChangeReason_index = [...]uint16{0, 24, 54, 84, 109, 138, 173, 194, 218, 244, 269, 290, 315, 342, 369, 400} +var ( + _BalanceChangeReason_index_0 = [...]uint16{0, 24, 54, 84, 109, 138, 173, 194, 218, 244, 269, 290, 315, 342, 369, 400} +) func (i BalanceChangeReason) String() string { - if i >= BalanceChangeReason(len(_BalanceChangeReason_index)-1) { + switch { + case i <= 14: + return _BalanceChangeReason_name_0[_BalanceChangeReason_index_0[i]:_BalanceChangeReason_index_0[i+1]] + case i == 200: + return _BalanceChangeReason_name_1 + default: return "BalanceChangeReason(" + strconv.FormatInt(int64(i), 10) + ")" } - return _BalanceChangeReason_name[_BalanceChangeReason_index[i]:_BalanceChangeReason_index[i+1]] } diff --git a/fork.yaml b/fork.yaml index cf31c24316..9e7c4ea124 100644 --- a/fork.yaml +++ b/fork.yaml @@ -336,6 +336,10 @@ def: # upstream PR: https://github.com/ethereum/go-ethereum/pull/28863/ globs: - "accounts/usbwallet/hub.go" + - title: Code-generation + description: Some code files are auto-generated, based on changes elsewhere. + ignore: + - "core/tracing/gen_balance_change_reason_stringer.go" - title: "Testing" description: Additional or modified tests, not already captured by the above diff ignore: