File tree 2 files changed +8
-23
lines changed
2 files changed +8
-23
lines changed Original file line number Diff line number Diff line change @@ -28,29 +28,14 @@ class Metadata extends BaseProtocol {
28
28
* Handle an incoming metadata request
29
29
*/
30
30
private async onRequest ( streamData : IncomingStreamData ) : Promise < void > {
31
- const encodedRpcQuery = proto_metadata . WakuMetadataRequest . encode (
32
- this . shardInfo
33
- ) ;
34
-
35
- const res = await pipe (
36
- [ encodedRpcQuery ] ,
37
- lp . encode ,
38
- streamData . stream ,
39
- lp . decode ,
40
- async ( source ) => await all ( source )
41
- ) ;
31
+ try {
32
+ const encodedResponse = proto_metadata . WakuMetadataResponse . encode (
33
+ this . shardInfo
34
+ ) ;
42
35
43
- const bytes = new Uint8ArrayList ( ) ;
44
- res . forEach ( ( chunk ) => {
45
- bytes . append ( chunk ) ;
46
- } ) ;
47
-
48
- const shardInfoRes = proto_metadata . WakuMetadataResponse . decode ( bytes ) ;
49
- if ( ! shardInfoRes ) {
50
- log . error ( "WakuMetadata response is undefined" ) ;
51
- }
52
- if ( ! shardInfoRes . clusterId ) {
53
- log . error ( "WakuMetadata response clusterId is undefined" ) ;
36
+ await pipe ( [ encodedResponse ] , lp . encode , streamData . stream ) ;
37
+ } catch ( error ) {
38
+ log . error ( "Error handling metadata request" , error ) ;
54
39
}
55
40
}
56
41
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { tearDownNodes } from "../src/index.js";
8
8
import { makeLogFileName } from "../src/log_file.js" ;
9
9
import { NimGoNode } from "../src/node/node.js" ;
10
10
11
- describe ( "Metadata Protocol" , ( ) => {
11
+ describe . only ( "Metadata Protocol" , ( ) => {
12
12
describe ( "Locally Run Nodes" , ( ) => {
13
13
let waku : LightNode ;
14
14
let nwaku1 : NimGoNode ;
You can’t perform that action at this time.
0 commit comments