plugin-fallback.js 880 B

1234567891011121314151617181920212223242526
  1. import { defineProperties } from "../utils/index.js";
  2. export const PluginIdFallbackProvider = "org.ethers.plugins.provider.QualifiedPlugin";
  3. export class CheckQualifiedPlugin {
  4. constructor() {
  5. defineProperties(this, { name: PluginIdFallbackProvider });
  6. }
  7. connect(provider) {
  8. return this;
  9. }
  10. // Retruns true if this value should be considered qualified for
  11. // inclusion in the quorum.
  12. isQualified(action, result) {
  13. return true;
  14. }
  15. }
  16. export class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin {
  17. isQualified(action, result) {
  18. if (action.method === "getTransaction" || action.method === "getTransactionReceipt") {
  19. if (result == null) {
  20. return false;
  21. }
  22. }
  23. return super.isQualified(action, result);
  24. }
  25. }
  26. //# sourceMappingURL=plugin-fallback.js.map