policy: Allow to update contract #83
1 changed files with 0 additions and 20 deletions
|
@ -94,26 +94,6 @@ func _deploy(data any, isUpdate bool) {
|
|||
if isUpdate {
|
||||
args := data.([]any)
|
||||
common.CheckVersion(args[len(args)-1].(int))
|
||||
|
||||
it := storage.Find(ctx, []byte{}, storage.None)
|
||||
for iterator.Next(it) {
|
||||
item := iterator.Value(it).(struct {
|
||||
key []byte
|
||||
value []byte
|
||||
})
|
||||
|
||||
// Migrate container.
|
||||
if len(item.key) == containerIDSize {
|
||||
storage.Delete(ctx, item.key)
|
||||
storage.Put(ctx, append([]byte{containerKeyPrefix}, item.key...), item.value)
|
||||
}
|
||||
|
||||
// Migrate owner-cid map.
|
||||
if len(item.key) == 25 /* owner id size */ +containerIDSize {
|
||||
storage.Delete(ctx, item.key)
|
||||
storage.Put(ctx, append([]byte{ownerKeyPrefix}, item.key...), item.value)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue