forked from TrueCloudLab/frostfs-node
41eaa1e246
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>
44 lines
608 B
Go
44 lines
608 B
Go
package subnetevents
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
subnetid "github.com/nspcc-dev/neofs-sdk-go/subnet/id"
|
|
)
|
|
|
|
type delete struct {
|
|
idEvent
|
|
}
|
|
|
|
func TestDeleteValidator_Assert(t *testing.T) {
|
|
var (
|
|
v DeleteValidator
|
|
|
|
e delete
|
|
|
|
err error
|
|
)
|
|
|
|
// read ID error
|
|
e.idErr = errors.New("id err")
|
|
|
|
err = v.Assert(e)
|
|
require.ErrorIs(t, err, e.idErr)
|
|
|
|
e.idErr = nil
|
|
|
|
// zero subnet ID
|
|
subnetid.MakeZero(&e.id)
|
|
|
|
err = v.Assert(e)
|
|
require.ErrorAs(t, err, new(zeroSubnetOp))
|
|
|
|
const idNum = 13
|
|
e.id.SetNumber(idNum)
|
|
|
|
err = v.Assert(e)
|
|
require.NoError(t, err)
|
|
}
|