mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 23:42:23 +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/policy"
|
||||
"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/callflag"
|
||||
"github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest"
|
||||
|
@ -1809,6 +1810,15 @@ func TestClient_Wait(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
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) {
|
||||
rcvr := make(chan struct{})
|
||||
go func() {
|
||||
|
|
Loading…
Reference in a new issue