ethers.js/lib.commonjs/providers/plugin-fallback.js

31 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-11-09 10:57:02 +03:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PossiblyPrunedTransactionPlugin = exports.CheckQualifiedPlugin = exports.PluginIdFallbackProvider = void 0;
const index_js_1 = require("../utils/index.js");
2023-02-02 12:05:47 +03:00
exports.PluginIdFallbackProvider = "org.ethers.plugins.provider.QualifiedPlugin";
2022-11-09 10:57:02 +03:00
class CheckQualifiedPlugin {
constructor() {
(0, index_js_1.defineProperties)(this, { name: exports.PluginIdFallbackProvider });
}
connect(provider) {
return this;
}
// Retruns true if this value should be considered qualified for
// inclusion in the quorum.
isQualified(action, result) {
return true;
}
}
exports.CheckQualifiedPlugin = CheckQualifiedPlugin;
class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin {
isQualified(action, result) {
if (action.method === "getTransaction" || action.method === "getTransactionReceipt") {
if (result == null) {
return false;
}
}
return super.isQualified(action, result);
}
}
exports.PossiblyPrunedTransactionPlugin = PossiblyPrunedTransactionPlugin;
//# sourceMappingURL=plugin-fallback.js.map