*Update dist
This commit is contained in:
parent
5cefe245af
commit
9095cd5b5a
|
@ -1 +1 @@
|
|||
{"version":3,"file":"rpcQuery.d.ts","sourceRoot":"","sources":["../src/rpcQuery.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAe,MAAM,SAAS,CAAC;AAMlD,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,QAAQ,CAAC,CAAe;IAChC,OAAO,CAAC,aAAa,CAAC,CAAM;IAC5B,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,UAAU,CAAwC;IAC1D,OAAO,CAAC,eAAe,CAAC,CAAsB;gBAElC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU;IAMlD,IAAI,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,CAEzB;IAED,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,OAAO;YAQD,IAAI;YA2BJ,UAAU;IAgCxB,OAAO,CAAC,cAAc;IA8CtB,OAAO,CAAC,KAAK;CASd"}
|
||||
{"version":3,"file":"rpcQuery.d.ts","sourceRoot":"","sources":["../src/rpcQuery.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAe,MAAM,SAAS,CAAC;AAKlD,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,QAAQ,CAAC,CAAe;IAChC,OAAO,CAAC,aAAa,CAAC,CAAM;IAC5B,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,UAAU,CAAwC;IAC1D,OAAO,CAAC,eAAe,CAAC,CAAsB;gBAElC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU;IAMlD,IAAI,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,CAEzB;IAED,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,OAAO;YAQD,IAAI;YA2BJ,UAAU;IAgCxB,OAAO,CAAC,cAAc;IAgDtB,OAAO,CAAC,KAAK;CASd"}
|
|
@ -2,7 +2,7 @@ import { clearTimeout, setTimeout } from "timers";
|
|||
import { pack, unpack } from "msgpackr";
|
||||
import { Buffer } from "buffer";
|
||||
import { blake2b } from "libskynet";
|
||||
import jsonStringify from "json-stable-stringify";
|
||||
import { flatten } from "./util.js";
|
||||
export default class RpcQuery {
|
||||
_network;
|
||||
_query;
|
||||
|
@ -83,12 +83,14 @@ export default class RpcQuery {
|
|||
const responseStore = this._responses;
|
||||
const responseStoreData = Object.values(responseStore);
|
||||
const responseObjects = responseStoreData.reduce((output, item) => {
|
||||
const hash = Buffer.from(blake2b(Buffer.from(jsonStringify(item?.data)))).toString("hex");
|
||||
const itemFlattened = flatten(item?.data).sort();
|
||||
const hash = Buffer.from(blake2b(Buffer.from(JSON.stringify(itemFlattened)))).toString("hex");
|
||||
output[hash] = item?.data;
|
||||
return output;
|
||||
}, {});
|
||||
const responses = responseStoreData.reduce((output, item) => {
|
||||
const hash = Buffer.from(blake2b(Buffer.from(jsonStringify(item?.data)))).toString("hex");
|
||||
const itemFlattened = flatten(item?.data).sort();
|
||||
const hash = Buffer.from(blake2b(Buffer.from(JSON.stringify(itemFlattened)))).toString("hex");
|
||||
output[hash] = output[hash] ?? 0;
|
||||
output[hash]++;
|
||||
return output;
|
||||
|
|
Loading…
Reference in New Issue