[#200] nns: Provide additional `data` in `Update`

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
remotes/1719294689397494012/tmp_refs/heads/v0.14.1-hotfix
Pavel Karpy 2021-12-10 13:40:20 +03:00 committed by Alex Vanin
parent d78edb66db
commit 8718e146c9
1 changed files with 3 additions and 2 deletions

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.