forked from TrueCloudLab/frostfs-contract
[#100] *: Use full scope in migration
As soon as migration required changes in memory, we need bigger scope. Otherwise in requires two step migration which is unpleasant and annoying. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
da56f4b53e
commit
af21f33657
8 changed files with 13 additions and 9 deletions
|
@ -82,7 +82,7 @@ func Migrate(script []byte, manifest []byte, data interface{}) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
management.UpdateWithData(script, manifest, data)
|
||||
contract.Call(interop.Hash160(management.Hash), "update", contract.All, script, manifest, data)
|
||||
runtime.Log("alphabet contract updated")
|
||||
|
||||
return true
|
||||
|
|
|
@ -2,6 +2,7 @@ package auditcontract
|
|||
|
||||
import (
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/contract"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/iterator"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/crypto"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/management"
|
||||
|
@ -82,7 +83,7 @@ func Migrate(script []byte, manifest []byte, data interface{}) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
management.UpdateWithData(script, manifest, data)
|
||||
contract.Call(interop.Hash160(management.Hash), "update", contract.All, script, manifest, data)
|
||||
runtime.Log("audit contract updated")
|
||||
|
||||
return true
|
||||
|
|
|
@ -2,6 +2,7 @@ package balancecontract
|
|||
|
||||
import (
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/contract"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/iterator"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/management"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/std"
|
||||
|
@ -101,7 +102,7 @@ func Migrate(script []byte, manifest []byte, data interface{}) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
management.UpdateWithData(script, manifest, data)
|
||||
contract.Call(interop.Hash160(management.Hash), "update", contract.All, script, manifest, data)
|
||||
runtime.Log("balance contract updated")
|
||||
|
||||
return true
|
||||
|
|
|
@ -138,7 +138,7 @@ func Migrate(script []byte, manifest []byte, data interface{}) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
management.UpdateWithData(script, manifest, data)
|
||||
contract.Call(interop.Hash160(management.Hash), "update", contract.All, script, manifest, data)
|
||||
runtime.Log("neofs contract updated")
|
||||
|
||||
return true
|
||||
|
|
|
@ -2,6 +2,7 @@ package neofsidcontract
|
|||
|
||||
import (
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/contract"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/crypto"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/management"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/std"
|
||||
|
@ -67,7 +68,7 @@ func Migrate(script []byte, manifest []byte, data interface{}) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
management.UpdateWithData(script, manifest, data)
|
||||
contract.Call(interop.Hash160(management.Hash), "update", contract.All, script, manifest, data)
|
||||
runtime.Log("neofsid contract updated")
|
||||
|
||||
return true
|
||||
|
|
|
@ -120,7 +120,7 @@ func Migrate(script []byte, manifest []byte, data interface{}) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
management.UpdateWithData(script, manifest, data)
|
||||
contract.Call(interop.Hash160(management.Hash), "update", contract.All, script, manifest, data)
|
||||
runtime.Log("netmap contract updated")
|
||||
|
||||
return true
|
||||
|
|
|
@ -58,7 +58,7 @@ func Migrate(script []byte, manifest []byte, data interface{}) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
management.UpdateWithData(script, manifest, data)
|
||||
contract.Call(interop.Hash160(management.Hash), "update", contract.All, script, manifest, data)
|
||||
runtime.Log("processing contract updated")
|
||||
|
||||
return true
|
||||
|
|
|
@ -2,6 +2,7 @@ package proxycontract
|
|||
|
||||
import (
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/contract"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/gas"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/management"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/neo"
|
||||
|
@ -56,7 +57,7 @@ func Migrate(script []byte, manifest []byte, data interface{}) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
management.UpdateWithData(script, manifest, data)
|
||||
contract.Call(interop.Hash160(management.Hash), "update", contract.All, script, manifest, data)
|
||||
runtime.Log("proxy contract updated")
|
||||
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue