aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/server_test.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-04-05 15:43:32 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-04-05 15:43:32 +0800
commited92f116f72646e73613afc2f2e7b83472a61434 (patch)
tree6c6d3cf414e21ee37d93e30e782ec028ff0144f8 /rpc/server_test.go
parent6a185531d2cd2003bb4352c391f9dca023894d5a (diff)
parentf7328c5ecbd1076582a71ef7bf436485f3868b1f (diff)
downloadgo-tangerine-ed92f116f72646e73613afc2f2e7b83472a61434.tar
go-tangerine-ed92f116f72646e73613afc2f2e7b83472a61434.tar.gz
go-tangerine-ed92f116f72646e73613afc2f2e7b83472a61434.tar.bz2
go-tangerine-ed92f116f72646e73613afc2f2e7b83472a61434.tar.lz
go-tangerine-ed92f116f72646e73613afc2f2e7b83472a61434.tar.xz
go-tangerine-ed92f116f72646e73613afc2f2e7b83472a61434.tar.zst
go-tangerine-ed92f116f72646e73613afc2f2e7b83472a61434.zip
Merge pull request #2407 from bas-vk/rpc-notifications
RPC pub sub
Diffstat (limited to 'rpc/server_test.go')
-rw-r--r--rpc/server_test.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/rpc/server_test.go b/rpc/server_test.go
index 5b91fe42a..c60db38df 100644
--- a/rpc/server_test.go
+++ b/rpc/server_test.go
@@ -65,8 +65,12 @@ func (s *Service) InvalidRets3() (string, string, error) {
return "", "", nil
}
-func (s *Service) Subscription() (Subscription, error) {
- return NewSubscription(nil), nil
+func (s *Service) Subscription(ctx context.Context) (Subscription, error) {
+ return nil, nil
+}
+
+func (s *Service) SubsriptionWithArgs(ctx context.Context, a, b int) (Subscription, error) {
+ return nil, nil
}
func TestServerRegisterName(t *testing.T) {
@@ -90,8 +94,8 @@ func TestServerRegisterName(t *testing.T) {
t.Errorf("Expected 4 callbacks for service 'calc', got %d", len(svc.callbacks))
}
- if len(svc.subscriptions) != 1 {
- t.Errorf("Expected 1 subscription for service 'calc', got %d", len(svc.subscriptions))
+ if len(svc.subscriptions) != 2 {
+ t.Errorf("Expected 2 subscriptions for service 'calc', got %d", len(svc.subscriptions))
}
}
@@ -229,7 +233,7 @@ func TestServerMethodExecution(t *testing.T) {
input, _ := json.Marshal(&req)
codec := &ServerTestCodec{input: input, closer: make(chan interface{})}
- go server.ServeCodec(codec)
+ go server.ServeCodec(codec, OptionMethodInvocation)
<-codec.closer
@@ -259,7 +263,7 @@ func TestServerMethodWithCtx(t *testing.T) {
input, _ := json.Marshal(&req)
codec := &ServerTestCodec{input: input, closer: make(chan interface{})}
- go server.ServeCodec(codec)
+ go server.ServeCodec(codec, OptionMethodInvocation)
<-codec.closer