From 0d4f5d5ec604ac41aa84b9ef8078038d7592fc43 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Tue, 1 Jun 2021 16:09:03 +0200 Subject: [PATCH 1/2] Added missing space in the transaction submission message Logged message didn't contain a space between method name and params. We added a space. Sample message that was logged: 2021-06-01T16:03:57.284+0200 DEBUG keep-contract-BondedECDSAKeep submitting transaction submitPublicKeyparams: [49 219 244 160 164 177 151 147 225 55 231 231 13 50 114 78 174 57 148 142 172 39 121 149 129 195 214 68 39 231 163 221 134 243 60 24 160 47 117 146 221 39 240 12 61 223 158 199 217 56 123 186 74 106 19 207 204 16 203 241 234 62 64 254] --- tools/generators/ethlike/contract_non_const_methods.go.tmpl | 4 ++-- .../ethlike/contract_non_const_methods_template_content.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/generators/ethlike/contract_non_const_methods.go.tmpl b/tools/generators/ethlike/contract_non_const_methods.go.tmpl index 508b7788..a8dc4782 100644 --- a/tools/generators/ethlike/contract_non_const_methods.go.tmpl +++ b/tools/generators/ethlike/contract_non_const_methods.go.tmpl @@ -13,13 +13,13 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) {{$method.CapsName}}( {{$logger}}.Debug( "submitting transaction {{$method.LowerName}}", {{if $method.Params -}} - "params: ", + " params: ", fmt.Sprint( {{$method.Params}} ), {{end -}} {{if $method.Payable -}} - "value: ", value, + " value: ", value, {{- end}} ) diff --git a/tools/generators/ethlike/contract_non_const_methods_template_content.go b/tools/generators/ethlike/contract_non_const_methods_template_content.go index 7d4ecb37..0e6c0dbe 100644 --- a/tools/generators/ethlike/contract_non_const_methods_template_content.go +++ b/tools/generators/ethlike/contract_non_const_methods_template_content.go @@ -16,13 +16,13 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) {{$method.CapsName}}( {{$logger}}.Debug( "submitting transaction {{$method.LowerName}}", {{if $method.Params -}} - "params: ", + " params: ", fmt.Sprint( {{$method.Params}} ), {{end -}} {{if $method.Payable -}} - "value: ", value, + " value: ", value, {{- end}} ) From 95486cfa56887e4127e61d59ab4432eea48778b9 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Tue, 1 Jun 2021 16:35:23 +0200 Subject: [PATCH 2/2] 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 https://github.com/keep-network/keep-ecdsa/pull/803 --- .../generators/ethlike/contract_non_const_methods.go.tmpl | 8 ++++---- .../contract_non_const_methods_template_content.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/generators/ethlike/contract_non_const_methods.go.tmpl b/tools/generators/ethlike/contract_non_const_methods.go.tmpl index a8dc4782..1d2473b5 100644 --- a/tools/generators/ethlike/contract_non_const_methods.go.tmpl +++ b/tools/generators/ethlike/contract_non_const_methods.go.tmpl @@ -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(), ) @@ -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(), ) diff --git a/tools/generators/ethlike/contract_non_const_methods_template_content.go b/tools/generators/ethlike/contract_non_const_methods_template_content.go index 0e6c0dbe..c708dcbe 100644 --- a/tools/generators/ethlike/contract_non_const_methods_template_content.go +++ b/tools/generators/ethlike/contract_non_const_methods_template_content.go @@ -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(), ) @@ -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(), )