We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1d6e48e + 3bdb3a8 commit 9f9c6f5Copy full SHA for 9f9c6f5
pkg/rpcclient/client.go
@@ -255,3 +255,8 @@ func (c *Client) Ping() error {
255
func (c *Client) Context() context.Context {
256
return c.ctx
257
}
258
+
259
+// Endpoint returns the client endpoint.
260
+func (c *Client) Endpoint() string {
261
+ return c.endpoint.String()
262
+}
pkg/rpcclient/client_test.go
@@ -0,0 +1,18 @@
1
+package rpcclient
2
3
+import (
4
+ "net/url"
5
+ "testing"
6
7
+ "github.com/stretchr/testify/require"
8
+)
9
10
+func TestGetEndpoint(t *testing.T) {
11
+ host := "http://localhost:1234"
12
+ u, err := url.Parse(host)
13
+ require.NoError(t, err)
14
+ client := Client{
15
+ endpoint: u,
16
+ }
17
+ require.Equal(t, host, client.Endpoint())
18
0 commit comments