Skip to content

Commit

Permalink
Log transaction hash with %s instead of %x
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nkuba committed Jun 1, 2021
1 parent 0d4f5d5 commit 95486cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tools/generators/ethlike/contract_non_const_methods.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) {{$method.CapsName}}(
}

{{$logger}}.Infof(
"submitted transaction {{$method.LowerName}} with id: [%v] and nonce [%v]",
transaction.Hash().Hex(),
"submitted transaction {{$method.LowerName}} with id: [%s] and nonce [%v]",
transaction.Hash(),
transaction.Nonce(),
)

Expand Down Expand Up @@ -101,8 +101,8 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) {{$method.CapsName}}(
}

{{$logger}}.Infof(
"submitted transaction {{$method.LowerName}} with id: [%v] and nonce [%v]",
transaction.Hash().Hex(),
"submitted transaction {{$method.LowerName}} with id: [%s] and nonce [%v]",
transaction.Hash(),
transaction.Nonce(),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) {{$method.CapsName}}(
}
{{$logger}}.Infof(
"submitted transaction {{$method.LowerName}} with id: [%v] and nonce [%v]",
transaction.Hash().Hex(),
"submitted transaction {{$method.LowerName}} with id: [%s] and nonce [%v]",
transaction.Hash(),
transaction.Nonce(),
)
Expand Down Expand Up @@ -104,8 +104,8 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) {{$method.CapsName}}(
}
{{$logger}}.Infof(
"submitted transaction {{$method.LowerName}} with id: [%v] and nonce [%v]",
transaction.Hash().Hex(),
"submitted transaction {{$method.LowerName}} with id: [%s] and nonce [%v]",
transaction.Hash(),
transaction.Nonce(),
)
Expand Down

0 comments on commit 95486cf

Please sign in to comment.