[#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:
parent
df6cc4f8b7
commit
840e206963
2 changed files with 9 additions and 2 deletions
|
@ -5,8 +5,13 @@ permissions:
|
||||||
events:
|
events:
|
||||||
- name: SubnetPut
|
- name: SubnetPut
|
||||||
parameters:
|
parameters:
|
||||||
|
- name: id
|
||||||
|
type: ByteArray
|
||||||
- name: ownerKey
|
- name: ownerKey
|
||||||
type: PublicKey
|
type: PublicKey
|
||||||
- name: info
|
- name: info
|
||||||
type: ByteArray
|
type: ByteArray
|
||||||
|
- name: SubnetDelete
|
||||||
|
parameters:
|
||||||
|
- name: id
|
||||||
|
type: ByteArray
|
||||||
|
|
|
@ -80,7 +80,7 @@ func Put(id []byte, ownerKey interop.PublicKey, info []byte) {
|
||||||
if !runtime.CheckWitness(ownerKey) {
|
if !runtime.CheckWitness(ownerKey) {
|
||||||
panic("put: witness check failed")
|
panic("put: witness check failed")
|
||||||
}
|
}
|
||||||
runtime.Notify("SubnetPut", ownerKey, info)
|
runtime.Notify("SubnetPut", id, ownerKey, info)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,6 +137,8 @@ func Delete(id []byte) {
|
||||||
|
|
||||||
key[0] = infoPrefix
|
key[0] = infoPrefix
|
||||||
storage.Delete(ctx, key)
|
storage.Delete(ctx, key)
|
||||||
|
|
||||||
|
runtime.Notify("SubnetDelete", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddNodeAdmin adds new node administrator to the specified subnetwork.
|
// AddNodeAdmin adds new node administrator to the specified subnetwork.
|
||||||
|
|
Loading…
Reference in a new issue