From c46c7a17afc7398190a2a5d5ace62059d8faf9eb Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 24 Jan 2022 11:30:03 +0300 Subject: [PATCH] [#220] subnet: append version in `Update` Current contract doesn't provide version in arguments, thus disable check in `_deploy`. Signed-off-by: Evgenii Stratonikov --- subnet/subnet_contract.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/subnet/subnet_contract.go b/subnet/subnet_contract.go index 99c7fc1..3827d3d 100644 --- a/subnet/subnet_contract.go +++ b/subnet/subnet_contract.go @@ -58,8 +58,8 @@ const ( // _deploy function sets up initial list of inner ring public keys. func _deploy(data interface{}, isUpdate bool) { if isUpdate { - args := data.([]interface{}) - common.CheckVersion(args[len(args)-1].(int)) + //args := data.([]interface{}) + //common.CheckVersion(args[len(args)-1].(int)) return } @@ -78,7 +78,8 @@ 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, data) + contract.Call(interop.Hash160(management.Hash), "update", contract.All, + script, manifest, common.AppendVersion(data)) runtime.Log("subnet contract updated") }