neorpc/result: move NotaryRequestEvent to this package

Not worth a package of its own.
This commit is contained in:
Roman Khimov 2022-07-22 21:26:29 +03:00
parent 4acd1688a1
commit b3c25b5a1f
4 changed files with 6 additions and 7 deletions

View file

@ -1,4 +1,4 @@
package subscriptions package result
import ( import (
"github.com/nspcc-dev/neo-go/pkg/core/mempoolevent" "github.com/nspcc-dev/neo-go/pkg/core/mempoolevent"

View file

@ -14,7 +14,7 @@ import (
"github.com/nspcc-dev/neo-go/pkg/core/state" "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/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/neorpc" "github.com/nspcc-dev/neo-go/pkg/neorpc"
"github.com/nspcc-dev/neo-go/pkg/neorpc/result/subscriptions" "github.com/nspcc-dev/neo-go/pkg/neorpc/result"
"github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/util"
"go.uber.org/atomic" "go.uber.org/atomic"
) )
@ -186,7 +186,7 @@ readloop:
case neorpc.ExecutionEventID: case neorpc.ExecutionEventID:
val = new(state.AppExecResult) val = new(state.AppExecResult)
case neorpc.NotaryRequestEventID: case neorpc.NotaryRequestEventID:
val = new(subscriptions.NotaryRequestEvent) val = new(result.NotaryRequestEvent)
case neorpc.MissedEventID: case neorpc.MissedEventID:
// No value. // No value.
default: default:

View file

@ -41,7 +41,6 @@ import (
"github.com/nspcc-dev/neo-go/pkg/io" "github.com/nspcc-dev/neo-go/pkg/io"
"github.com/nspcc-dev/neo-go/pkg/neorpc" "github.com/nspcc-dev/neo-go/pkg/neorpc"
"github.com/nspcc-dev/neo-go/pkg/neorpc/result" "github.com/nspcc-dev/neo-go/pkg/neorpc/result"
"github.com/nspcc-dev/neo-go/pkg/neorpc/result/subscriptions"
"github.com/nspcc-dev/neo-go/pkg/network" "github.com/nspcc-dev/neo-go/pkg/network"
"github.com/nspcc-dev/neo-go/pkg/network/payload" "github.com/nspcc-dev/neo-go/pkg/network/payload"
"github.com/nspcc-dev/neo-go/pkg/services/oracle" "github.com/nspcc-dev/neo-go/pkg/services/oracle"
@ -2514,7 +2513,7 @@ chloop:
resp.Payload[0] = tx resp.Payload[0] = tx
case e := <-s.notaryRequestCh: case e := <-s.notaryRequestCh:
resp.Event = neorpc.NotaryRequestEventID resp.Event = neorpc.NotaryRequestEventID
resp.Payload[0] = &subscriptions.NotaryRequestEvent{ resp.Payload[0] = &result.NotaryRequestEvent{
Type: e.Type, Type: e.Type,
NotaryRequest: e.Data.(*payload.P2PNotaryRequest), NotaryRequest: e.Data.(*payload.P2PNotaryRequest),
} }

View file

@ -6,7 +6,7 @@ import (
"github.com/nspcc-dev/neo-go/pkg/core/state" "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/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/neorpc" "github.com/nspcc-dev/neo-go/pkg/neorpc"
"github.com/nspcc-dev/neo-go/pkg/neorpc/result/subscriptions" "github.com/nspcc-dev/neo-go/pkg/neorpc/result"
"go.uber.org/atomic" "go.uber.org/atomic"
) )
@ -82,7 +82,7 @@ func (f *feed) Matches(r *neorpc.Notification) bool {
return applog.VMState.String() == filt.State return applog.VMState.String() == filt.State
case neorpc.NotaryRequestEventID: case neorpc.NotaryRequestEventID:
filt := f.filter.(neorpc.TxFilter) filt := f.filter.(neorpc.TxFilter)
req := r.Payload[0].(*subscriptions.NotaryRequestEvent) req := r.Payload[0].(*result.NotaryRequestEvent)
senderOk := filt.Sender == nil || req.NotaryRequest.FallbackTransaction.Signers[1].Account == *filt.Sender senderOk := filt.Sender == nil || req.NotaryRequest.FallbackTransaction.Signers[1].Account == *filt.Sender
signerOK := true signerOK := true
if filt.Signer != nil { if filt.Signer != nil {