From 33d556851120b311b972a558a659e99e323b4480 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 28 Mar 2022 09:48:56 +0300 Subject: [PATCH] [#234] *: Fix some lint issues Signed-off-by: Evgenii Stratonikov --- alphabet/alphabet_contract.go | 2 -- netmap/netmap_contract.go | 1 - nns/nns_contract.go | 33 --------------------------------- tests/nns_test.go | 4 ++-- 4 files changed, 2 insertions(+), 38 deletions(-) diff --git a/alphabet/alphabet_contract.go b/alphabet/alphabet_contract.go index 4ec41f2..8527683 100644 --- a/alphabet/alphabet_contract.go +++ b/alphabet/alphabet_contract.go @@ -238,8 +238,6 @@ func Vote(epoch int, candidates []interop.PublicKey) { } else { runtime.Log(name + ": vote has been failed") } - - return } func voteID(epoch interface{}, args []interop.PublicKey) []byte { diff --git a/netmap/netmap_contract.go b/netmap/netmap_contract.go index 3457505..6f04593 100644 --- a/netmap/netmap_contract.go +++ b/netmap/netmap_contract.go @@ -218,7 +218,6 @@ func AddPeerIR(nodeInfo []byte) { common.CheckAlphabetWitness(common.AlphabetAddress()) addToNetmap(ctx, storageNode{info: nodeInfo}) - return } // AddPeer method adds new candidate to the next network map if it was invoked diff --git a/nns/nns_contract.go b/nns/nns_contract.go index 73d656d..a405eaa 100644 --- a/nns/nns_contract.go +++ b/nns/nns_contract.go @@ -100,39 +100,6 @@ func _deploy(data interface{}, isUpdate bool) { storage.Put(ctx, []byte{prefixRegisterPrice}, defaultRegisterPrice) } -// remove after v0.13.1 upgrade -func shBEFromLEHex(s string) interop.Hash160 { - res := make([]byte, interop.Hash160Len) - - ln := len(s) / 2 - for i := 0; i < ln; i++ { - a := hexToNum(s[i*2]) - b := hexToNum(s[i*2+1]) - - var n interface{} = a*16 + b - res[ln-1-i] = n.([]byte)[0] - } - - return res -} - -// remove after v0.13.1 upgrade -func hexToNum(s uint8) int { - if s >= '0' && s <= '9' { - return int(s) - 48 - } - - if s >= 'A' && s <= 'F' { - return int(s) - 55 - } - - if s >= 'a' && s <= 'f' { - return int(s) - 87 - } - - panic("invalid hex") -} - // Symbol returns NeoNameService symbol. func Symbol() string { return "NNS" diff --git a/tests/nns_test.go b/tests/nns_test.go index cefc2b1..fd3afd7 100644 --- a/tests/nns_test.go +++ b/tests/nns_test.go @@ -325,8 +325,8 @@ func TestNNSRenew(t *testing.T) { cAcc := c.WithSigners(acc) cAcc.Invoke(t, ts, "renew", "testdomain.com") expected := stackitem.NewMapWithValue([]stackitem.MapElement{ - {stackitem.Make("name"), stackitem.Make("testdomain.com")}, - {stackitem.Make("expiration"), stackitem.Make(ts)}}) + {Key: stackitem.Make("name"), Value: stackitem.Make("testdomain.com")}, + {Key: stackitem.Make("expiration"), Value: stackitem.Make(ts)}}) cAcc.Invoke(t, expected, "properties", "testdomain.com") }