-
Notifications
You must be signed in to change notification settings - Fork 20.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core/tracing: stringer for gas and nonce change reasons #31234
base: master
Are you sure you want to change the base?
core/tracing: stringer for gas and nonce change reasons #31234
Conversation
This follows the same pattern as for `tracing.BalanceChangeReason`.
While you're at it can you add nonce change reason too? :) |
core/tracing/hooks.go
Outdated
@@ -282,6 +282,8 @@ const ( | |||
// once per transaction, while those that start with `GasChangeCall` are emitted on a call basis. | |||
type GasChangeReason byte | |||
|
|||
//go:generate go run golang.org/x/tools/cmd/stringer -type=GasChangeReason -output gen_gas_change_reason_stringer.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using -trimprefix GasChange
here. I think it will improve the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I apply to all others too (NonceChange & BalanceChange)?
Sure thing @s1na |
I've applied |
Hello |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
tracing.GasChangeReason
enum
Note: this PR will change the string output for balance change reasons. But nobody should be using that for their logic code instead of the enum. I really hope nobody is actually doing that. This is giving me second thought about exposing a string version tbh. |
This follows the same pattern as for
tracing.BalanceChangeReason
.