Skip to content

Commit 95486cf

Browse files
committed
Log transaction hash with %s instead of %x
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
1 parent 0d4f5d5 commit 95486cf

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

tools/generators/ethlike/contract_non_const_methods.go.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) {{$method.CapsName}}(
6868
}
6969

7070
{{$logger}}.Infof(
71-
"submitted transaction {{$method.LowerName}} with id: [%v] and nonce [%v]",
72-
transaction.Hash().Hex(),
71+
"submitted transaction {{$method.LowerName}} with id: [%s] and nonce [%v]",
72+
transaction.Hash(),
7373
transaction.Nonce(),
7474
)
7575

@@ -101,8 +101,8 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) {{$method.CapsName}}(
101101
}
102102

103103
{{$logger}}.Infof(
104-
"submitted transaction {{$method.LowerName}} with id: [%v] and nonce [%v]",
105-
transaction.Hash().Hex(),
104+
"submitted transaction {{$method.LowerName}} with id: [%s] and nonce [%v]",
105+
transaction.Hash(),
106106
transaction.Nonce(),
107107
)
108108

tools/generators/ethlike/contract_non_const_methods_template_content.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) {{$method.CapsName}}(
7171
}
7272
7373
{{$logger}}.Infof(
74-
"submitted transaction {{$method.LowerName}} with id: [%v] and nonce [%v]",
75-
transaction.Hash().Hex(),
74+
"submitted transaction {{$method.LowerName}} with id: [%s] and nonce [%v]",
75+
transaction.Hash(),
7676
transaction.Nonce(),
7777
)
7878
@@ -104,8 +104,8 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) {{$method.CapsName}}(
104104
}
105105
106106
{{$logger}}.Infof(
107-
"submitted transaction {{$method.LowerName}} with id: [%v] and nonce [%v]",
108-
transaction.Hash().Hex(),
107+
"submitted transaction {{$method.LowerName}} with id: [%s] and nonce [%v]",
108+
transaction.Hash(),
109109
transaction.Nonce(),
110110
)
111111

0 commit comments

Comments
 (0)