From cb2559f590f3261807225b61cc634fb272c9fb16 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 15 Jun 2021 15:31:47 +0300 Subject: [PATCH] [#92] container: Remove migration code Signed-off-by: Alex Vanin --- container/container_contract.go | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/container/container_contract.go b/container/container_contract.go index ec93703..9fe1215 100644 --- a/container/container_contract.go +++ b/container/container_contract.go @@ -67,7 +67,6 @@ func _deploy(data interface{}, isUpdate bool) { ctx := storage.GetContext() if isUpdate { - migrateContainerAndEACLStructures(ctx) // from v0.8.0 to v0.9.0 return } @@ -101,34 +100,6 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log("container contract initialized") } -func migrateContainerAndEACLStructures(ctx storage.Context) { - eACLKeyLength := containerIDSize + len(eACLPrefix) - - it := storage.Find(ctx, []byte{}, storage.None) - for iterator.Next(it) { - pair := iterator.Value(it).([]interface{}) - key := pair[0].([]byte) - - switch len(key) { - case containerIDSize: // migrate containers - val := pair[1].([]byte) - newContainer := Container{value: val} - - common.SetSerialized(ctx, key, newContainer) - case eACLKeyLength: // migrate eACLs - val := pair[1].([]byte) - eacl := std.Deserialize(val).(ExtendedACL) - newEACL := ExtendedACL{ - value: eacl.value, - sig: eacl.sig, - pub: eacl.pub, - } - - common.SetSerialized(ctx, key, newEACL) - } - } -} - func Migrate(script []byte, manifest []byte, data interface{}) bool { ctx := storage.GetReadOnlyContext()