Skip to content

Commit

Permalink
client -> RlpxSender: use API method sendMethod from ETH, LES protoco…
Browse files Browse the repository at this point in the history
…ls instead of internally bound _send method
  • Loading branch information
holgerd77 committed Feb 7, 2021
1 parent 4063ffd commit 1e94410
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/client/lib/net/protocol/rlpxsender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export class RlpxSender extends Sender {
*/
sendMessage(code: number, data: any) {
try {
this.sender._send(code, rlp.encode(data))
//@ts-ignore "type number is not assignable to type never"
this.sender.sendMessage(code, data)
} catch (err) {
this.emit('error', err)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/net/protocol/rlpxsender.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tape('[RlpxSender]', (t) => {
const rlpxProtocol = td.object() as any
const sender = new RlpxSender(rlpxProtocol)
sender.sendMessage(1, 5)
td.verify(rlpxProtocol._send(1, rlp.encode(5)))
td.verify(rlpxProtocol.sendMessage(1, 5))
td.reset()
t.pass('message sent')
t.end()
Expand Down

0 comments on commit 1e94410

Please sign in to comment.