forked from TrueCloudLab/frostfs-contract
[#185] *: Cast args of _deploy
method to struct
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
b2559857f6
commit
f78a0e32b8
10 changed files with 114 additions and 104 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue