[#185] *: Cast args of _deploy method to struct

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-11-29 19:34:11 +03:00 committed by Alex Vanin
parent b2559857f6
commit f78a0e32b8
10 changed files with 114 additions and 104 deletions

View file

@ -31,16 +31,17 @@ func _deploy(data interface{}, isUpdate bool) {
return
}
arr := data.([]interop.Hash160)
addrNeoFS := arr[0]
args := data.(struct {
addrNeoFS interop.Hash160
})
ctx := storage.GetContext()
if len(addrNeoFS) != 20 {
if len(args.addrNeoFS) != 20 {
panic("incorrect length of contract script hash")
}
storage.Put(ctx, neofsContractKey, addrNeoFS)
storage.Put(ctx, neofsContractKey, args.addrNeoFS)
runtime.Log("processing contract initialized")
}