Skip to content

Commit

Permalink
chore: remove superfluous if-statement, fn renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
vidarandrebo committed Feb 2, 2024
1 parent 5710833 commit 93bf061
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ func (n *RawNode) RPCCall(ctx context.Context, d CallData) (protoreflect.ProtoMe

select {
case r := <-replyChan:
if r.err != nil {
return nil, r.err
}
return r.msg, nil
return r.msg, r.err
case <-ctx.Done():
return nil, ctx.Err()
}
Expand Down
8 changes: 4 additions & 4 deletions rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestRPCCallSuccess(t *testing.T) {
})
defer teardown()

mgr := rpcTestMgr()
mgr := gorumsTestMgr()

_, err := mgr.NewConfiguration(gorums.WithNodeList(addrs))
if err != nil {
Expand All @@ -44,7 +44,7 @@ func TestRPCCallDownedNode(t *testing.T) {
addrs, teardown := gorums.TestSetup(t, 1, func(_ int) gorums.ServerIface {
return initServer()
})
mgr := rpcTestMgr()
mgr := gorumsTestMgr()

_, err := mgr.NewConfiguration(gorums.WithNodeList(addrs))
if err != nil {
Expand Down Expand Up @@ -74,7 +74,7 @@ func TestRPCCallTimedOut(t *testing.T) {
})
defer teardown()

mgr := rpcTestMgr()
mgr := gorumsTestMgr()

_, err := mgr.NewConfiguration(gorums.WithNodeList(addrs))
if err != nil {
Expand Down Expand Up @@ -103,7 +103,7 @@ func initServer() *gorums.Server {
return srv
}

func rpcTestMgr() *dummy.Manager {
func gorumsTestMgr() *dummy.Manager {
mgr := dummy.NewManager(
gorums.WithDialTimeout(time.Second),
gorums.WithGrpcDialOptions(
Expand Down

0 comments on commit 93bf061

Please sign in to comment.