forked from TrueCloudLab/frostfs-node
[#973] ir: Listen and process Put/Delete events of Subnet contract
Define notification events, implement parsers. Add morph client of Subnet contract. Listen, verify and approve events in Inner Ring app. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
214c2bd0cb
commit
41eaa1e246
22 changed files with 1278 additions and 12 deletions
22
pkg/innerring/processors/subnet/common.go
Normal file
22
pkg/innerring/processors/subnet/common.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package subnetevents
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
subnetid "github.com/nspcc-dev/neofs-sdk-go/subnet/id"
|
||||
)
|
||||
|
||||
// common interface of subnet notifications with subnet ID.
|
||||
type eventWithID interface {
|
||||
// ReadID reads identifier of the subnet.
|
||||
ReadID(*subnetid.ID) error
|
||||
}
|
||||
|
||||
// an error which is returned on zero subnet operation attempt.
|
||||
type zeroSubnetOp struct {
|
||||
op string
|
||||
}
|
||||
|
||||
func (x zeroSubnetOp) Error() string {
|
||||
return fmt.Sprintf("zero subnet %s", x.op)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue