[#200] nns: Provide additional data in Update

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-12-10 13:40:20 +03:00 committed by Alex Vanin
parent d78edb66db
commit 8718e146c9

View file

@ -76,14 +76,15 @@ type RecordState struct {
}
// Update updates NameService contract.
func Update(nef []byte, manifest string) {
func Update(nef []byte, manifest string, data interface{}) {
checkCommittee()
// Calculating keys and serializing requires calling
// 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(nil))
contract.All, nef, manifest, common.AppendVersion(data))
runtime.Log("nns contract updated")
}
// _deploy initializes defaults (total supply and registration price) on contract deploy.