client/cli: add network option to the RPC client
It doesn't affect anything yet, but it's going to be used in the future for network-specific behavior. It also renames short '--timeout' form to '-s' avoiding conlict with '-t' used for '--testnet'.
This commit is contained in:
parent
16ce63e653
commit
d22286cbbc
5 changed files with 23 additions and 19 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/nspcc-dev/neo-go/pkg/config/netmode"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/block"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
|
||||
|
@ -1112,7 +1113,7 @@ func testRPCClient(t *testing.T, newClient func(context.Context, string, Options
|
|||
defer srv.Close()
|
||||
|
||||
endpoint := srv.URL
|
||||
opts := Options{}
|
||||
opts := Options{Network: netmode.UnitTestNet}
|
||||
c, err := newClient(context.TODO(), endpoint, opts)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
@ -1136,7 +1137,7 @@ func testRPCClient(t *testing.T, newClient func(context.Context, string, Options
|
|||
defer srv.Close()
|
||||
|
||||
endpoint := srv.URL
|
||||
opts := Options{}
|
||||
opts := Options{Network: netmode.UnitTestNet}
|
||||
c, err := newClient(context.TODO(), endpoint, opts)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue