*Update dist

This commit is contained in:
Derrick Hammer 2022-08-14 09:44:50 -04:00
parent 2a7fa853c9
commit ef62888c31
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 12 additions and 4 deletions

2
dist/rpcQuery.d.ts vendored
View File

@ -9,6 +9,8 @@ export default class RpcQuery {
private _completed; private _completed;
private _responses; private _responses;
private _promiseResolve?; private _promiseResolve?;
private _maxTries;
private _tries;
constructor(network: RpcNetwork, query: RPCRequest); constructor(network: RpcNetwork, query: RPCRequest);
get result(): Promise<any>; get result(): Promise<any>;
private handeTimeout; private handeTimeout;

View File

@ -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;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"} {"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;IAC9C,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,MAAM,CAAK;gBAEP,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;IAqDtB,OAAO,CAAC,KAAK;CASd"}

8
dist/rpcQuery.js vendored
View File

@ -12,6 +12,8 @@ export default class RpcQuery {
_completed = false; _completed = false;
_responses = {}; _responses = {};
_promiseResolve; _promiseResolve;
_maxTries = 3;
_tries = 0;
constructor(network, query) { constructor(network, query) {
this._network = network; this._network = network;
this._query = query; this._query = query;
@ -99,12 +101,16 @@ export default class RpcQuery {
if (responses[responseHash] / responseStoreData.length >= if (responses[responseHash] / responseStoreData.length >=
this._network.majorityThreshold) { this._network.majorityThreshold) {
// @ts-ignore // @ts-ignore
const response = responseObjects[responseHash]; let response = responseObjects[responseHash];
// @ts-ignore // @ts-ignore
if (null === response) { if (null === response) {
if (this._tries <= this._maxTries) {
this._tries++;
this.retry(); this.retry();
return; return;
} }
response = false;
}
this.resolve(response); this.resolve(response);
break; break;
} }