mirror of https://github.com/waku-org/js-waku.git
test: improve RPC call debugging
This commit is contained in:
parent
d65e99275b
commit
4a96472084
|
@ -356,6 +356,7 @@ export class Nwaku {
|
||||||
method: string,
|
method: string,
|
||||||
params: Array<string | number | unknown>
|
params: Array<string | number | unknown>
|
||||||
): Promise<T> {
|
): Promise<T> {
|
||||||
|
dbg("RPC Query: ", method, params);
|
||||||
const res = await fetch(this.rpcUrl, {
|
const res = await fetch(this.rpcUrl, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
@ -366,8 +367,8 @@ export class Nwaku {
|
||||||
}),
|
}),
|
||||||
headers: new Headers({ "Content-Type": "application/json" }),
|
headers: new Headers({ "Content-Type": "application/json" }),
|
||||||
});
|
});
|
||||||
dbg(`Response received for ${method} call: `, res, "params: ", params);
|
|
||||||
const json = await res.json();
|
const json = await res.json();
|
||||||
|
dbg(`RPC Response: `, res, json);
|
||||||
return json.result;
|
return json.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue