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

View file

@ -41,7 +41,6 @@ import (
"github.com/nspcc-dev/neo-go/pkg/io"
"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/subscriptions"
"github.com/nspcc-dev/neo-go/pkg/network"
"github.com/nspcc-dev/neo-go/pkg/network/payload"
"github.com/nspcc-dev/neo-go/pkg/services/oracle"
@ -2514,7 +2513,7 @@ chloop:
resp.Payload[0] = tx
case e := <-s.notaryRequestCh:
resp.Event = neorpc.NotaryRequestEventID
resp.Payload[0] = &subscriptions.NotaryRequestEvent{
resp.Payload[0] = &result.NotaryRequestEvent{
Type: e.Type,
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/transaction"
"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"
)
@ -82,7 +82,7 @@ func (f *feed) Matches(r *neorpc.Notification) bool {
return applog.VMState.String() == filt.State
case neorpc.NotaryRequestEventID:
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
signerOK := true
if filt.Signer != nil {