diff --git a/container/container_contract.go b/container/container_contract.go index 746859e..17c6734 100644 --- a/container/container_contract.go +++ b/container/container_contract.go @@ -67,8 +67,6 @@ func _deploy(data interface{}, isUpdate bool) { ctx := storage.GetContext() if isUpdate { - migrateContainerLists(ctx) // from v0.9.1 to v0.9.2 - migrateEstimationStorage(ctx) // from v0.9.1 to v0.9.2 return } @@ -102,35 +100,6 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log("container contract initialized") } -func migrateContainerLists(ctx storage.Context) { - const ownersKey = "ownersList" - - containers := getAllContainers(ctx) - for i := range containers { - containerID := containers[i] - ownerID := getOwnerByID(ctx, containerID) - - containerListKey := append(ownerID, containerID...) - storage.Put(ctx, containerListKey, containerID) - - storage.Delete(ctx, ownerID) - } - - storage.Delete(ctx, ownersKey) -} - -func migrateEstimationStorage(ctx storage.Context) { - // In fact, this method does not migrate estimation storage because this data - // is valid only for one epoch. Migration routine will be quite complex, so - // it makes sense to clean all remaining estimations and wait for new one. - - it := storage.Find(ctx, []byte(estimateKeyPrefix), storage.KeysOnly) - for iterator.Next(it) { - key := iterator.Value(it).([]byte) - storage.Delete(ctx, key) - } -} - // Migrate method updates contract source code and manifest. Can be invoked // only by contract owner. func Migrate(script []byte, manifest []byte, data interface{}) bool { diff --git a/netmap/netmap_contract.go b/netmap/netmap_contract.go index c872223..d1c4f41 100644 --- a/netmap/netmap_contract.go +++ b/netmap/netmap_contract.go @@ -65,7 +65,6 @@ func _deploy(data interface{}, isUpdate bool) { ctx := storage.GetContext() if isUpdate { - migrateNetmapCandidates(ctx) // from v0.9.1 to v0.9.2 return } @@ -114,24 +113,6 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log("netmap contract initialized") } -func migrateNetmapCandidates(ctx storage.Context) { - const netmapKey = "netmap" - - data := storage.Get(ctx, netmapKey) - if data == nil { - return - } - - candidates := std.Deserialize(data.([]byte)).([]netmapNode) - - for i := range candidates { - candidate := candidates[i] - addToNetmap(ctx, candidate.node) - } - - storage.Delete(ctx, netmapKey) -} - // Migrate method updates contract source code and manifest. Can be invoked // only by contract owner. func Migrate(script []byte, manifest []byte, data interface{}) bool {