rpc, cli: remove Network from RPC client and cli

This commit is contained in:
Anna Shaleva 2020-10-14 18:13:20 +03:00
parent 474d2dfb65
commit 590be7a58d
16 changed files with 206 additions and 80 deletions

View file

@ -69,6 +69,8 @@ const (
// NewWS returns a new WSClient ready to use (with established websocket
// connection). You need to use websocket URL for it like `ws://1.2.3.4/ws`.
// You should call Init method to initialize network magic the client is
// operating on.
func NewWS(ctx context.Context, endpoint string, opts Options) (*WSClient, error) {
cl, err := New(ctx, endpoint, opts)
if err != nil {
@ -137,9 +139,9 @@ readloop:
var val interface{}
switch event {
case response.BlockEventID:
val = block.New(c.opts.Network)
val = block.New(c.GetNetwork())
case response.TransactionEventID:
val = &transaction.Transaction{Network: c.opts.Network}
val = &transaction.Transaction{Network: c.GetNetwork()}
case response.NotificationEventID:
val = new(state.NotificationEvent)
case response.ExecutionEventID: