rpc: add context argument to EthSubscribe
It's inconsistent not to pass it and most callers will work with contexts anyway.
This commit is contained in:
@ -215,7 +215,7 @@ func TestClientSubscribeInvalidArg(t *testing.T) {
|
||||
t.Error(string(buf))
|
||||
}
|
||||
}()
|
||||
client.EthSubscribe(arg, "foo_bar")
|
||||
client.EthSubscribe(context.Background(), arg, "foo_bar")
|
||||
}
|
||||
check(true, nil)
|
||||
check(true, 1)
|
||||
@ -233,7 +233,7 @@ func TestClientSubscribe(t *testing.T) {
|
||||
|
||||
nc := make(chan int)
|
||||
count := 10
|
||||
sub, err := client.EthSubscribe(nc, "someSubscription", count, 0)
|
||||
sub, err := client.EthSubscribe(context.Background(), nc, "someSubscription", count, 0)
|
||||
if err != nil {
|
||||
t.Fatal("can't subscribe:", err)
|
||||
}
|
||||
@ -275,7 +275,7 @@ func TestClientSubscribeClose(t *testing.T) {
|
||||
err error
|
||||
)
|
||||
go func() {
|
||||
sub, err = client.EthSubscribe(nc, "hangSubscription", 999)
|
||||
sub, err = client.EthSubscribe(context.Background(), nc, "hangSubscription", 999)
|
||||
errc <- err
|
||||
}()
|
||||
|
||||
@ -311,7 +311,7 @@ func TestClientNotificationStorm(t *testing.T) {
|
||||
// Subscribe on the server. It will start sending many notifications
|
||||
// very quickly.
|
||||
nc := make(chan int)
|
||||
sub, err := client.EthSubscribe(nc, "someSubscription", count, 0)
|
||||
sub, err := client.EthSubscribe(ctx, nc, "someSubscription", count, 0)
|
||||
if err != nil {
|
||||
t.Fatal("can't subscribe:", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user