kaspad/testing/integration/rpc_test.go
2021-02-17 18:00:16 +02:00

25 lines
445 B
Go

package integration
import (
"github.com/kaspanet/kaspad/infrastructure/network/rpcclient"
"time"
)
const rpcTimeout = 1 * time.Second
type testRPCClient struct {
*rpcclient.RPCClient
}
func newTestRPCClient(rpcAddress string) (*testRPCClient, error) {
rpcClient, err := rpcclient.NewRPCClient(rpcAddress)
if err != nil {
return nil, err
}
rpcClient.SetTimeout(rpcTimeout)
return &testRPCClient{
RPCClient: rpcClient,
}, nil
}