From 2b624a38ccdc56b28d9280f740ce9db46f48a9f7 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Wed, 23 Mar 2022 13:41:42 +0300 Subject: [PATCH] [#231] Remove previous contract update code Signed-off-by: Alex Vanin --- container/container_contract.go | 15 --------------- nns/nns_contract.go | 31 ------------------------------- 2 files changed, 46 deletions(-) diff --git a/container/container_contract.go b/container/container_contract.go index 5502bbc..596d88b 100644 --- a/container/container_contract.go +++ b/container/container_contract.go @@ -93,21 +93,6 @@ func _deploy(data interface{}, isUpdate bool) { if isUpdate { args := data.([]interface{}) common.CheckVersion(args[len(args)-1].(int)) - storage.Delete(ctx, common.LegacyOwnerKey) - - // Migrate container estimation keys. - it := storage.Find(ctx, []byte(estimateKeyPrefix), storage.DeserializeValues) - for iterator.Next(it) { - kv := iterator.Value(it).(struct { - key []byte - value estimation - }) - - end := len(kv.key) - containerIDSize - estimatePostfixSize - rawEpoch := kv.key[len(estimateKeyPrefix):end] - cid := kv.key[end : len(kv.key)-estimatePostfixSize] - updateEstimations(ctx, convert.ToInteger(rawEpoch), cid, kv.value.from, true) - } return } diff --git a/nns/nns_contract.go b/nns/nns_contract.go index 6abccb0..73d656d 100644 --- a/nns/nns_contract.go +++ b/nns/nns_contract.go @@ -92,37 +92,6 @@ func _deploy(data interface{}, isUpdate bool) { if isUpdate { args := data.([]interface{}) common.CheckVersion(args[len(args)-1].(int)) - - if runtime.GetNetwork() == 0x572dfa5 { - // Some of the domains in mainnet have duplicate SOA records. - // One is stored by key with id 0, and the other with id []byte{0, 0, 0}. - // Delete the latter. Subnet contract is not affected. - ctx := storage.GetContext() - for _, name := range []string{ - "alphabet0.neofs", - "alphabet1.neofs", - "alphabet2.neofs", - "alphabet3.neofs", - "alphabet4.neofs", - "alphabet5.neofs", - "alphabet6.neofs", - "container.neofs", - "reputation.neofs", - "neofsid.neofs", - "balance.neofs", - "netmap.neofs", - "audit.neofs", - } { - tokenID := []byte(tokenIDFromName(name)) - recordsKey := getRecordsKeyByType(tokenID, name, SOA) - oldKey := append(recordsKey, 0, 0, 0) - data := storage.Get(ctx, oldKey) - if data == nil { - panic("unexpected") - } - storage.Delete(ctx, oldKey) - } - } return }