mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-02-16 21:16:30 +00:00
rpcsrv: add test for Waiter constructor
Ensure that WSClient-based Actor is able to create EventBased waiter. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
027d726b65
commit
afbb51e78c
1 changed files with 10 additions and 0 deletions
|
@ -51,6 +51,7 @@ import (
|
||||||
"github.com/nspcc-dev/neo-go/pkg/rpcclient/oracle"
|
"github.com/nspcc-dev/neo-go/pkg/rpcclient/oracle"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/rpcclient/policy"
|
"github.com/nspcc-dev/neo-go/pkg/rpcclient/policy"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/rpcclient/rolemgmt"
|
"github.com/nspcc-dev/neo-go/pkg/rpcclient/rolemgmt"
|
||||||
|
"github.com/nspcc-dev/neo-go/pkg/rpcclient/waiter"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
|
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/smartcontract/callflag"
|
"github.com/nspcc-dev/neo-go/pkg/smartcontract/callflag"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest"
|
"github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest"
|
||||||
|
@ -1809,6 +1810,15 @@ func TestClient_Wait(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.True(t, len(b.Transactions) > 0)
|
require.True(t, len(b.Transactions) > 0)
|
||||||
|
|
||||||
|
// Ensure Waiter constructor works properly.
|
||||||
|
if ws {
|
||||||
|
_, ok := act.Waiter.(*waiter.EventBased)
|
||||||
|
require.True(t, ok)
|
||||||
|
} else {
|
||||||
|
_, ok := act.Waiter.(*waiter.PollingBased)
|
||||||
|
require.True(t, ok)
|
||||||
|
}
|
||||||
|
|
||||||
check := func(t *testing.T, h util.Uint256, vub uint32, errExpected bool) {
|
check := func(t *testing.T, h util.Uint256, vub uint32, errExpected bool) {
|
||||||
rcvr := make(chan struct{})
|
rcvr := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue