forked from TrueCloudLab/frostfs-contract
[#231] Remove previous contract update code
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
e9cfe6194f
commit
2b624a38cc
2 changed files with 0 additions and 46 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue