From b0872bb54c6b838f5ec09996cebaf1dc4d8c47dd Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 1 Feb 2022 11:36:18 +0300 Subject: [PATCH] *: remove update migration code Signed-off-by: Evgenii Stratonikov --- alphabet/alphabet_contract.go | 1 - audit/audit_contract.go | 1 - balance/balance_contract.go | 1 - neofs/neofs_contract.go | 18 ++---------------- neofsid/neofsid_contract.go | 1 - netmap/netmap_contract.go | 1 - proxy/proxy_contract.go | 3 --- reputation/reputation_contract.go | 2 -- subnet/subnet_contract.go | 4 ++-- 9 files changed, 4 insertions(+), 28 deletions(-) diff --git a/alphabet/alphabet_contract.go b/alphabet/alphabet_contract.go index 7a95c74..d015c6d 100644 --- a/alphabet/alphabet_contract.go +++ b/alphabet/alphabet_contract.go @@ -37,7 +37,6 @@ func _deploy(data interface{}, isUpdate bool) { if isUpdate { args := data.([]interface{}) common.CheckVersion(args[len(args)-1].(int)) - storage.Delete(ctx, common.LegacyOwnerKey) return } diff --git a/audit/audit_contract.go b/audit/audit_contract.go index 157dc7a..8c21433 100644 --- a/audit/audit_contract.go +++ b/audit/audit_contract.go @@ -47,7 +47,6 @@ func _deploy(data interface{}, isUpdate bool) { if isUpdate { args := data.([]interface{}) common.CheckVersion(args[len(args)-1].(int)) - storage.Delete(ctx, common.LegacyOwnerKey) return } diff --git a/balance/balance_contract.go b/balance/balance_contract.go index 8c53079..04c58fd 100644 --- a/balance/balance_contract.go +++ b/balance/balance_contract.go @@ -63,7 +63,6 @@ func _deploy(data interface{}, isUpdate bool) { if isUpdate { args := data.([]interface{}) common.CheckVersion(args[len(args)-1].(int)) - storage.Delete(ctx, common.LegacyOwnerKey) return } diff --git a/neofs/neofs_contract.go b/neofs/neofs_contract.go index 50a930b..2cbfedc 100644 --- a/neofs/neofs_contract.go +++ b/neofs/neofs_contract.go @@ -47,22 +47,8 @@ var ( // _deploy sets up initial alphabet node keys. func _deploy(data interface{}, isUpdate bool) { if isUpdate { - // TODO(@fyrchik): restore after mainnet update - // args := data.([]interface{}) - // common.CheckVersion(args[len(args)-1].(int)) - - ctx := storage.GetContext() - - // TODO(@fyrchik): remove after mainnet update - storage.Delete(ctx, common.LegacyOwnerKey) - - nodes := getNodes(ctx, candidatesKey) - storage.Delete(ctx, candidatesKey) - - for i := range nodes { - key := append([]byte(candidatesKey), nodes[i].PublicKey...) - storage.Put(ctx, key, []byte{1}) - } + args := data.([]interface{}) + common.CheckVersion(args[len(args)-1].(int)) return } diff --git a/neofsid/neofsid_contract.go b/neofsid/neofsid_contract.go index 4720c00..68ab905 100644 --- a/neofsid/neofsid_contract.go +++ b/neofsid/neofsid_contract.go @@ -34,7 +34,6 @@ func _deploy(data interface{}, isUpdate bool) { if isUpdate { args := data.([]interface{}) common.CheckVersion(args[len(args)-1].(int)) - storage.Delete(ctx, common.LegacyOwnerKey) return } diff --git a/netmap/netmap_contract.go b/netmap/netmap_contract.go index 4cd36be..a7e3bf6 100644 --- a/netmap/netmap_contract.go +++ b/netmap/netmap_contract.go @@ -85,7 +85,6 @@ func _deploy(data interface{}, isUpdate bool) { if isUpdate { common.CheckVersion(args.version) - storage.Delete(ctx, common.LegacyOwnerKey) return } diff --git a/proxy/proxy_contract.go b/proxy/proxy_contract.go index fe357a7..77e1cb3 100644 --- a/proxy/proxy_contract.go +++ b/proxy/proxy_contract.go @@ -7,7 +7,6 @@ import ( "github.com/nspcc-dev/neo-go/pkg/interop/native/management" "github.com/nspcc-dev/neo-go/pkg/interop/native/neo" "github.com/nspcc-dev/neo-go/pkg/interop/runtime" - "github.com/nspcc-dev/neo-go/pkg/interop/storage" "github.com/nspcc-dev/neofs-contract/common" ) @@ -21,10 +20,8 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { func _deploy(data interface{}, isUpdate bool) { if isUpdate { - ctx := storage.GetContext() args := data.([]interface{}) common.CheckVersion(args[len(args)-1].(int)) - storage.Delete(ctx, common.LegacyOwnerKey) return } diff --git a/reputation/reputation_contract.go b/reputation/reputation_contract.go index a645959..27751d0 100644 --- a/reputation/reputation_contract.go +++ b/reputation/reputation_contract.go @@ -23,8 +23,6 @@ func _deploy(data interface{}, isUpdate bool) { if isUpdate { args := data.([]interface{}) common.CheckVersion(args[len(args)-1].(int)) - - storage.Delete(ctx, []byte("contractOwner")) return } diff --git a/subnet/subnet_contract.go b/subnet/subnet_contract.go index 3827d3d..cd4bcad 100644 --- a/subnet/subnet_contract.go +++ b/subnet/subnet_contract.go @@ -58,8 +58,8 @@ const ( // _deploy function sets up initial list of inner ring public keys. func _deploy(data interface{}, isUpdate bool) { if isUpdate { - //args := data.([]interface{}) - //common.CheckVersion(args[len(args)-1].(int)) + args := data.([]interface{}) + common.CheckVersion(args[len(args)-1].(int)) return }