forked from TrueCloudLab/frostfs-node
[#1637] go.mod: Update neo-go to v0.99.1
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
71fd86f220
commit
07465849a4
45 changed files with 140 additions and 143 deletions
|
@ -3,7 +3,7 @@ package balance
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -46,7 +46,7 @@ func (l Lock) Until() int64 { return l.until }
|
|||
func (l Lock) TxHash() util.Uint256 { return l.txHash }
|
||||
|
||||
// ParseLock from notification into lock structure.
|
||||
func ParseLock(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseLock(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev Lock
|
||||
err error
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -102,8 +101,8 @@ func TestParseLock(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *subscriptions.NotificationEvent {
|
||||
return &subscriptions.NotificationEvent{
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *state.ContainedNotificationEvent {
|
||||
return &state.ContainedNotificationEvent{
|
||||
NotificationEvent: state.NotificationEvent{
|
||||
Item: stackitem.NewArray(items),
|
||||
},
|
||||
|
|
|
@ -3,8 +3,8 @@ package container
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
)
|
||||
|
@ -46,7 +46,7 @@ const expectedItemNumDelete = 3
|
|||
// ParseDelete from notification into container event structure.
|
||||
//
|
||||
// Expects 3 stack items.
|
||||
func ParseDelete(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseDelete(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev Delete
|
||||
err error
|
||||
|
|
|
@ -3,8 +3,8 @@ package container
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
)
|
||||
|
@ -58,7 +58,7 @@ const expectedItemNumEACL = 4
|
|||
// ParseSetEACL parses SetEACL notification event from list of stack items.
|
||||
//
|
||||
// Expects 4 stack items.
|
||||
func ParseSetEACL(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseSetEACL(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev SetEACL
|
||||
err error
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -86,8 +85,8 @@ func TestParseEACL(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *subscriptions.NotificationEvent {
|
||||
return &subscriptions.NotificationEvent{
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *state.ContainedNotificationEvent {
|
||||
return &state.ContainedNotificationEvent{
|
||||
NotificationEvent: state.NotificationEvent{
|
||||
Item: stackitem.NewArray(items),
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@ package container
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -34,7 +34,7 @@ func (s StartEstimation) Epoch() uint64 { return s.epoch }
|
|||
func (s StopEstimation) Epoch() uint64 { return s.epoch }
|
||||
|
||||
// ParseStartEstimation from notification into container event structure.
|
||||
func ParseStartEstimation(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseStartEstimation(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
params, err := event.ParseStackArray(e)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not parse stack items from notify event: %w", err)
|
||||
|
@ -49,7 +49,7 @@ func ParseStartEstimation(e *subscriptions.NotificationEvent) (event.Event, erro
|
|||
}
|
||||
|
||||
// ParseStopEstimation from notification into container event structure.
|
||||
func ParseStopEstimation(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseStopEstimation(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
params, err := event.ParseStackArray(e)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not parse stack items from notify event: %w", err)
|
||||
|
|
|
@ -3,8 +3,8 @@ package container
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
)
|
||||
|
@ -65,7 +65,7 @@ func (x PutNamed) Zone() string {
|
|||
}
|
||||
|
||||
// ParsePut from notification into container event structure.
|
||||
func ParsePut(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParsePut(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev Put
|
||||
err error
|
||||
|
|
|
@ -7,7 +7,8 @@ import (
|
|||
"sync"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/block"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/neorpc/result"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/subscriber"
|
||||
|
@ -189,11 +190,11 @@ func (l *listener) listen(ctx context.Context, intError chan<- error) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (l *listener) listenLoop(ctx context.Context, chEvent <-chan *subscriptions.NotificationEvent, intErr chan<- error) {
|
||||
func (l *listener) listenLoop(ctx context.Context, chEvent <-chan *state.ContainedNotificationEvent, intErr chan<- error) {
|
||||
var (
|
||||
blockChan <-chan *block.Block
|
||||
|
||||
notaryChan <-chan *subscriptions.NotaryRequestEvent
|
||||
notaryChan <-chan *result.NotaryRequestEvent
|
||||
|
||||
err error
|
||||
)
|
||||
|
@ -294,7 +295,7 @@ loop:
|
|||
}
|
||||
}
|
||||
|
||||
func (l *listener) parseAndHandleNotification(notifyEvent *subscriptions.NotificationEvent) {
|
||||
func (l *listener) parseAndHandleNotification(notifyEvent *state.ContainedNotificationEvent) {
|
||||
log := l.log.With(
|
||||
zap.String("script hash LE", notifyEvent.ScriptHash.StringLE()),
|
||||
)
|
||||
|
@ -349,7 +350,7 @@ func (l *listener) parseAndHandleNotification(notifyEvent *subscriptions.Notific
|
|||
}
|
||||
}
|
||||
|
||||
func (l *listener) parseAndHandleNotary(nr *subscriptions.NotaryRequestEvent) {
|
||||
func (l *listener) parseAndHandleNotary(nr *result.NotaryRequestEvent) {
|
||||
// prepare the notary event
|
||||
notaryEvent, err := l.notaryEventsPreparator.Prepare(nr.NotaryRequest)
|
||||
if err != nil {
|
||||
|
|
|
@ -3,7 +3,7 @@ package neofs
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
|
@ -37,7 +37,7 @@ func (b bindCommon) Keys() [][]byte { return b.keys }
|
|||
|
||||
func (b bindCommon) User() []byte { return b.user }
|
||||
|
||||
func ParseBind(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseBind(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev Bind
|
||||
err error
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -64,8 +63,8 @@ func TestParseBind(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *subscriptions.NotificationEvent {
|
||||
return &subscriptions.NotificationEvent{
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *state.ContainedNotificationEvent {
|
||||
return &state.ContainedNotificationEvent{
|
||||
NotificationEvent: state.NotificationEvent{
|
||||
Item: stackitem.NewArray(items),
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@ package neofs
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -33,7 +33,7 @@ func (c Cheque) Amount() int64 { return c.amount }
|
|||
func (c Cheque) LockAccount() util.Uint160 { return c.lock }
|
||||
|
||||
// ParseCheque from notification into cheque structure.
|
||||
func ParseCheque(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseCheque(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev Cheque
|
||||
err error
|
||||
|
|
|
@ -3,7 +3,7 @@ package neofs
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -35,7 +35,7 @@ func (u Config) Key() []byte { return u.key }
|
|||
|
||||
func (u Config) Value() []byte { return u.value }
|
||||
|
||||
func ParseConfig(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseConfig(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev Config
|
||||
err error
|
||||
|
|
|
@ -3,7 +3,7 @@ package neofs
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -33,7 +33,7 @@ func (d Deposit) To() util.Uint160 { return d.to }
|
|||
func (d Deposit) Amount() int64 { return d.amount }
|
||||
|
||||
// ParseDeposit notification into deposit structure.
|
||||
func ParseDeposit(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseDeposit(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var ev Deposit
|
||||
|
||||
params, err := event.ParseStackArray(e)
|
||||
|
|
|
@ -3,7 +3,7 @@ package neofs
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
)
|
||||
|
||||
|
@ -11,7 +11,7 @@ type Unbind struct {
|
|||
bindCommon
|
||||
}
|
||||
|
||||
func ParseUnbind(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseUnbind(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev Unbind
|
||||
err error
|
||||
|
|
|
@ -3,7 +3,7 @@ package neofs
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -29,7 +29,7 @@ func (w Withdraw) User() util.Uint160 { return w.user }
|
|||
func (w Withdraw) Amount() int64 { return w.amount }
|
||||
|
||||
// ParseWithdraw notification into withdraw structure.
|
||||
func ParseWithdraw(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseWithdraw(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var ev Withdraw
|
||||
|
||||
params, err := event.ParseStackArray(e)
|
||||
|
|
|
@ -3,8 +3,8 @@ package netmap
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
)
|
||||
|
@ -32,7 +32,7 @@ func (s AddPeer) NotaryRequest() *payload.P2PNotaryRequest {
|
|||
|
||||
const expectedItemNumAddPeer = 1
|
||||
|
||||
func ParseAddPeer(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseAddPeer(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev AddPeer
|
||||
err error
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -43,8 +42,8 @@ func TestParseAddPeer(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *subscriptions.NotificationEvent {
|
||||
return &subscriptions.NotificationEvent{
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *state.ContainedNotificationEvent {
|
||||
return &state.ContainedNotificationEvent{
|
||||
NotificationEvent: state.NotificationEvent{
|
||||
Item: stackitem.NewArray(items),
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@ package netmap
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -36,7 +36,7 @@ func (s NewEpoch) TxHash() util.Uint256 {
|
|||
// ParseNewEpoch is a parser of new epoch notification event.
|
||||
//
|
||||
// Result is type of NewEpoch.
|
||||
func ParseNewEpoch(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseNewEpoch(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
params, err := event.ParseStackArray(e)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not parse stack items from notify event: %w", err)
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"crypto/elliptic"
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neofs-contract/netmap"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -41,7 +41,7 @@ func (s UpdatePeer) NotaryRequest() *payload.P2PNotaryRequest {
|
|||
|
||||
const expectedItemNumUpdatePeer = 2
|
||||
|
||||
func ParseUpdatePeer(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseUpdatePeer(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev UpdatePeer
|
||||
err error
|
||||
|
|
|
@ -3,13 +3,13 @@ package event
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
)
|
||||
|
||||
// NotificationParser is a function that constructs Event
|
||||
// from the StackItem list.
|
||||
type NotificationParser func(*subscriptions.NotificationEvent) (Event, error)
|
||||
type NotificationParser func(*state.ContainedNotificationEvent) (Event, error)
|
||||
|
||||
// NotificationParserInfo is a structure that groups
|
||||
// the parameters of particular contract
|
||||
|
|
|
@ -3,8 +3,8 @@ package reputation
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/reputation"
|
||||
|
@ -49,7 +49,7 @@ func (p Put) NotaryRequest() *payload.P2PNotaryRequest {
|
|||
}
|
||||
|
||||
// ParsePut from notification into reputation event structure.
|
||||
func ParsePut(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParsePut(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev Put
|
||||
err error
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/reputation"
|
||||
|
@ -84,8 +83,8 @@ func TestParsePut(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *subscriptions.NotificationEvent {
|
||||
return &subscriptions.NotificationEvent{
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *state.ContainedNotificationEvent {
|
||||
return &state.ContainedNotificationEvent{
|
||||
NotificationEvent: state.NotificationEvent{
|
||||
Item: stackitem.NewArray(items),
|
||||
},
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/native/noderoles"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
)
|
||||
|
@ -23,7 +23,7 @@ type Designate struct {
|
|||
func (Designate) MorphEvent() {}
|
||||
|
||||
// ParseDesignate from notification into container event structure.
|
||||
func ParseDesignate(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseDesignate(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
params, err := event.ParseStackArray(e)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not parse stack items from notify event: %w", err)
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/native/noderoles"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
@ -28,8 +27,8 @@ func TestParseRoleUpdate(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *subscriptions.NotificationEvent {
|
||||
return &subscriptions.NotificationEvent{
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *state.ContainedNotificationEvent {
|
||||
return &state.ContainedNotificationEvent{
|
||||
NotificationEvent: state.NotificationEvent{
|
||||
Item: stackitem.NewArray(items),
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@ package subnetevents
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -34,7 +34,7 @@ func (x Delete) TxHash() util.Uint256 {
|
|||
// by the appropriate method of the Subnet contract.
|
||||
//
|
||||
// Resulting event is of Delete type.
|
||||
func ParseDelete(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseDelete(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev Delete
|
||||
err error
|
||||
|
|
|
@ -3,9 +3,9 @@ package subnetevents
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -65,7 +65,7 @@ const itemNumPut = 3
|
|||
// by the appropriate method of the subnet contract.
|
||||
//
|
||||
// Resulting event is of Put type.
|
||||
func ParsePut(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParsePut(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
put Put
|
||||
err error
|
||||
|
|
|
@ -3,7 +3,7 @@ package subnetevents
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
|
@ -38,7 +38,7 @@ const expectedItemNumRemoveNode = 2
|
|||
// ParseRemoveNode parses notification into subnet event structure.
|
||||
//
|
||||
// Expects 2 stack items.
|
||||
func ParseRemoveNode(e *subscriptions.NotificationEvent) (event.Event, error) {
|
||||
func ParseRemoveNode(e *state.ContainedNotificationEvent) (event.Event, error) {
|
||||
var (
|
||||
ev RemoveNode
|
||||
err error
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
. "github.com/nspcc-dev/neofs-node/pkg/morph/event/subnet"
|
||||
subnetid "github.com/nspcc-dev/neofs-sdk-go/subnet/id"
|
||||
|
@ -48,8 +47,8 @@ func TestParseRemoveNode(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *subscriptions.NotificationEvent {
|
||||
return &subscriptions.NotificationEvent{
|
||||
func createNotifyEventFromItems(items []stackitem.Item) *state.ContainedNotificationEvent {
|
||||
return &state.ContainedNotificationEvent{
|
||||
NotificationEvent: state.NotificationEvent{
|
||||
Item: stackitem.NewArray(items),
|
||||
},
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/mempoolevent"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
|
@ -99,7 +99,7 @@ var errEmptyStackArray = errors.New("stack item array is empty")
|
|||
|
||||
// ParseStackArray parses stack array from raw notification
|
||||
// event received from neo-go RPC node.
|
||||
func ParseStackArray(event *subscriptions.NotificationEvent) ([]stackitem.Item, error) {
|
||||
func ParseStackArray(event *state.ContainedNotificationEvent) ([]stackitem.Item, error) {
|
||||
arr, err := client.ArrayFromStackItem(event.Item)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("stack item is not an array type: %w", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue