*Update dist
This commit is contained in:
parent
2a7fa853c9
commit
ef62888c31
|
@ -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;
|
||||||
|
|
|
@ -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"}
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue