This repository was archived by the owner on May 22, 2023. It is now read-only.
Log transaction hash as %s instead of %x#803
Merged
beaurancourt merged 7 commits intomasterfrom Jun 21, 2021
Merged
Conversation
nkuba
added a commit
to keep-network/keep-common
that referenced
this pull request
Jun 1, 2021
Hash type implements `String()` function that can be used to log the value with `%s` format. It is a tiny simplification, that we introduce for consistence with `keep-ecdsa` changes provided in keep-network/keep-ecdsa#803
The `Hash` type has dedicated function to convert the value to String. It is converted to hex with `0x` prefix, which seems more consistent for ethereum. In keep-common code genreation we generate the loggers for transaction id with `Hash().Hex()` function which produces `0x` prefixed values. With this change we will be consistent.
The latest version of keep-common has two updates: - adds space between function name and params - logs transaction hash using %s The code in this commit was auto-generated.
4943c55 to
6442299
Compare
| @@ -238,7 +238,7 @@ func (becdsak *BondedECDSAKeep) DistributeERC20Reward( | |||
| ) (*types.Transaction, error) { | |||
| becdsakLogger.Debug( | |||
There was a problem hiding this comment.
Was this written before we started using Debugf? Want to change it or leave it in?
There was a problem hiding this comment.
oh wait this file is generated @_@
beaurancourt
approved these changes
Jun 21, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Hashtype has a dedicated function to convert the value to string.It is converted to hex with the
0xprefix, which seems more consistent for ethereum.In keep-common code generation we generate the loggers for transaction id with
Hash().Hex()function which produces0xprefixed values. (see: https://github.com/keep-network/keep-common/blob/0d4f5d5ec604ac41aa84b9ef8078038d7592fc43/tools/generators/ethlike/contract_non_const_methods.go.tmpl#L72)With this PR we will be more consistent across the logs.