From 710db9a278dddd822f8cc22a30c3d53b050beafe Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 5 Oct 2023 09:32:51 +0800 Subject: [PATCH] fix gosec --- x/cronos/keeper/precompiles/relayer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/cronos/keeper/precompiles/relayer.go b/x/cronos/keeper/precompiles/relayer.go index 722eb5eb20..eaea4e7d36 100644 --- a/x/cronos/keeper/precompiles/relayer.go +++ b/x/cronos/keeper/precompiles/relayer.go @@ -44,10 +44,10 @@ func init() { if err := irelayerABI.UnmarshalJSON([]byte(relayer.RelayerFunctionsMetaData.ABI)); err != nil { panic(err) } - for methodName := range irelayerABI.Methods { + for _, method := range irelayerABI.Methods { var methodID [4]byte - copy(methodID[:], irelayerABI.Methods[methodName].ID[:4]) - switch methodName { + copy(methodID[:], irelayerABI.Methods[method.Name].ID[:4]) + switch method.Name { case CreateClient: relayerGasRequiredByMethod[methodID] = 200000 case RecvPacket, Acknowledgement: