[#10] Use UpdateWithData call wrapper in Update methods
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
2da0ff5750
commit
bcf22c50a1
11 changed files with 11 additions and 28 deletions
|
@ -72,8 +72,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
|
|||
panic("only committee can update contract")
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, script, manifest, common.AppendVersion(data))
|
||||
management.UpdateWithData(script, manifest, common.AppendVersion(data))
|
||||
runtime.Log("alphabet contract updated")
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package audit
|
|||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-contract/common"
|
||||
"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"
|
||||
|
@ -75,8 +74,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
|
|||
panic("only committee can update contract")
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, script, manifest, common.AppendVersion(data))
|
||||
management.UpdateWithData(script, manifest, common.AppendVersion(data))
|
||||
runtime.Log("audit contract updated")
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package balance
|
|||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-contract/common"
|
||||
"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"
|
||||
|
@ -93,8 +92,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
|
|||
panic("only committee can update contract")
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, script, manifest, common.AppendVersion(data))
|
||||
management.UpdateWithData(script, manifest, common.AppendVersion(data))
|
||||
runtime.Log("balance contract updated")
|
||||
}
|
||||
|
||||
|
|
|
@ -171,8 +171,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
|
|||
panic("only committee can update contract")
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, script, manifest, common.AppendVersion(data))
|
||||
management.UpdateWithData(script, manifest, common.AppendVersion(data))
|
||||
runtime.Log("container contract updated")
|
||||
}
|
||||
|
||||
|
|
|
@ -109,8 +109,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
|
|||
panic(common.ErrAlphabetWitnessFailed)
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, script, manifest, common.AppendVersion(data))
|
||||
management.UpdateWithData(script, manifest, common.AppendVersion(data))
|
||||
runtime.Log("frostfs contract updated")
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package frostfsid
|
|||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-contract/common"
|
||||
"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/runtime"
|
||||
|
@ -62,8 +61,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
|
|||
panic("only committee can update contract")
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, script, manifest, common.AppendVersion(data))
|
||||
management.UpdateWithData(script, manifest, common.AppendVersion(data))
|
||||
runtime.Log("frostfsid contract updated")
|
||||
}
|
||||
|
||||
|
|
|
@ -127,8 +127,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
|
|||
panic("only committee can update contract")
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, script, manifest, common.AppendVersion(data))
|
||||
management.UpdateWithData(script, manifest, common.AppendVersion(data))
|
||||
runtime.Log("netmap contract updated")
|
||||
}
|
||||
|
||||
|
|
|
@ -82,8 +82,7 @@ func Update(nef []byte, manifest string, data interface{}) {
|
|||
// std and crypto contracts. This can be helpful on update
|
||||
// thus we provide `AllowCall` to management.Update.
|
||||
// management.Update(nef, []byte(manifest))
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, nef, manifest, common.AppendVersion(data))
|
||||
management.UpdateWithData(nef, []byte(manifest), common.AppendVersion(data))
|
||||
runtime.Log("nns contract updated")
|
||||
}
|
||||
|
||||
|
|
|
@ -59,8 +59,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
|
|||
panic("only side chain committee can update contract")
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, script, manifest, common.AppendVersion(data))
|
||||
management.UpdateWithData(script, manifest, common.AppendVersion(data))
|
||||
runtime.Log("processing contract updated")
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package proxy
|
|||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-contract/common"
|
||||
"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"
|
||||
|
@ -35,8 +34,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
|
|||
panic("only committee can update contract")
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, script, manifest, common.AppendVersion(data))
|
||||
management.UpdateWithData(script, manifest, common.AppendVersion(data))
|
||||
runtime.Log("proxy contract updated")
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@ package reputation
|
|||
|
||||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-contract/common"
|
||||
"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/convert"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/iterator"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/management"
|
||||
|
@ -36,8 +34,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
|
|||
panic("only committee can update contract")
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, script, manifest, common.AppendVersion(data))
|
||||
management.UpdateWithData(script, manifest, common.AppendVersion(data))
|
||||
runtime.Log("reputation contract updated")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue