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:
Anna Shaleva 2024-08-14 10:26:29 +03:00
parent 027d726b65
commit afbb51e78c

View file

@ -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() {