[#174] subnet: Fix notification

Add notification to the `Delete` method and
add subnet ID to the `Put` notification.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-11-22 15:19:33 +03:00 committed by LeL
parent df6cc4f8b7
commit 840e206963
2 changed files with 9 additions and 2 deletions

View file

@ -5,8 +5,13 @@ permissions:
events:
- name: SubnetPut
parameters:
- name: id
type: ByteArray
- name: ownerKey
type: PublicKey
- name: info
type: ByteArray
- name: SubnetDelete
parameters:
- name: id
type: ByteArray

View file

@ -80,7 +80,7 @@ func Put(id []byte, ownerKey interop.PublicKey, info []byte) {
if !runtime.CheckWitness(ownerKey) {
panic("put: witness check failed")
}
runtime.Notify("SubnetPut", ownerKey, info)
runtime.Notify("SubnetPut", id, ownerKey, info)
return
}
@ -137,6 +137,8 @@ func Delete(id []byte) {
key[0] = infoPrefix
storage.Delete(ctx, key)
runtime.Notify("SubnetDelete", id)
}
// AddNodeAdmin adds new node administrator to the specified subnetwork.