Skip to content

Commit

Permalink
Merge branch 'master' into itest-light-node-state-hash
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykiselev committed Dec 28, 2024
2 parents ca36923 + 14ae6e5 commit d5998c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions itests/clients/node_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ func (c *NodesClients) SynchronizedWavesBalances(
}

func (c *NodesClients) Handshake() {
c.GoClient.Handshake()
c.ScalaClient.Handshake()
c.GoClient.Connection.SendHandshake()
c.ScalaClient.Connection.SendHandshake()
}

func (c *NodesClients) SendToNodes(t *testing.T, m proto.Message, scala bool) {
Expand All @@ -300,8 +300,10 @@ func (c *NodesClients) SendToNodes(t *testing.T, m proto.Message, scala bool) {
}

func (c *NodesClients) Close(t *testing.T) {
c.GoClient.Close(t)
c.ScalaClient.Close(t)
c.GoClient.GRPCClient.Close(t)
c.GoClient.Connection.Close()
c.ScalaClient.GRPCClient.Close(t)
c.ScalaClient.Connection.Close()
}

func (c *NodesClients) requestNodesAvailableBalances(
Expand Down
2 changes: 1 addition & 1 deletion pkg/networking/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ func (s *Session) readMessagePayload(hdr Header, conn io.Reader) error {
s.logger.Debug("Invoking OnReceive handler", "message",
base64.StdEncoding.EncodeToString(s.receiveBuffer.Bytes()))
}
s.config.handler.OnReceive(s, bytes.NewReader(s.receiveBuffer.Bytes())) // Invoke OnReceive handler.
s.config.handler.OnReceive(s, s.receiveBuffer) // Invoke OnReceive handler.
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/networking/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestSuccessfulSession(t *testing.T) {
require.NoError(t, wErr)
assert.Equal(t, 5, n)
})
sc2 := serverHandler.On("OnReceive", ss, bytes.NewReader(encodeMessage("Hello session"))).
sc2 := serverHandler.On("OnReceive", ss, bytes.NewBuffer(encodeMessage("Hello session"))).
Once().Return()
sc2.NotBefore(sc1).
Run(func(_ mock.Arguments) {
Expand All @@ -75,7 +75,7 @@ func TestSuccessfulSession(t *testing.T) {
require.NoError(t, wErr)
assert.Equal(t, 17, n)
})
cl2 := clientHandler.On("OnReceive", cs, bytes.NewReader(encodeMessage("Hi"))).Once().Return()
cl2 := clientHandler.On("OnReceive", cs, bytes.NewBuffer(encodeMessage("Hi"))).Once().Return()
cl2.NotBefore(cl1).
Run(func(_ mock.Arguments) {
cWG.Done()
Expand Down

0 comments on commit d5998c3

Please sign in to comment.