diff --git a/.github/workflows/superlinter.yml b/.github/workflows/superlinter.yml index 8859f9b..f8036e4 100644 --- a/.github/workflows/superlinter.yml +++ b/.github/workflows/superlinter.yml @@ -1,12 +1,12 @@ name: Super Linter -on: - push: - branches: - - master - pull_request: - branches: - - master +on: + push: + branches: + - master + pull_request: + branches: + - master env: folder_name: 'e2e-sdk-prime' @@ -16,20 +16,17 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 + + - name: Super-Linter + uses: super-linter/super-linter@v5.2.0 - - name: Super-Linter - uses: super-linter/super-linter@v5.2.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VALIDATE_ALL_CODEBASE: false - DEFAULT_BRANCH: master - OUTPUT_FOLDER: Reports - OUTPUT_DETAILS: detailed - IGNORE_GITIGNORED_FILES: true - DISABLE_ERRORS: true - - - + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: master + OUTPUT_FOLDER: Reports + OUTPUT_DETAILS: detailed + IGNORE_GITIGNORED_FILES: true + DISABLE_ERRORS: true diff --git a/.gitignore b/.gitignore index 8c7d2bb..f7a8d7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ node_modules etherspot-prime-sdk .eslintrc.json -.prettierrc +.prettierrc.json mochawesome-report \ No newline at end of file diff --git a/README.md b/README.md index 818e0b6..3d92165 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# e2e-sdk-prime \ No newline at end of file +# e2e-sdk-prime diff --git a/package-lock.json b/package-lock.json index 1ec97dd..a6a275f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "mochawesome": "^7.1.3", "mochawesome-report-generator": "^6.2.0", "mysql2": "^3.6.5", - "prettier": "^3.0.0", + "prettier": "^3.2.5", "reflect-metadata": "^0.1.13", "rxjs": "^7.8.1", "ws": "^8.13.0" @@ -45,149 +45,150 @@ }, "etherspot-prime-sdk": { "name": "@etherspot/prime-sdk", - "version": "1.3.13", + "version": "1.8.1", "license": "MIT", "dependencies": { - "@apollo/client": "3.8.6", - "@lifi/sdk": "2.2.3", + "@apollo/client": "3.8.7", + "@lifi/sdk": "2.5.0", "@thehubbleproject/bls": "0.5.1", "@walletconnect/universal-provider": "2.10.0", "apollo-link-ws": "1.0.20", "buffer": "^6.0.3", "class-transformer": "0.5.1", - "class-validator": "0.14.0", + "class-validator": "0.14.1", "commander": "10.0.1", - "cross-fetch": "3.1.5", - "ethers": "5.7.0", + "cross-fetch": "3.1.8", + "ethers": "5.7.2", "graphql-ws": "5.14.2", "prettier": "2.8.8", - "reflect-metadata": "0.1.13", + "qs": "6.12.0", + "reflect-metadata": "0.1.14", "rxjs": "6.6.7" }, "devDependencies": { "@types/node": "18.11.9", "@types/prettier": "2.7.3", - "@typescript-eslint/eslint-plugin": "2.34.0", - "@typescript-eslint/parser": "2.34.0", + "@types/qs": "6.9.12", + "@typescript-eslint/eslint-plugin": "5.45.0", + "@typescript-eslint/parser": "5.45.0", "dotenv": "16.0.3", - "eslint": "6.8.0", - "eslint-config-prettier": "6.11.0", - "eslint-plugin-import": "2.20.2", + "eslint": "8.28.0", + "eslint-config-prettier": "8.5.0", + "eslint-plugin-prettier": "4.2.1", "npm": "9.6.4", "ts-node": "10.9.1", "typedoc": "^0.17.8", "typescript": "4.9.5" } }, - "etherspot-prime-sdk/node_modules/@typescript-eslint/eslint-plugin": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz", - "integrity": "sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ==", + "etherspot-prime-sdk/node_modules/@eslint/eslintrc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", + "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "2.34.0", - "functional-red-black-tree": "^1.0.1", - "regexpp": "^3.0.0", - "tsutils": "^3.17.1" + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^2.0.0", - "eslint": "^5.0.0 || ^6.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true + "url": "https://opencollective.com/eslint" + } + }, + "etherspot-prime-sdk/node_modules/@ethersproject/providers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bech32": "1.1.4", + "ws": "7.4.6" } }, - "etherspot-prime-sdk/node_modules/@typescript-eslint/parser": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.34.0.tgz", - "integrity": "sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA==", + "etherspot-prime-sdk/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.34.0", - "@typescript-eslint/typescript-estree": "2.34.0", - "eslint-visitor-keys": "^1.1.0" + "color-convert": "^2.0.1" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": ">=8" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "etherspot-prime-sdk/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "etherspot-prime-sdk/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "bin": { - "acorn": "bin/acorn" + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=0.4.0" - } - }, - "etherspot-prime-sdk/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "etherspot-prime-sdk/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "etherspot-prime-sdk/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "etherspot-prime-sdk/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "color-name": "~1.1.4" }, "engines": { - "node": ">=4.8" + "node": ">=7.0.0" } }, - "etherspot-prime-sdk/node_modules/cross-spawn/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "bin": { - "semver": "bin/semver" - } + "etherspot-prime-sdk/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "etherspot-prime-sdk/node_modules/dotenv": { "version": "16.0.3", @@ -198,306 +199,231 @@ "node": ">=12" } }, + "etherspot-prime-sdk/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "etherspot-prime-sdk/node_modules/eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.28.0.tgz", + "integrity": "sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^1.3.3", + "@humanwhocodes/config-array": "^0.11.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.4.0", + "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.15.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^7.0.0", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.14", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.8.3", - "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", - "table": "^5.2.3", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "etherspot-prime-sdk/node_modules/eslint-config-prettier": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz", - "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", + "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", "dev": true, - "dependencies": { - "get-stdin": "^6.0.0" - }, "bin": { - "eslint-config-prettier-check": "bin/cli.js" + "eslint-config-prettier": "bin/cli.js" }, "peerDependencies": { - "eslint": ">=3.14.1" + "eslint": ">=7.0.0" } }, - "etherspot-prime-sdk/node_modules/eslint-plugin-import": { - "version": "2.20.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz", - "integrity": "sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg==", + "etherspot-prime-sdk/node_modules/eslint-plugin-prettier": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", "dev": true, "dependencies": { - "array-includes": "^3.0.3", - "array.prototype.flat": "^1.2.1", - "contains-path": "^0.1.0", - "debug": "^2.6.9", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.2", - "eslint-module-utils": "^2.4.1", - "has": "^1.0.3", - "minimatch": "^3.0.4", - "object.values": "^1.1.0", - "read-pkg-up": "^2.0.0", - "resolve": "^1.12.0" + "prettier-linter-helpers": "^1.0.0" }, "engines": { - "node": ">=4" + "node": ">=12.0.0" }, "peerDependencies": { - "eslint": "2.x - 6.x" - } - }, - "etherspot-prime-sdk/node_modules/eslint-plugin-import/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "etherspot-prime-sdk/node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha512-lsGyRuYr4/PIB0txi+Fy2xOMI2dGaTguCaotzFGkVZuKR5usKfcRWIFKNM3QNrU7hh/+w2bwTW+ZeXPK5l8uVg==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" }, - "engines": { - "node": ">=0.10.0" + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } } }, - "etherspot-prime-sdk/node_modules/eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "etherspot-prime-sdk/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^1.1.0" + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" }, "engines": { - "node": ">=6" - } - }, - "etherspot-prime-sdk/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "etherspot-prime-sdk/node_modules/eslint/node_modules/regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true, - "engines": { - "node": ">=6.5.0" - } - }, - "etherspot-prime-sdk/node_modules/espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", - "dev": true, - "dependencies": { - "acorn": "^7.1.1", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "engines": { - "node": ">=6.0.0" + "funding": { + "url": "https://opencollective.com/eslint" } }, - "etherspot-prime-sdk/node_modules/file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "etherspot-prime-sdk/node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "dependencies": { - "flat-cache": "^2.0.1" + "eslint-visitor-keys": "^2.0.0" }, "engines": { - "node": ">=4" - } - }, - "etherspot-prime-sdk/node_modules/flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", - "dev": true, - "dependencies": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" }, - "engines": { - "node": ">=4" - } - }, - "etherspot-prime-sdk/node_modules/flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", - "dev": true - }, - "etherspot-prime-sdk/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" + "funding": { + "url": "https://github.com/sponsors/mysticatea" }, - "engines": { - "node": ">= 6" + "peerDependencies": { + "eslint": ">=5" } }, - "etherspot-prime-sdk/node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "etherspot-prime-sdk/node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "dependencies": { - "type-fest": "^0.8.1" - }, "engines": { - "node": ">=8" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "etherspot-prime-sdk/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "etherspot-prime-sdk/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "etherspot-prime-sdk/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "url": "https://opencollective.com/eslint" } }, - "etherspot-prime-sdk/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "etherspot-prime-sdk/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, "engines": { - "node": ">= 0.8.0" + "node": ">=4.0" } }, - "etherspot-prime-sdk/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "etherspot-prime-sdk/node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, + "etherspot-prime-sdk/node_modules/ethers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" } }, - "etherspot-prime-sdk/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "etherspot-prime-sdk/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "etherspot-prime-sdk/node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "etherspot-prime-sdk/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">= 0.8.0" + "node": ">=8" } }, "etherspot-prime-sdk/node_modules/prettier": { @@ -514,18 +440,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "etherspot-prime-sdk/node_modules/rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, "etherspot-prime-sdk/node_modules/rxjs": { "version": "6.6.7", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", @@ -537,37 +451,16 @@ "npm": ">=2.0.0" } }, - "etherspot-prime-sdk/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", - "dev": true, - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "etherspot-prime-sdk/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "etherspot-prime-sdk/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "etherspot-prime-sdk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "ansi-regex": "^4.1.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "etherspot-prime-sdk/node_modules/tslib": { @@ -575,37 +468,24 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, - "etherspot-prime-sdk/node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "etherspot-prime-sdk/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, + "etherspot-prime-sdk/node_modules/ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", "engines": { - "node": ">=8" - } - }, - "etherspot-prime-sdk/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" + "node": ">=8.3.0" }, - "bin": { - "which": "bin/which" + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -630,9 +510,9 @@ } }, "node_modules/@apollo/client": { - "version": "3.8.6", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.8.6.tgz", - "integrity": "sha512-FnHg3vhQP8tQzgBs6oTJCFFIbovelDGYujj6MK7CJneiHf62TJstCIO0Ot4A1h7XrgFEtgl8a/OgajQWqrTuYw==", + "version": "3.8.7", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.8.7.tgz", + "integrity": "sha512-DnQtFkQrCyxHTSa9gR84YRLmU/al6HeXcLZazVe+VxKBmx/Hj4rV8xWtzfWYX5ijartsqDR7SJgV037MATEecA==", "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", "@wry/context": "^0.7.3", @@ -1865,14 +1745,14 @@ } }, "node_modules/@lifi/sdk": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@lifi/sdk/-/sdk-2.2.3.tgz", - "integrity": "sha512-k5KFK5SRRqA1hGrQkkWPPhM0AYciAFyu6GLCJdDFUK6HM+No4qDQWT359K9mGU6FrXVhPMds58Imex/lj/XReQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@lifi/sdk/-/sdk-2.5.0.tgz", + "integrity": "sha512-wx/3Ff0DAfYyV8VSWSQ/Qiy3DlwdrIfG841hbwqJK3AGxK0ulunLl1rKpMQrRdEEwkqAFNKZuJ8by0lGf9YccQ==", "dependencies": { "@ethersproject/abi": "^5.7.0", "@ethersproject/contracts": "^5.7.0", - "@lifi/types": "^8.0.4", - "bignumber.js": "^9.1.1", + "@lifi/types": "^9.3.0", + "bignumber.js": "^9.1.2", "eth-rpc-errors": "^4.0.3", "ethers": "^5.7.2" } @@ -1982,9 +1862,9 @@ } }, "node_modules/@lifi/types": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/@lifi/types/-/types-8.7.1.tgz", - "integrity": "sha512-l7PO+0nk9bWDdixryYqQH6P868WLC6KLZD2+RizVv16Vw65X7I46aogyssq0Isz3oPiRing8m+haIdx+9Kdijw==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/@lifi/types/-/types-9.3.3.tgz", + "integrity": "sha512-XY8S6RZMPf5d8XR4Pux2Iko6scBmH60gHm5BtPX2BF7x5eqZJ1Umyv/ael9MvBtjIzs9mroJZ1NTUL4pdWVu9Q==", "dependencies": { "ethers": "^5.7.2" } @@ -2347,16 +2227,10 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, - "node_modules/@types/eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", - "dev": true - }, "node_modules/@types/json-schema": { - "version": "7.0.14", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz", - "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/json5": { @@ -2376,24 +2250,125 @@ "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", "dev": true }, + "node_modules/@types/qs": { + "version": "6.9.12", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.12.tgz", + "integrity": "sha512-bZcOkJ6uWrL0Qb2NAWKa7TBU+mJHPzhx9jjLL1KHF+XpzEcR7EXHvjbHlGtR/IsP1vyPrehuS6XqkmaePy//mg==", + "dev": true + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, "node_modules/@types/validator": { - "version": "13.11.5", - "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.11.5.tgz", - "integrity": "sha512-xW4qsT4UIYILu+7ZrBnfQdBYniZrMLYYK3wN9M/NdeIHgBN5pZI2/8Q7UfdWIcr5RLJv/OGENsx91JIpUUoC7Q==" - }, - "node_modules/@typescript-eslint/experimental-utils": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz", - "integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==", + "version": "13.11.10", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.11.10.tgz", + "integrity": "sha512-e2PNXoXLr6Z+dbfx5zSh9TRlXJrELycxiaXznp4S5+D2M3b9bqJEitNHA5923jhnB2zzFiZHa2f0SI1HoIahpg==" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.45.0.tgz", + "integrity": "sha512-CXXHNlf0oL+Yg021cxgOdMHNTXD17rHkq7iW6RFHoybdFgQBjU3yIXhhcPpGwr1CjZlo6ET8C6tzX5juQoXeGA==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.34.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" + "@typescript-eslint/scope-manager": "5.45.0", + "@typescript-eslint/type-utils": "5.45.0", + "@typescript-eslint/utils": "5.45.0", + "debug": "^4.3.4", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.45.0.tgz", + "integrity": "sha512-brvs/WSM4fKUmF5Ot/gEve6qYiCMjm6w4HkHPfS6ZNmxTS0m0iNN4yOChImaCkqc1hRwFGqUyanMXuGal6oyyQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.45.0", + "@typescript-eslint/types": "5.45.0", + "@typescript-eslint/typescript-estree": "5.45.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.45.0.tgz", + "integrity": "sha512-noDMjr87Arp/PuVrtvN3dXiJstQR1+XlQ4R1EvzG+NMgXi8CuMCXpb8JqNtFHKceVSQ985BZhfRdowJzbv4yKw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.45.0", + "@typescript-eslint/visitor-keys": "5.45.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.45.0.tgz", + "integrity": "sha512-DY7BXVFSIGRGFZ574hTEyLPRiQIvI/9oGcN8t1A7f6zIs6ftbrU0nhyV26ZW//6f85avkwrLag424n+fkuoJ1Q==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "5.45.0", + "@typescript-eslint/utils": "5.45.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -2401,24 +2376,42 @@ }, "peerDependencies": { "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.45.0.tgz", + "integrity": "sha512-QQij+u/vgskA66azc9dCmx+rev79PzX8uDHpsqSjEFtfF2gBUTRCpvYMh2gw2ghkJabNkPlSUCimsyBEQZd1DA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz", - "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==", + "version": "5.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.45.0.tgz", + "integrity": "sha512-maRhLGSzqUpFcZgXxg1qc/+H0bT36lHK4APhp0AEUVrpSwXiRAomm/JGjSG+kNUio5kAa3uekCYu/47cnGn5EQ==", "dev": true, "dependencies": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "@typescript-eslint/types": "5.45.0", + "@typescript-eslint/visitor-keys": "5.45.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -2430,35 +2423,67 @@ } } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, + "bin": { + "semver": "bin/semver.js" + }, "engines": { - "node": ">=4" + "node": ">=10" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/@typescript-eslint/utils": { + "version": "5.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.45.0.tgz", + "integrity": "sha512-OUg2JvsVI1oIee/SwiejTot2OxwU8a7UfTFMOdlhD2y+Hl6memUSL4s98bpUTo8EpVEr0lmwlU7JSu/p2QpSvA==", "dev": true, "dependencies": { - "yallist": "^4.0.0" + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.45.0", + "@typescript-eslint/types": "5.45.0", + "@typescript-eslint/typescript-estree": "5.45.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" }, "engines": { - "node": ">=10" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "node_modules/@typescript-eslint/utils/node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" + "eslint-visitor-keys": "^2.0.0" }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, "bin": { "semver": "bin/semver.js" }, @@ -2466,11 +2491,34 @@ "node": ">=10" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.45.0.tgz", + "integrity": "sha512-jc6Eccbn2RtQPr1s7th6jJWQHBHI6GBVQkCHoJFQ5UreaKm59Vxw+ynQUPPY2u2Amquc+7tmEoC2G52ApsGNNg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.45.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } }, "node_modules/@walletconnect/core": { "version": "2.10.0", @@ -3099,6 +3147,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/array.prototype.findlastindex": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", @@ -3424,12 +3481,18 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3563,13 +3626,13 @@ "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==" }, "node_modules/class-validator": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.0.tgz", - "integrity": "sha512-ct3ltplN8I9fOwUd8GrP8UQixwff129BkEtuWDKL5W45cQuLd19xqmTLu5ge78YDm/fdje6FMt0hGOhl0lii3A==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.1.tgz", + "integrity": "sha512-2VEG9JICxIqTpoK1eMzZqaV+u/EiwEJkMGzTrZf6sU/fwsnOITVgYJ8yojSy6CaXtO9V0Cc6ZQZ8h8m4UBuLwQ==", "dependencies": { - "@types/validator": "^13.7.10", - "libphonenumber-js": "^1.10.14", - "validator": "^13.7.0" + "@types/validator": "^13.11.8", + "libphonenumber-js": "^1.10.53", + "validator": "^13.9.0" } }, "node_modules/cli-cursor": { @@ -3638,15 +3701,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, - "node_modules/contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha512-OKZnPGeMQy2RPaUIBPFFd71iNf4791H12MCRuVQDnzGRwCYNYmTDy5pdafo2SLAcEMKzTOQnLWG4QdcjeJUMEg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -3660,11 +3714,11 @@ "dev": true }, "node_modules/cross-fetch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", - "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", "dependencies": { - "node-fetch": "2.6.7" + "node-fetch": "^2.6.12" } }, "node_modules/cross-spawn": { @@ -3786,16 +3840,19 @@ } }, "node_modules/define-data-property": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", - "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-lazy-prop": { @@ -3854,6 +3911,27 @@ "node": ">=0.3.1" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dir-glob/node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -3930,15 +4008,6 @@ "resolved": "https://registry.npmjs.org/erc-20-abi/-/erc-20-abi-1.0.0.tgz", "integrity": "sha512-X+kdxwbfegJ5quNHVyJPf72Y8g+rpurR3vA+K2b4jVUuAl3qHMYxnR7ZOJRC/T7kQu3V8XU4/U4mIJ+w5wUaeQ==" }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, "node_modules/es-abstract": { "version": "1.22.2", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", @@ -3991,6 +4060,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", @@ -5612,9 +5700,12 @@ "integrity": "sha512-xQVsnjJ/5pQtcKh+KjUoZGzVWn4uNkchxTF6Lwjr4Gf7nQr8fmUfhKJ62zE77+xQg9xnxi5KUps7XGs+VC986A==" }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/function.prototype.name": { "version": "1.1.6", @@ -5680,28 +5771,23 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -5780,6 +5866,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -5796,6 +5902,12 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -5881,11 +5993,11 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dependencies": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5936,6 +6048,17 @@ "minimalistic-assert": "^1.0.1" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -5971,12 +6094,6 @@ "react-is": "^16.7.0" } }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, "node_modules/human-signals": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", @@ -6198,12 +6315,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -6531,6 +6642,16 @@ "integrity": "sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==", "peer": true }, + "node_modules/js-sdsl": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.2.tgz", + "integrity": "sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", @@ -6632,24 +6753,9 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.10.48", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.48.tgz", - "integrity": "sha512-Vvcgt4+o8+puIBJZLdMshPYx9nRN3/kTT7HPtOyfYrSQuN9PGBF1KUv0g07fjNzt4E4GuA7FnsLb+WeAMzyRQg==" - }, - "node_modules/load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha512-3p6ZOGNbiX4CdvEd1VcE6yi78UrGNpjHO33noGwHCnT/o2fyllJDepsm8+mFFv/DvtwFHht5HIHSyOy5a+ChVQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=4" - } + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.11.2.tgz", + "integrity": "sha512-V9mGLlaXN1WETzqQvSu6qf6XVAr3nFuJvWsHcuzCCCo6xUKawwSxOPTpan5CGOSKTn5w/bQuCZcLPJkyysgC3w==" }, "node_modules/locate-path": { "version": "6.0.0", @@ -7349,6 +7455,12 @@ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -7361,9 +7473,9 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -7385,27 +7497,6 @@ "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", "peer": true }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -7590,29 +7681,28 @@ }, "node_modules/npm/node_modules/@colors/colors": { "version": "1.5.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", - "optional": true, "engines": { "node": ">=0.1.90" } }, "node_modules/npm/node_modules/@gar/promisify": { "version": "1.1.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/@npmcli/arborist": { "version": "6.2.7", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7659,7 +7749,7 @@ }, "node_modules/npm/node_modules/@npmcli/config": { "version": "6.1.5", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7677,7 +7767,7 @@ }, "node_modules/npm/node_modules/@npmcli/disparity-colors": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7689,7 +7779,7 @@ }, "node_modules/npm/node_modules/@npmcli/fs": { "version": "3.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7701,7 +7791,7 @@ }, "node_modules/npm/node_modules/@npmcli/git": { "version": "4.0.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7720,7 +7810,7 @@ }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { "version": "2.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7736,7 +7826,7 @@ }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { "version": "3.0.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7751,7 +7841,7 @@ }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { "version": "5.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7766,7 +7856,7 @@ }, "node_modules/npm/node_modules/@npmcli/move-file": { "version": "2.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -7779,7 +7869,7 @@ }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { "version": "2.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -7788,7 +7878,7 @@ }, "node_modules/npm/node_modules/@npmcli/node-gyp": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -7797,7 +7887,7 @@ }, "node_modules/npm/node_modules/@npmcli/package-json": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7809,7 +7899,7 @@ }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { "version": "6.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7821,7 +7911,7 @@ }, "node_modules/npm/node_modules/@npmcli/query": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7833,7 +7923,7 @@ }, "node_modules/npm/node_modules/@npmcli/run-script": { "version": "6.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7849,7 +7939,7 @@ }, "node_modules/npm/node_modules/@sigstore/protobuf-specs": { "version": "0.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -7858,7 +7948,7 @@ }, "node_modules/npm/node_modules/@tootallnate/once": { "version": "2.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -7867,7 +7957,7 @@ }, "node_modules/npm/node_modules/@tufjs/models": { "version": "1.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -7879,7 +7969,7 @@ }, "node_modules/npm/node_modules/abbrev": { "version": "2.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -7888,7 +7978,7 @@ }, "node_modules/npm/node_modules/abort-controller": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -7900,7 +7990,7 @@ }, "node_modules/npm/node_modules/agent-base": { "version": "6.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -7912,7 +8002,7 @@ }, "node_modules/npm/node_modules/agentkeepalive": { "version": "4.3.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -7926,7 +8016,7 @@ }, "node_modules/npm/node_modules/aggregate-error": { "version": "3.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -7939,7 +8029,7 @@ }, "node_modules/npm/node_modules/ansi-regex": { "version": "5.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -7948,7 +8038,7 @@ }, "node_modules/npm/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -7963,19 +8053,19 @@ }, "node_modules/npm/node_modules/aproba": { "version": "2.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/archy": { "version": "1.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/are-we-there-yet": { "version": "4.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -7988,13 +8078,13 @@ }, "node_modules/npm/node_modules/balanced-match": { "version": "1.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/base64-js": { "version": "1.5.1", - "dev": true, + "extraneous": true, "funding": [ { "type": "github", @@ -8014,7 +8104,7 @@ }, "node_modules/npm/node_modules/bin-links": { "version": "4.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8029,7 +8119,7 @@ }, "node_modules/npm/node_modules/binary-extensions": { "version": "2.2.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8038,7 +8128,7 @@ }, "node_modules/npm/node_modules/brace-expansion": { "version": "2.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8047,7 +8137,7 @@ }, "node_modules/npm/node_modules/buffer": { "version": "6.0.3", - "dev": true, + "extraneous": true, "funding": [ { "type": "github", @@ -8071,7 +8161,7 @@ }, "node_modules/npm/node_modules/builtins": { "version": "5.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8080,7 +8170,7 @@ }, "node_modules/npm/node_modules/cacache": { "version": "17.0.5", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8104,7 +8194,7 @@ }, "node_modules/npm/node_modules/chalk": { "version": "4.1.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8120,7 +8210,7 @@ }, "node_modules/npm/node_modules/chownr": { "version": "2.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -8129,7 +8219,7 @@ }, "node_modules/npm/node_modules/ci-info": { "version": "3.8.0", - "dev": true, + "extraneous": true, "funding": [ { "type": "github", @@ -8144,7 +8234,7 @@ }, "node_modules/npm/node_modules/cidr-regex": { "version": "3.1.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -8156,7 +8246,7 @@ }, "node_modules/npm/node_modules/clean-stack": { "version": "2.2.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8165,7 +8255,7 @@ }, "node_modules/npm/node_modules/cli-columns": { "version": "4.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8178,7 +8268,7 @@ }, "node_modules/npm/node_modules/cli-table3": { "version": "0.6.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8193,7 +8283,7 @@ }, "node_modules/npm/node_modules/clone": { "version": "1.0.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8202,7 +8292,7 @@ }, "node_modules/npm/node_modules/cmd-shim": { "version": "6.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -8211,7 +8301,7 @@ }, "node_modules/npm/node_modules/color-convert": { "version": "2.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8223,13 +8313,13 @@ }, "node_modules/npm/node_modules/color-name": { "version": "1.1.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/color-support": { "version": "1.1.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "bin": { @@ -8238,7 +8328,7 @@ }, "node_modules/npm/node_modules/columnify": { "version": "1.6.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8251,25 +8341,25 @@ }, "node_modules/npm/node_modules/common-ancestor-path": { "version": "1.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/concat-map": { "version": "0.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/console-control-strings": { "version": "1.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/cssesc": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "bin": { @@ -8281,7 +8371,7 @@ }, "node_modules/npm/node_modules/debug": { "version": "4.3.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8298,13 +8388,13 @@ }, "node_modules/npm/node_modules/debug/node_modules/ms": { "version": "2.1.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/defaults": { "version": "1.0.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8316,13 +8406,13 @@ }, "node_modules/npm/node_modules/delegates": { "version": "1.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/depd": { "version": "2.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8331,7 +8421,7 @@ }, "node_modules/npm/node_modules/diff": { "version": "5.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "BSD-3-Clause", "engines": { @@ -8340,23 +8430,22 @@ }, "node_modules/npm/node_modules/emoji-regex": { "version": "8.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/encoding": { "version": "0.1.13", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", - "optional": true, "dependencies": { "iconv-lite": "^0.6.2" } }, "node_modules/npm/node_modules/env-paths": { "version": "2.2.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8365,13 +8454,13 @@ }, "node_modules/npm/node_modules/err-code": { "version": "2.0.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/event-target-shim": { "version": "5.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8380,7 +8469,7 @@ }, "node_modules/npm/node_modules/events": { "version": "3.3.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8389,7 +8478,7 @@ }, "node_modules/npm/node_modules/fastest-levenshtein": { "version": "1.0.16", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8398,7 +8487,7 @@ }, "node_modules/npm/node_modules/fs-minipass": { "version": "3.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8410,19 +8499,19 @@ }, "node_modules/npm/node_modules/fs.realpath": { "version": "1.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/function-bind": { "version": "1.1.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/gauge": { "version": "5.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8441,7 +8530,7 @@ }, "node_modules/npm/node_modules/glob": { "version": "9.3.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8459,13 +8548,13 @@ }, "node_modules/npm/node_modules/graceful-fs": { "version": "4.2.11", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/has": { "version": "1.0.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8477,7 +8566,7 @@ }, "node_modules/npm/node_modules/has-flag": { "version": "4.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8486,13 +8575,13 @@ }, "node_modules/npm/node_modules/has-unicode": { "version": "2.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/hosted-git-info": { "version": "6.1.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8504,13 +8593,13 @@ }, "node_modules/npm/node_modules/http-cache-semantics": { "version": "4.1.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "BSD-2-Clause" }, "node_modules/npm/node_modules/http-proxy-agent": { "version": "5.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8524,7 +8613,7 @@ }, "node_modules/npm/node_modules/https-proxy-agent": { "version": "5.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8537,7 +8626,7 @@ }, "node_modules/npm/node_modules/humanize-ms": { "version": "1.2.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8546,10 +8635,9 @@ }, "node_modules/npm/node_modules/iconv-lite": { "version": "0.6.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", - "optional": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -8559,7 +8647,7 @@ }, "node_modules/npm/node_modules/ieee754": { "version": "1.2.1", - "dev": true, + "extraneous": true, "funding": [ { "type": "github", @@ -8579,7 +8667,7 @@ }, "node_modules/npm/node_modules/ignore-walk": { "version": "6.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8591,7 +8679,7 @@ }, "node_modules/npm/node_modules/imurmurhash": { "version": "0.1.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8600,7 +8688,7 @@ }, "node_modules/npm/node_modules/indent-string": { "version": "4.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8609,13 +8697,13 @@ }, "node_modules/npm/node_modules/infer-owner": { "version": "1.0.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/inflight": { "version": "1.0.6", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8625,13 +8713,13 @@ }, "node_modules/npm/node_modules/inherits": { "version": "2.0.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/ini": { "version": "3.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -8640,7 +8728,7 @@ }, "node_modules/npm/node_modules/init-package-json": { "version": "5.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8658,13 +8746,13 @@ }, "node_modules/npm/node_modules/ip": { "version": "2.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/ip-regex": { "version": "4.3.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8673,7 +8761,7 @@ }, "node_modules/npm/node_modules/is-cidr": { "version": "4.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -8685,7 +8773,7 @@ }, "node_modules/npm/node_modules/is-core-module": { "version": "2.11.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -8697,7 +8785,7 @@ }, "node_modules/npm/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8706,19 +8794,19 @@ }, "node_modules/npm/node_modules/is-lambda": { "version": "1.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/isexe": { "version": "2.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/json-parse-even-better-errors": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -8727,7 +8815,7 @@ }, "node_modules/npm/node_modules/json-stringify-nice": { "version": "1.1.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "funding": { @@ -8736,28 +8824,28 @@ }, "node_modules/npm/node_modules/jsonparse": { "version": "1.3.1", - "dev": true, "engines": [ "node >= 0.2.0" ], + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/just-diff": { "version": "6.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/just-diff-apply": { "version": "5.5.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { "version": "7.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8770,7 +8858,7 @@ }, "node_modules/npm/node_modules/libnpmdiff": { "version": "5.0.15", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8790,7 +8878,7 @@ }, "node_modules/npm/node_modules/libnpmexec": { "version": "5.0.15", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8813,7 +8901,7 @@ }, "node_modules/npm/node_modules/libnpmfund": { "version": "4.0.15", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8825,7 +8913,7 @@ }, "node_modules/npm/node_modules/libnpmhook": { "version": "9.0.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8838,7 +8926,7 @@ }, "node_modules/npm/node_modules/libnpmorg": { "version": "5.0.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8851,7 +8939,7 @@ }, "node_modules/npm/node_modules/libnpmpack": { "version": "5.0.15", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8866,7 +8954,7 @@ }, "node_modules/npm/node_modules/libnpmpublish": { "version": "7.1.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8885,7 +8973,7 @@ }, "node_modules/npm/node_modules/libnpmsearch": { "version": "6.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8897,7 +8985,7 @@ }, "node_modules/npm/node_modules/libnpmteam": { "version": "5.0.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8910,7 +8998,7 @@ }, "node_modules/npm/node_modules/libnpmversion": { "version": "4.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8926,7 +9014,7 @@ }, "node_modules/npm/node_modules/lru-cache": { "version": "7.18.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -8935,7 +9023,7 @@ }, "node_modules/npm/node_modules/make-fetch-happen": { "version": "11.0.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8961,7 +9049,7 @@ }, "node_modules/npm/node_modules/minimatch": { "version": "7.4.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8976,7 +9064,7 @@ }, "node_modules/npm/node_modules/minipass": { "version": "4.2.5", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -8985,7 +9073,7 @@ }, "node_modules/npm/node_modules/minipass-collect": { "version": "1.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -8997,7 +9085,7 @@ }, "node_modules/npm/node_modules/minipass-collect/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9009,7 +9097,7 @@ }, "node_modules/npm/node_modules/minipass-fetch": { "version": "3.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9026,7 +9114,7 @@ }, "node_modules/npm/node_modules/minipass-flush": { "version": "1.0.5", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9038,7 +9126,7 @@ }, "node_modules/npm/node_modules/minipass-flush/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9050,7 +9138,7 @@ }, "node_modules/npm/node_modules/minipass-json-stream": { "version": "1.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9060,7 +9148,7 @@ }, "node_modules/npm/node_modules/minipass-json-stream/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9072,7 +9160,7 @@ }, "node_modules/npm/node_modules/minipass-pipeline": { "version": "1.2.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9084,7 +9172,7 @@ }, "node_modules/npm/node_modules/minipass-pipeline/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9096,7 +9184,7 @@ }, "node_modules/npm/node_modules/minipass-sized": { "version": "1.0.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9108,7 +9196,7 @@ }, "node_modules/npm/node_modules/minipass-sized/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9120,7 +9208,7 @@ }, "node_modules/npm/node_modules/minizlib": { "version": "2.1.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9133,7 +9221,7 @@ }, "node_modules/npm/node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9145,7 +9233,7 @@ }, "node_modules/npm/node_modules/mkdirp": { "version": "1.0.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "bin": { @@ -9157,13 +9245,13 @@ }, "node_modules/npm/node_modules/ms": { "version": "2.1.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/mute-stream": { "version": "1.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -9172,7 +9260,7 @@ }, "node_modules/npm/node_modules/negotiator": { "version": "0.6.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -9181,7 +9269,7 @@ }, "node_modules/npm/node_modules/node-gyp": { "version": "9.3.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9205,7 +9293,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/@npmcli/fs": { "version": "2.1.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9218,13 +9306,13 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/abbrev": { "version": "1.1.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/node-gyp/node_modules/are-we-there-yet": { "version": "3.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9237,7 +9325,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9247,7 +9335,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/cacache": { "version": "16.1.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9276,7 +9364,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/cacache/node_modules/brace-expansion": { "version": "2.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9285,7 +9373,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/cacache/node_modules/glob": { "version": "8.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9304,7 +9392,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/cacache/node_modules/minimatch": { "version": "5.1.6", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9316,7 +9404,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/fs-minipass": { "version": "2.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9328,7 +9416,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/gauge": { "version": "4.0.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9347,7 +9435,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/glob": { "version": "7.2.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9367,7 +9455,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/make-fetch-happen": { "version": "10.2.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9394,7 +9482,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/minimatch": { "version": "3.1.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9406,7 +9494,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9418,7 +9506,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/minipass-fetch": { "version": "2.1.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9435,7 +9523,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/nopt": { "version": "6.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9450,7 +9538,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/npmlog": { "version": "6.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9465,7 +9553,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/readable-stream": { "version": "3.6.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9479,7 +9567,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/ssri": { "version": "9.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9491,7 +9579,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/unique-filename": { "version": "2.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9503,7 +9591,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/unique-slug": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9515,7 +9603,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/which": { "version": "2.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9530,7 +9618,7 @@ }, "node_modules/npm/node_modules/nopt": { "version": "7.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9545,7 +9633,7 @@ }, "node_modules/npm/node_modules/normalize-package-data": { "version": "5.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -9560,7 +9648,7 @@ }, "node_modules/npm/node_modules/npm-audit-report": { "version": "4.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9572,7 +9660,7 @@ }, "node_modules/npm/node_modules/npm-bundled": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9584,7 +9672,7 @@ }, "node_modules/npm/node_modules/npm-install-checks": { "version": "6.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -9596,7 +9684,7 @@ }, "node_modules/npm/node_modules/npm-normalize-package-bin": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -9605,7 +9693,7 @@ }, "node_modules/npm/node_modules/npm-package-arg": { "version": "10.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9620,7 +9708,7 @@ }, "node_modules/npm/node_modules/npm-packlist": { "version": "7.0.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9632,7 +9720,7 @@ }, "node_modules/npm/node_modules/npm-pick-manifest": { "version": "8.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9647,7 +9735,7 @@ }, "node_modules/npm/node_modules/npm-profile": { "version": "7.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9660,7 +9748,7 @@ }, "node_modules/npm/node_modules/npm-registry-fetch": { "version": "14.0.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9678,7 +9766,7 @@ }, "node_modules/npm/node_modules/npm-user-validate": { "version": "2.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "BSD-2-Clause", "engines": { @@ -9687,7 +9775,7 @@ }, "node_modules/npm/node_modules/npmlog": { "version": "7.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9702,7 +9790,7 @@ }, "node_modules/npm/node_modules/once": { "version": "1.4.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9711,7 +9799,7 @@ }, "node_modules/npm/node_modules/p-map": { "version": "4.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9726,7 +9814,7 @@ }, "node_modules/npm/node_modules/pacote": { "version": "15.1.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9758,7 +9846,7 @@ }, "node_modules/npm/node_modules/parse-conflict-json": { "version": "3.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9772,7 +9860,7 @@ }, "node_modules/npm/node_modules/path-is-absolute": { "version": "1.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -9781,7 +9869,7 @@ }, "node_modules/npm/node_modules/path-scurry": { "version": "1.6.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -9797,7 +9885,7 @@ }, "node_modules/npm/node_modules/postcss-selector-parser": { "version": "6.0.11", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9810,7 +9898,7 @@ }, "node_modules/npm/node_modules/proc-log": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -9819,7 +9907,7 @@ }, "node_modules/npm/node_modules/process": { "version": "0.11.10", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -9828,7 +9916,7 @@ }, "node_modules/npm/node_modules/promise-all-reject-late": { "version": "1.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "funding": { @@ -9837,7 +9925,7 @@ }, "node_modules/npm/node_modules/promise-call-limit": { "version": "1.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "funding": { @@ -9846,13 +9934,13 @@ }, "node_modules/npm/node_modules/promise-inflight": { "version": "1.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/promise-retry": { "version": "2.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9865,7 +9953,7 @@ }, "node_modules/npm/node_modules/promzard": { "version": "1.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9877,7 +9965,7 @@ }, "node_modules/npm/node_modules/qrcode-terminal": { "version": "0.12.0", - "dev": true, + "extraneous": true, "inBundle": true, "bin": { "qrcode-terminal": "bin/qrcode-terminal.js" @@ -9885,7 +9973,7 @@ }, "node_modules/npm/node_modules/read": { "version": "2.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9897,7 +9985,7 @@ }, "node_modules/npm/node_modules/read-cmd-shim": { "version": "4.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -9906,7 +9994,7 @@ }, "node_modules/npm/node_modules/read-package-json": { "version": "6.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9921,7 +10009,7 @@ }, "node_modules/npm/node_modules/read-package-json-fast": { "version": "3.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9934,7 +10022,7 @@ }, "node_modules/npm/node_modules/readable-stream": { "version": "4.3.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9949,7 +10037,7 @@ }, "node_modules/npm/node_modules/retry": { "version": "0.12.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -9958,7 +10046,7 @@ }, "node_modules/npm/node_modules/rimraf": { "version": "3.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -9973,7 +10061,7 @@ }, "node_modules/npm/node_modules/rimraf/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -9983,7 +10071,7 @@ }, "node_modules/npm/node_modules/rimraf/node_modules/glob": { "version": "7.2.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10003,7 +10091,7 @@ }, "node_modules/npm/node_modules/rimraf/node_modules/minimatch": { "version": "3.1.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10015,20 +10103,19 @@ }, "node_modules/npm/node_modules/safe-buffer": { "version": "5.1.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", - "dev": true, + "extraneous": true, "inBundle": true, - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/npm/node_modules/semver": { "version": "7.3.8", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10043,7 +10130,7 @@ }, "node_modules/npm/node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10055,19 +10142,19 @@ }, "node_modules/npm/node_modules/set-blocking": { "version": "2.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/signal-exit": { "version": "3.0.7", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/sigstore": { "version": "1.2.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -10084,7 +10171,7 @@ }, "node_modules/npm/node_modules/smart-buffer": { "version": "4.2.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -10094,7 +10181,7 @@ }, "node_modules/npm/node_modules/socks": { "version": "2.7.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -10108,7 +10195,7 @@ }, "node_modules/npm/node_modules/socks-proxy-agent": { "version": "7.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -10122,7 +10209,7 @@ }, "node_modules/npm/node_modules/spdx-correct": { "version": "3.2.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -10132,13 +10219,13 @@ }, "node_modules/npm/node_modules/spdx-exceptions": { "version": "2.3.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "CC-BY-3.0" }, "node_modules/npm/node_modules/spdx-expression-parse": { "version": "3.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -10148,13 +10235,13 @@ }, "node_modules/npm/node_modules/spdx-license-ids": { "version": "3.0.13", - "dev": true, + "extraneous": true, "inBundle": true, "license": "CC0-1.0" }, "node_modules/npm/node_modules/ssri": { "version": "10.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10166,7 +10253,7 @@ }, "node_modules/npm/node_modules/string_decoder": { "version": "1.1.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -10175,7 +10262,7 @@ }, "node_modules/npm/node_modules/string-width": { "version": "4.2.3", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -10189,7 +10276,7 @@ }, "node_modules/npm/node_modules/strip-ansi": { "version": "6.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -10201,7 +10288,7 @@ }, "node_modules/npm/node_modules/supports-color": { "version": "7.2.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -10213,7 +10300,7 @@ }, "node_modules/npm/node_modules/tar": { "version": "6.1.13", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10230,7 +10317,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10242,7 +10329,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10254,19 +10341,19 @@ }, "node_modules/npm/node_modules/text-table": { "version": "0.2.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/tiny-relative-date": { "version": "1.3.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/treeverse": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "engines": { @@ -10275,7 +10362,7 @@ }, "node_modules/npm/node_modules/tuf-js": { "version": "1.1.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -10288,7 +10375,7 @@ }, "node_modules/npm/node_modules/unique-filename": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10300,7 +10387,7 @@ }, "node_modules/npm/node_modules/unique-slug": { "version": "4.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10312,13 +10399,13 @@ }, "node_modules/npm/node_modules/util-deprecate": { "version": "1.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/validate-npm-package-license": { "version": "3.0.4", - "dev": true, + "extraneous": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -10328,7 +10415,7 @@ }, "node_modules/npm/node_modules/validate-npm-package-name": { "version": "5.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10340,13 +10427,13 @@ }, "node_modules/npm/node_modules/walk-up-path": { "version": "1.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/wcwidth": { "version": "1.0.1", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -10355,7 +10442,7 @@ }, "node_modules/npm/node_modules/which": { "version": "3.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10370,7 +10457,7 @@ }, "node_modules/npm/node_modules/wide-align": { "version": "1.1.5", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10379,13 +10466,13 @@ }, "node_modules/npm/node_modules/wrappy": { "version": "1.0.2", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/write-file-atomic": { "version": "5.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -10398,7 +10485,7 @@ }, "node_modules/npm/node_modules/yallist": { "version": "4.0.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "ISC" }, @@ -10411,9 +10498,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10600,15 +10687,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -10620,18 +10698,6 @@ "node": ">=6" } }, - "node_modules/parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", - "dev": true, - "dependencies": { - "error-ex": "^1.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -10661,18 +10727,6 @@ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, - "node_modules/path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha512-dUnb5dXUf+kzhC/W/F4e5/SkluXIFf5VUHolW1Eg1irn1hGWjPGdsRcvYJ1nD6lhk8Ir7VM0bHJKsYTx8Jx9OQ==", - "dev": true, - "dependencies": { - "pify": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -10697,15 +10751,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/pino": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/pino/-/pino-7.11.0.tgz", @@ -10750,9 +10795,9 @@ } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "bin": { "prettier": "bin/prettier.cjs" }, @@ -10810,6 +10855,20 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.0.tgz", + "integrity": "sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/query-string": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz", @@ -10864,91 +10923,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, - "node_modules/read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha512-eFIBOPW7FGjzBuk3hdXEuNSiTZS/xEMlH49HxMyzb0hyPfu4EhVjT2DH32K1hSSmVq4sebAWnZuuY5auISUTGA==", - "dev": true, - "dependencies": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha512-1orxQfbWGUiTn9XsPlChs6rLie/AV9jwZTGmu2NZw/CUDJQchXJFYE0Fq5j7+n558T1JhDWLdhyd1Zj+wLY//w==", - "dev": true, - "dependencies": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", - "dev": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -10994,9 +10968,9 @@ } }, "node_modules/reflect-metadata": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz", + "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==" }, "node_modules/regexp.prototype.flags": { "version": "1.5.1", @@ -11349,6 +11323,22 @@ "randombytes": "^2.1.0" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/set-function-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", @@ -11399,13 +11389,17 @@ } }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -11416,6 +11410,15 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", @@ -11454,38 +11457,6 @@ "node": ">=0.10.0" } }, - "node_modules/spdx-correct": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", - "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", - "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==", - "dev": true - }, "node_modules/split-on-first": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", @@ -12256,16 +12227,6 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "node_modules/validator": { "version": "13.11.0", "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", diff --git a/package.json b/package.json index 3ec780d..f0bc25c 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "mochawesome": "^7.1.3", "mochawesome-report-generator": "^6.2.0", "mysql2": "^3.6.5", - "prettier": "^3.0.0", + "prettier": "^3.2.5", "reflect-metadata": "^0.1.13", "rxjs": "^7.8.1", "ws": "^8.13.0" diff --git a/test/data/constant.json b/test/data/constant.json index 516fbbf..e235e11 100644 --- a/test/data/constant.json +++ b/test/data/constant.json @@ -1,57 +1,57 @@ { - "invalid_address_1": "account must be an address", - "invalid_address_2": "fromTokenAddress must be an address", - "invalid_address_3": "toTokenAddress must be an address", - "invalid_address_4": "invalid address", - "invalid_address_5": "The given address is invalid. Please try again with valid address", - "invalid_address_6": "bad address checksum", - "invalid_address_7": "fromAddress must be an address", - "invalid_address_8": "toAddress must be an address", - "invalid_address_9": "querystring must have required property 'fromChainId'", - "invalid_address_10": "querystring must have required property 'toChainId'", - "invalid_address_11": "fromToken must be an address", - "invalid_address_12": "toToken must be an address", - "invalid_address_13": "querystring must have required property 'slippage'", - "contract_address_1": "provider is required to use ENS name as contract address", - "contract_address_2": "invalid contract address or ENS name", + "invalid_address_1": "account must be an address", + "invalid_address_2": "fromTokenAddress must be an address", + "invalid_address_3": "toTokenAddress must be an address", + "invalid_address_4": "invalid address", + "invalid_address_5": "The given address is invalid. Please try again with valid address", + "invalid_address_6": "bad address checksum", + "invalid_address_7": "fromAddress must be an address", + "invalid_address_8": "toAddress must be an address", + "invalid_address_9": "querystring must have required property 'fromChainId'", + "invalid_address_10": "querystring must have required property 'toChainId'", + "invalid_address_11": "fromToken must be an address", + "invalid_address_12": "toToken must be an address", + "invalid_address_13": "querystring must have required property 'slippage'", + "contract_address_1": "provider is required to use ENS name as contract address", + "contract_address_2": "invalid contract address or ENS name", - "invalid_chainid_1": "fromChainId", - "invalid_chainid_2": "toChainId", - "invalid_chainid_3": "chainId must be a positive number", - "invalid_chainid_4": "fromChainId must be a positive number", - "invalid_chainid_5": "toChainId must be a positive number", - "invalid_chainid_6": "Chain not supported", + "invalid_chainid_1": "fromChainId", + "invalid_chainid_2": "toChainId", + "invalid_chainid_3": "chainId must be a positive number", + "invalid_chainid_4": "fromChainId must be a positive number", + "invalid_chainid_5": "toChainId must be a positive number", + "invalid_chainid_6": "Chain not supported", - "property_undefined": "Cannot set properties of undefined", - "remove_whitelist_1": "is not whitelisted", - "remove_whitelist_2": "Successfully removed whitelisted addresses with transaction Hash", - "add_whitelist_1": "Successfully whitelisted with transaction Hash", - "add_whitelist_2": "already whitelisted", - "add_whitelist_3": "Successfully whitelisted with transaction Hash", - "check_whitelist_1": "Already added", - "check_whitelist_2": "Not added yet", - "deposit_1": "Successfully deposited", - - "invalid_network_1": "Invalid network/token", - "invalid_network_2": "could not detect network", - "invalid_network_3": "Unsupported network", - - "invalid_value_1": "invalid decimal value", - "invalid_value_2": "fractional component exceeds decimals", - "invalid_value_3": "call revert exception", - "invalid_value_4": "types/values length mismatch", - "invalid_bignumber_1": "invalid BigNumber string", - "invalid_bignumber_2": "fromAmount must be positive big numberish", - "invalid_bignumber_3":"fromAmount must be big numberish", - "hash_32": "hash must be hex with 32 size", + "property_undefined": "Cannot set properties of undefined", + "remove_whitelist_1": "is not whitelisted", + "remove_whitelist_2": "Successfully removed whitelisted addresses with transaction Hash", + "add_whitelist_1": "Successfully whitelisted with transaction Hash", + "add_whitelist_2": "already whitelisted", + "add_whitelist_3": "Successfully whitelisted with transaction Hash", + "check_whitelist_1": "Already added", + "check_whitelist_2": "Not added yet", + "deposit_1": "Successfully deposited", - "invalid_parameter": "Make sure the sdk fn called has valid parameters", - "empty_batch": "cannot sign empty transaction batch", - "no_function": "no matching function", - "not_found": "Not Found", - "exceed_slippage": "invalid json response body", - "transactionHash_32hex": "transactionHash must be hex with 32 size", - - "invalid_apiKey": "Invalid Api Key", - "invalid_data": "Invalid data provided" -} \ No newline at end of file + "invalid_network_1": "Invalid network/token", + "invalid_network_2": "could not detect network", + "invalid_network_3": "Unsupported network", + + "invalid_value_1": "invalid decimal value", + "invalid_value_2": "fractional component exceeds decimals", + "invalid_value_3": "call revert exception", + "invalid_value_4": "types/values length mismatch", + "invalid_bignumber_1": "invalid BigNumber string", + "invalid_bignumber_2": "fromAmount must be positive big numberish", + "invalid_bignumber_3": "fromAmount must be big numberish", + "hash_32": "hash must be hex with 32 size", + + "invalid_parameter": "Make sure the sdk fn called has valid parameters", + "empty_batch": "cannot sign empty transaction batch", + "no_function": "no matching function", + "not_found": "Not Found", + "exceed_slippage": "invalid json response body", + "transactionHash_32hex": "transactionHash must be hex with 32 size", + + "invalid_apiKey": "Invalid Api Key", + "invalid_data": "Invalid data provided" +} diff --git a/test/data/messages.json b/test/data/messages.json index 9271511..a2f8ea3 100644 --- a/test/data/messages.json +++ b/test/data/messages.json @@ -1,529 +1,529 @@ { - "_comment1": "Common Validation", - "vali_eoa_address": "The EOA Address is not calculated correctly.", - "fail_sdk_initialize": "The SDK is not initialled successfully.", - "vali_smart_address": "The Etherspot Wallet Address is not calculated correctly.", - "fail_smart_address": "The Etherspot Wallet Address is not displayed successfully.", - "fail_data_service": "The Data service is not initialled successfully.", - "fail_arka_initialize": "An error is displayed while initializating ArkaPaymaster.", - "fail_wallet_balance": "Validation of the balance of the wallet is not performed.", - "skip_transaction_error": "An error is displayed due to multiple transactions in short period, So skipping the test case.", - "_comment2": "Get Address", - "vali_zero_dev": "The Zero Dev Address is not calculated correctly.", - "fail_zero_dev": "The Zero Dev Address is not displayed successfully.", - "vali_simple_account": "The SimpleAccount Address is not calculated correctly.", - "fail_simple_account": "The SimpleAccount Address is not displayed successfully.", - "vali_account_address": "The Account Address is not calculated correctly.", - "fail_account_address": "The Account Address is not displayed successfully.", - "_comment3": "List and rates - NFT List", - "pass_nftList_1": "The items are available in the NFT list.", - "pass_nftList_2": "The items are not available in the NFT list.", - "pass_nftList_3": "The validation is displayed while getting the NFT list with invalid account address", - "pass_nftList_4": "The validation is displayed while getting the NFT list with inncorrect account address", - "fail_nftList_1": "The get NFT list is not performed correctly.", - "fail_nftList_2": "The respective validate is not displayed for the NFT List with invalid account address", - "fail_nftList_3": "The respective validate is not displayed for the NFT List with incorrect account address", - "vali_nftList_contractName": "The contractName value is empty in the NFT list response.", - "vali_nftList_contractAddress": "The contractAddress value is empty in the NFT list response.", - "vali_nftList_tokenType": "The tokenType value is empty in the NFT list response.", - "vali_nftList_balance": "The balance value is not number in the NFT list response.", - "vali_nftList_items_tokenId": "The tokenId value of the items is empty in the NFT list response.", - "vali_nftList_items_name": "The name value of the items is empty in the NFT list response.", - "vali_nftList_items_amount": "The amount value of the items is not number in the NFT list response.", - "nftList_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE NFT LIST", - "_comment4": "List and rates - Token List", - "pass_tokenList_1": "The items are available in the token list.", - "pass_tokenList_2": "The items are not available in the tokenLists list.", - "pass_tokenList_3": "The tokens are available in the token list tokens.", - "pass_tokenList_4": "The Tokens are not available in the tokenListTokens list.", - "pass_tokenList_5": "The tokens are available in the token list tokens with selected provider.", - "pass_tokenList_6": "The Tokens are not available in the tokenListTokens list with selected provider.", - "fail_tokenList_1": "The get token list is not performed correctly.", - "vali_tokenList_name": "The name value is empty in the token list response.", - "vali_tokenList_endpoint": "The endpoint value is empty in the token list response.", - "vali_tokenListTokens_address": "The address value is empty in the token list tokens response.", - "vali_tokenListTokens_name": "The name value is empty in the token list tokens response.", - "vali_tokenListTokens_symbol": "The symbol value is empty in the token list tokens response.", - "vali_tokenListTokens_decimals": "The decimals value is not number in the token list tokens response.", - "vali_tokenListTokens_logoURI": "The logoURI value is empty in the token list tokens response.", - "vali_tokenListTokens_chainId": "The chainId value is not number in the token list tokens response.", - "vali_selectedTokenListTokens_address": "The address value is empty in the selected token list tokens response.", - "vali_selectedTokenListTokens_name": "The name value is empty in the selected token list tokens response.", - "vali_selectedTokenListTokens_symbol": "The symbol value is empty in the selected token list tokens response.", - "vali_selectedTokenListTokens_decimals": "The decimals value is not number in the selected token list tokens response.", - "vali_selectedTokenListTokens_logoURI": "The logoURI value is empty in the selected token list tokens response.", - "vali_selectedTokenListTokens_chainId": "The chainId value is not number in the selected token list tokens response.", - "tokenList_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE TOKEN LIST", - "_comment5": "List and rates - Exchange Rates", - "pass_exchangeRates_1": "The validation is displayed with invalid Token Address while fetching the exchange rates.", - "pass_exchangeRates_2": "The validation is displayed with incorrect Token Address while fetching the exchange rates.", - "pass_exchangeRates_3": "The validation is displayed when not added the token address while fetching the exchnage rates", - "pass_exchangeRates_4": "The validation is displayed invalid ChainID while fetching the exchange rates.", - "pass_exchangeRates_5": "The validation is displayed without ChainID while fetching the exchange rates.", - "fail_exchangeRates_1": "The fetch exchange rates are not performed correctly.", - "fail_exchangeRates_2": "An error is displayed with other Token Address while fetching the exchange rates.", - "fail_exchangeRates_3": "The respective validate is not displayed with invalid Token Address while fetching the exchange rates.", - "fail_exchangeRates_4": "The respective validate is not displayed with incorrect Token Address while fetching the exchange rates.", - "fail_exchangeRates_5": "The respective validate is not displayed when not added the token address while fetching the exchnage rates.", - "fail_exchangeRates_6": "The respective validate is not displayed invalid ChainID while fetching the exchange rates.", - "fail_exchangeRates_7": "The respective validate is not displayed without ChainID while fetching the exchange rates.", - "vali_exchangeRates_address": "The address value is empty in the rate list response.", - "vali_exchangeRates_eth": "The eth value is not number in the rate list response.", - "vali_exchangeRates_eur": "The eur value is not number in the rate list response.", - "vali_exchangeRates_gbp": "The gbp value is not number in the rate list response.", - "vali_exchangeRates_usd": "The usd value is not number in the rate list response.", - "exchangeRates_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE EXCHANGE RATE", - "_comment6": "Paymaster - Transfer native token on arka paymaster", - "fail_clearTransaction_1": "The transaction of the batch is not clear correctly.", - "vali_addTransaction_to": "The To Address value is empty in the add transactions to batch response.", - "vali_addTransaction_data": "The data value is empty in the add transactions to batch response.", - "vali_addTransaction_value": "The value value is empty in the add transactions to batch response.", - "vali_addTransaction_1": "The validation for transactionBatch is displayed as expected while adding transactions to the batch with invalid value.", - "fail_addTransaction_1": "The addition of transaction in the batch is not performed.", - "fail_addTransaction_2": "The add transactions to the batch is performed with invalid value.", - "fail_addTransaction_3": "The validation is not displayed for the transactionBatch while adding transactions to the batch with invalid value.", - "vali_getBalance_balance": "The balance is empty in the get native balance response.", - "fail_getBalance_1": "The balance of the native token is not displayed.", - "vali_estimateTransaction_sender": "The sender value is empty while estimating the transaction.", - "vali_estimateTransaction_nonce": "The nonce value is empty while estimating the transaction.", - "vali_estimateTransaction_initCode": "The initCode value is empty while estimating the transaction.", - "vali_estimateTransaction_callData": "The callData value is empty while estimating the transaction.", - "vali_estimateTransaction_callGasLimit": "The callGasLimit value is empty while estimating the transaction.", - "vali_estimateTransaction_verificationGasLimit": "The verificationGasLimit value is empty while estimating the transaction.", - "vali_estimateTransaction_maxFeePerGas": "The maxFeePerGas value is empty while estimating the transaction.", - "vali_estimateTransaction_maxPriorityFeePerGas": "The maxPriorityFeePerGas value is empty while estimating the transaction.", - "vali_estimateTransaction_paymasterAndData": "The paymasterAndData value is empty while estimating the transaction.", - "vali_estimateTransaction_preVerificationGas": "The preVerificationGas value is empty while estimating the transaction.", - "vali_estimateTransaction_signature": "The signature value is empty while estimating the transaction.", - "vali_estimateTransaction_1": "The validation is displayed when invalid paymaster url added while estimation.", - "vali_estimateTransaction_2": "The validation is displayed when paymaster url not added while estimation.", - "vali_estimateTransaction_3": "The validation is displayed when invalid API Key added while estimation.", - "vali_estimateTransaction_4": "The validation is displayed when incorrect API Key added while estimation.", - "vali_estimateTransaction_5": "The validation is displayed when API Key not added while estimation.", - "vali_estimateTransaction_6": "The validation is displayed when invalid chainid added while estimation.", - "vali_estimateTransaction_7": "The validation is displayed when chainid not added while estimation.", - "vali_estimateTransaction_8": "The validation is displayed when incorrect To Address added while estimation.", - "vali_estimateTransaction_9": "The validation is displayed when invalid To Address added while estimation.", - "vali_estimateTransaction_10": "The validation is displayed when invalid value added while estimation.", - "vali_estimateTransaction_11": "The validation is displayed when very small value added while estimation.", - "vali_estimateTransaction_12": "The validation is displayed when not added the transaction to the batch while estimation.", - "vali_estimateTransaction_13": "The validation is displayed when provider not added while estimation.", - "vali_estimateTransaction_14": "The validation is displayed when other provider added while estimation.", - "vali_estimateTransaction_15": "The validation is displayed when incorrect token address added while estimation.", - "vali_estimateTransaction_16": "The validation is displayed when invalid token address added while estimation.", - "vali_estimateTransaction_17": "The validation is displayed when null token address added while estimation.", - "vali_estimateTransaction_18": "The validation is displayed when token address not added while estimation.", - "fail_estimateTransaction_1": "An error is displayed while estimating the transaction", - "fail_estimateTransaction_2": "The respective validate is not displayed when invalid paymaster url added while estimation.", - "fail_estimateTransaction_3": "The respective validate is not displayed when paymaster url not added while estimation.", - "fail_estimateTransaction_4": "The respective validate is not displayed when invalid API Key added while estimation.", - "fail_estimateTransaction_5": "The respective validate is not displayed when incorrect API Key added while estimation.", - "fail_estimateTransaction_6": "The respective validate is not displayed when API Key not added while estimation.", - "fail_estimateTransaction_7": "The respective validate is not displayed when invalid chainid added while estimation.", - "fail_estimateTransaction_8": "The respective validate is not displayed when chainid not added while estimation.", - "fail_estimateTransaction_9": "The respective validate is not displayed when incorrect To Address added while estimation.", - "fail_estimateTransaction_10": "The respective validate is not displayed when invalid To Address added while estimation.", - "fail_estimateTransaction_11": "The respective validate is not displayed when invalid value added while estimation.", - "fail_estimateTransaction_12": "The respective validate is not displayed when very small value added while estimation.", - "fail_estimateTransaction_13": "The respective validate is not displayed when not added the transaction to the batch while estimation.", - "fail_estimateTransaction_14": "The respective validate is not displayed when provider not added while estimation.", - "fail_estimateTransaction_15": "The respective validate is not displayed when other provider added while estimation.", - "fail_estimateTransaction_16": "The respective validate is not displayed when incorrect token address added while estimation.", - "fail_estimateTransaction_17": "The respective validate is not displayed when invalid token address added while estimation.", - "fail_estimateTransaction_18": "The respective validate is not displayed when null token address added while estimation.", - "fail_estimateTransaction_19": "The respective validate is not displayed when token address not added while estimation.", - "vali_submitTransaction_uoHash": "The uoHash value is empty while submiting the transaction.", - "vali_submitTransaction_1": "Submitted the user op successfully.", - "vali_submitTransaction_2": "Could not submit any userop.", - "fail_submitTransaction_1": "An error message is displayed while submiting the transaction.", - "fail_getTransactionHash_1": "An error message is displayed while getting transaction hash.", - "fail_getUserOpReceipt_1": "An error is displayed while validating the userops receipts.", - "vali_deployAddress_1": "Account must be created first", - "vali_deployAddress_2": "The validation for non deployed address is displayed as expected while performing the concurrent userops.", - "fail_deployAddress_1": "The validation is not displayed when address is not deployed while performing the concurrent userops.", - "nativeTransaction_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE NATIVE TRANSACTION", - "_comment7": "Paymaster - Pimloco Paymaster", - "vali_pimlico_paymasterAddress_1": "The paymaster address is empty in the fetch paymaster address response.", - "vali_pimlico_paymasterAddress_2": "The paymaster address is not found as expected while fetching the paymaster address with invalid paymaster URL.", - "vali_pimlico_paymasterAddress_3": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address with invalid API Key.", - "vali_pimlico_paymasterAddress_4": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address without API Key.", - "vali_pimlico_paymasterAddress_5": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address with invalid chainid", - "vali_pimlico_paymasterAddress_6": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address without chainid", - "vali_pimlico_paymasterAddress_7": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address with invalid Entry Point Address.", - "vali_pimlico_paymasterAddress_8": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address with invalid token.", - "vali_pimlico_paymasterAddress_9": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address without parameters.", - "fail_pimlico_paymasterAddress_1": "An error is displayed while fetching the pimlico paymaster address.", - "fail_pimlico_paymasterAddress_2": "The paymaster address is fetched with invalid paymaster URL.", - "fail_pimlico_paymasterAddress_3": "The paymaster address is fetched with invalid API Key.", - "fail_pimlico_paymasterAddress_4": "The paymaster address is fetched without API Key.", - "fail_pimlico_paymasterAddress_5": "The paymaster address is fetched with invalid chainid.", - "fail_pimlico_paymasterAddress_6": "The paymaster address is fetched without chainid.", - "fail_pimlico_paymasterAddress_7": "The paymaster address is fetched with invalid Entry Point Address.", - "fail_pimlico_paymasterAddress_8": "The paymaster address is fetched with invalid token.", - "fail_pimlico_paymasterAddress_9": "The paymaster address is fetched without parameters.", - "vali_erc20Contract_to": "The to address value is empty in the erc20 contract response.", - "vali_erc20Contract_data": "The data value is empty in the erc20 contract response.", - "vali_erc20Contract_1": "The validation for erc20Contract is displayed while generating the erc20Contract with incorrect token address.", - "vali_erc20Contract_2": "The validation for erc20Contract is displayed while generating the erc20Contract with invalid token address.", - "vali_erc20Contract_3": "The validation for erc20Contract is displayed while generating the erc20Contract with invalid paymaster address.", - "vali_erc20Contract_4": "The validation for erc20Contract is displayed while generating the erc20Contract with incorrect paymaster address.", - "fail_erc20Contract_1": "An error is displayed in the erc20 contract response.", - "fail_erc20Contract_2": "An error is displayed while fetching the paymaster address.", - "fail_erc20Contract_3": "The validation is not displayed while generating the erc20Contract with incorrect token address.", - "fail_erc20Contract_4": "The validation is not displayed while generating the erc20Contract with invalid token address.", - "fail_erc20Contract_5": "The validation is not displayed while generating the erc20Contract with invalid paymaster address.", - "fail_erc20Contract_6": "The validation is not displayed while generating the erc20Contract with incorrect paymaster address.", - "fail_paymasterAddress_1": "Unable to fetch the paymaster address.", - "pimlocoPaymaster_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE PIMLICO PAYMASTER", - "_comment8": "Paymaster - Arka Functions", - "vali_metadata_sponsorAddress": "The sponsorAddress is empty in the metadata response.", - "vali_metadata_sponsorWalletBalance": "The sponsorWalletBalance is empty in the metadata response.", - "vali_metadata_chainsSupported": "The chainsSupported is empty in the metadata response.", - "vali_metadata_tokenPaymasters": "The tokenPaymasters is empty in the metadata response.", - "fail_metadata_1": "An error is displayed while calling the metadata function of arka.", - "vali_getTokenPaymasterAddress_tokenPaymasterAddress": "The tokenPaymasterAddress is empty in the getTokenPaymasterAddress response.", - "vali_getTokenPaymasterAddress_1": "The validation is displayed while getting token paymaster address for incorrect token.", - "vali_getTokenPaymasterAddress_2": "The validation is displayed while getting token paymaster address without token.", - "fail_getTokenPaymasterAddress_1": "An error is displayed while calling the get token paymaster address function of arka.", - "fail_getTokenPaymasterAddress_2": "The respective validation not displayed while getting token paymaster address with incorrect token", - "fail_getTokenPaymasterAddress_3": "The respective validation not displayed while getting token paymaster address without token", - "vali_removeWhitelist_1": "Removed the address from whitelisted successfully.", - "vali_removeWhitelist_2": "The address is not whitelisted.", - "vali_removeWhitelist_3": "The validation is displayed while removing address from whitelist with invalid address.", - "vali_removeWhitelist_4": "The validation is displayed while removing address from whitelist with incorrect address.", - "fail_removeWhitelist_1": "An error is displayed while removing the address from whitelisting.", - "fail_removeWhitelist_2": "An error is displayed while calling the remove whitelist address function of arka.", - "fail_removeWhitelist_3": "The validation is not displayed while remove whitelist address with invalid address.", - "fail_removeWhitelist_4": "The validation is not displayed while remove whitelist address with incorrect address.", - "fail_removeWhitelist_5": "The validation is not displayed while remove whitelist address with random address.", - "fail_removeWhitelist_6": "The remove whitelist address function performed successfully with multiple random addresses.", - "vali_addWhitelist_1": "The address/es is/are whitelisted successfully.", - "vali_addWhitelist_2": "The address is already whitelisted.", - "vali_addWhitelist_3": "The validation is displayed while removing address from whitelist with invalid address.", - "vali_addWhitelist_4": "The validation is displayed while removing address from whitelist with incorrect address.", - "vali_addWhitelist_5": "The address is whitelisted successfully with random address.", - "fail_addWhitelist_1": "An error is displayed while whitelisting the address/es.", - "fail_addWhitelist_2": "An error is displayed while calling the add whitelist address function of arka.", - "fail_addWhitelist_3": "The validation is not displayed while add whitelist address with invalid address.", - "fail_addWhitelist_4": "The validation is not displayed while add whitelist address with incorrect address.", - "fail_addWhitelist_5": "The validation is not displayed while add whitelist address with random address.", - "fail_addWhitelist_6": "The add whitelist address function performed successfully with multiple random addresses.", - "fail_addWhitelist_7": "An error is displayed while whitelisting the random address.", - "vali_checkWhitelist_1": "The validation is displayed while checking address from whitelist with invalid address.", - "vali_checkWhitelist_2": "The validation is displayed while checking address from whitelist with incorrect address.", - "vali_checkWhitelist_3": "The validation message is displayed while checking the whitelist address without address.", - "fail_checkWhitelist_1": "An error is displayed while calling the check whitelist address function of arka.", - "fail_checkWhitelist_2": "The validation is not displayed while checking whitelist address with invalid address.", - "fail_checkWhitelist_3": "The validation is not displayed while checking whitelist address with incorrect address.", - "fail_checkWhitelist_4": "The validation is not displayed while checking whitelist address with random address.", - "fail_checkWhitelist_5": "The check whitelist address function performed successfully without address.", - "vali_deposit_1": "The amount deposited successfully.", - "vali_deposit_2": "The validation message is displayed while deposit with invalid amount.", - "fail_deposit_1": "An error is displayed while perform the deposit.", - "fail_deposit_2": "An error is displayed while calling the deposit function of arka.", - "fail_deposit_3": "The validation is not displayed while deposit with invalid amount.", - "arkaFunction_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE ARKA FUNCTION", - "_comment9": "Swap - Exchange offers", - "vali_exchangeOffers_1": "Found exchange supported assets.", - "vali_exchangeOffers_2": "The exchange supported assets is not displayed.", - "vali_exchangeOffers_3": "The Offers are not available in the getExchangeOffers response.", - "vali_exchangeOffers_4": "The validation is displayed while getting exchange offers with invalid fromTokenAddress", - "vali_exchangeOffers_5": "The validation is displayed while getting exchange offers without fromTokenAddress", - "vali_exchangeOffers_6": "The validation is displayed while getting exchange offers with invalid toTokenAddress", - "vali_exchangeOffers_7": "The validation is displayed while getting exchange offers without toTokenAddress", - "vali_exchangeOffers_8": "The validation is displayed while getting exchange offers with invalid fromAmount", - "vali_exchangeOffers_9": "The validation is displayed while getting exchange offers with decimal fromAmount", - "vali_exchangeOffers_10": "The validation is displayed while getting exchange offers with big fromAmount", - "vali_exchangeOffers_11": "The validation is displayed while getting exchange offers without fromAmount", - "fail_exchangeOffers_1": "An error is displayed in the Exchange offers response", - "fail_exchangeOffers_2": "The validation is not displayed while getting exchange offers with invalid fromTokenAddress.", - "fail_exchangeOffers_3": "The validation is not displayed while getting exchange offers without fromTokenAddress.", - "fail_exchangeOffers_4": "The validation is not displayed while getting exchange offers with invalid toTokenAddress.", - "fail_exchangeOffers_5": "The validation is not displayed while getting exchange offers without toTokenAddress.", - "fail_exchangeOffers_6": "The validation is not displayed while getting exchange offers with invalid fromAmount.", - "fail_exchangeOffers_7": "The validation is not displayed while getting exchange offers with decimal fromAmount.", - "fail_exchangeOffers_8": "The validation is not displayed while getting exchange offers with big fromAmount.", - "fail_exchangeOffers_9": "The validation is not displayed while getting exchange offers without fromAmount.", - "vali_exchangeOffers_address": "The address value is empty in the getExchangeSupportedAssets response.", - "vali_exchangeOffers_chainId": "The chainId value is not number in the getExchangeSupportedAssets response.", - "vali_exchangeOffers_name": "The name value is empty in the getExchangeSupportedAssets response.", - "vali_exchangeOffers_symbol": "The symbol value is empty in the getExchangeSupportedAssets response.", - "vali_exchangeOffers_decimals": "The decimals value is not number in the getExchangeSupportedAssets response.", - "vali_exchangeOffers_logoURI": "The logoURI value is empty in the getExchangeSupportedAssets response.", - "vali_exchangeOffers_provider": "The provider value is empty in the getExchangeOffers response.", - "vali_exchangeOffers_receiveAmount": "The receiveAmount value is empty in the getExchangeOffers response.", - "vali_exchangeOffers_exchangeRate": "The exchangeRate value is not number in the getExchangeOffers response.", - "vali_exchangeOffers_transactions": "The transactions value is empty in the getExchangeOffers response.", - "vali_exchangeOffers_typename": "The __typename value is empty in the getExchangeOffers response.", - "exchangeOffers_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE EXCHANGE OFFERS", - "_comment10": "Swap - Cross Chain Quotes", - "vali_crossChainQuotes_1": "The items are not available in the getCrossChainQuotes response.", - "vali_crossChainQuotes_2": "The validation is displayed while getting cross chain quotes without fromchainid.", - "vali_crossChainQuotes_3": "The validation is displayed while getting cross chain quotes without tochainid.", - "vali_crossChainQuotes_4": "The validation is displayed while getting cross chain quotes with invalid fromTokenAddress.", - "vali_crossChainQuotes_5": "The validation is displayed while getting cross chain quotes with incorrect fromTokenAddress.", - "vali_crossChainQuotes_6": "The validation is displayed while getting cross chain quotes without fromTokenAddress.", - "vali_crossChainQuotes_7": "The validation is displayed while getting cross chain quotes with invalid toTokenAddress.", - "vali_crossChainQuotes_8": "The validation is displayed while getting cross chain quotes with incorrect toTokenAddress.", - "vali_crossChainQuotes_9": "The validation is displayed while getting cross chain quotes without toTokenAddress.", - "vali_crossChainQuotes_10": "The validation is displayed while getting cross chain quotes with invalid fromAmount.", - "vali_crossChainQuotes_11": "The validation is displayed while getting cross chain quotes with incorrect fromAmount.", - "vali_crossChainQuotes_12": "The validation is displayed while getting cross chain quotes without fromAmount.", - "fail_crossChainQuotes_1": "An error is displayed in the getCrossChainQuotes response", - "fail_crossChainQuotes_2": "The validation is not displayed while getting cross chain quotes without fromchainid.", - "fail_crossChainQuotes_3": "The validation is not displayed while getting cross chain quotes without tochainid.", - "fail_crossChainQuotes_4": "The validation is not displayed while getting cross chain quotes with invalid fromTokenAddress.", - "fail_crossChainQuotes_5": "The validation is not displayed while getting cross chain quotes with incorrect fromTokenAddress.", - "fail_crossChainQuotes_6": "The validation is not displayed while getting cross chain quotes without fromTokenAddress.", - "fail_crossChainQuotes_7": "The validation is not displayed while getting cross chain quotes with invalid toTokenAddress.", - "fail_crossChainQuotes_8": "The validation is not displayed while getting cross chain quotes with incorrect toTokenAddress.", - "fail_crossChainQuotes_9": "The validation is not displayed while getting cross chain quotes without toTokenAddress.", - "fail_crossChainQuotes_10": "The validation is not displayed while getting cross chain quotes with invalid fromAmount.", - "fail_crossChainQuotes_11": "The validation is not displayed while getting cross chain quotes with incorrect fromAmount.", - "fail_crossChainQuotes_12": "The validation is not displayed while getting cross chain quotes without fromAmount.", - "vali_crossChainQuotes_provider": "The provider value is empty in the getCrossChainQuotes response.", - "vali_crossChainQuotes_data": "The data value is empty in the getCrossChainQuotes response.", - "vali_crossChainQuotes_to": "The to value is empty in the getCrossChainQuotes response.", - "vali_crossChainQuotes_value": "The value value is empty in the getCrossChainQuotes response.", - "vali_crossChainQuotes_from": "The from value is empty in the getCrossChainQuotes response.", - "vali_crossChainQuotes_chainId": "The chainId value is not number in the getCrossChainQuotes response.", - "crossChainQuotes_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE CROSS CHAIN QUOTES", - "_comment11": "Swap - Advance Routes LiFi", - "vali_advanceRoutesLiFi_1": "The quotes are not display in the quote list", - "vali_advanceRoutesLiFi_2": "The validation is displayed while getting advance routes lifi without fromChainId.", - "vali_advanceRoutesLiFi_3": "The validation is displayed while getting advance routes lifi without toChainId.", - "vali_advanceRoutesLiFi_4": "The validation is displayed while getting advance routes lifi with invalid fromTokenAddress.", - "vali_advanceRoutesLiFi_5": "The validation is displayed while getting advance routes lifi with incorrect fromTokenAddress.", - "vali_advanceRoutesLiFi_6": "The validation is displayed while getting advance routes lifi without fromTokenAddress.", - "vali_advanceRoutesLiFi_7": "The validation is displayed while getting advance routes lifi with invalid toTokenAddress.", - "vali_advanceRoutesLiFi_8": "The validation is displayed while getting advance routes lifi with incorrect toTokenAddress.", - "vali_advanceRoutesLiFi_9": "The validation is displayed while getting advance routes lifi without toTokenAddress.", - "vali_advanceRoutesLiFi_10": "The validation is displayed while getting advance routes lifi without fromAmount.", - "fail_advanceRoutesLiFi_1": "An error is displayed in the quote list response.", - "fail_advanceRoutesLiFi_2": "The validation is not displayed while getting advance routes lifi without fromChainId.", - "fail_advanceRoutesLiFi_3": "The validation is not displayed while getting advance routes lifi without toChainId.", - "fail_advanceRoutesLiFi_4": "The validation is not displayed while getting advance routes lifi with invalid fromTokenAddress.", - "fail_advanceRoutesLiFi_5": "The validation is not displayed while getting advance routes lifi with incorrect fromTokenAddress.", - "fail_advanceRoutesLiFi_6": "The validation is not displayed while getting advance routes lifi without fromTokenAddress.", - "fail_advanceRoutesLiFi_7": "The validation is not displayed while getting advance routes lifi with invalid toTokenAddress.", - "fail_advanceRoutesLiFi_8": "The validation is not displayed while getting advance routes lifi with incorrect toTokenAddress.", - "fail_advanceRoutesLiFi_9": "The validation is not displayed while getting advance routes lifi without toTokenAddress.", - "fail_advanceRoutesLiFi_10": "The validation is not displayed while getting advance routes lifi without fromAmount.", - "vali_advanceRoutesLiFi_id": "The id value is empty in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_fromChainId": "The fromChainId value is not number in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_fromAmountUSD": "The fromAmountUSD value is empty in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_fromAmount": "The fromAmount value is empty in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_fromToken": "The fromToken value is empty in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_fromAddress": "The fromAddress value is empty in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_toChainId": "The toChainId value is not number in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_toAmountUSD": "The toAmountUSD value is empty in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_toAmount": "The toAmount value is empty in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_toAmountMin": "The toAmountMin value is empty in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_toToken": "The toToken value is empty in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_toAddress": "The toAddress value is empty in the getAdvanceRoutesLiFi response.", - "vali_advanceRoutesLiFi_gasCostUSD": "The gasCostUSD value is empty in the getAdvanceRoutesLiFi response.", - "vali_stepTransaction_data": "The data value is empty in the stepTransaction response.", - "vali_stepTransaction_value": "The value value is empty in the stepTransaction response.", - "vali_stepTransaction_to": "The to value is empty in the stepTransaction response.", - "vali_stepTransaction_chainId": "The chainId value is not number in the stepTransaction response.", - "vali_stepTransaction_transactionType": "The transactionType value is empty in the stepTransaction response.", - "vali_stepTransaction_gasLimit": "The gasLimit value is empty in the stepTransaction response.", - "vali_stepTransaction_gasPrice": "The gasPrice value is empty in the stepTransaction response.", - "advanceRoutesLiFi_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE ADVANCE ROUTES LIFI", - "_comment12": "Transaction History", - "vali_getTransaction_1": "The transaction details is not display in the transaction history", - "fail_getTransaction_1": "An error message is displayed while getting transaction history.", - "vali_getTransaction_chainId": "The chainId value is not number in the getTransaction response.", - "vali_getTransaction_hash": "The hash value is empty in the getTransaction response.", - "vali_getTransaction_nonce": "The nonce value is not number in the getTransaction response.", - "vali_getTransaction_blockHash": "The blockHash value is empty in the getTransaction response.", - "vali_getTransaction_blockNumber": "The blockNumber value is not number in the getTransaction response.", - "vali_getTransaction_from": "The from value is empty in the getTransaction response.", - "vali_getTransaction_to": "The to value is empty in the getTransaction response.", - "vali_getTransaction_value": "The value value is empty in the getTransaction response.", - "vali_getTransaction_gasPrice": "The gasPrice value is empty in the getTransaction response.", - "vali_getTransaction_gasLimit": "The gasLimit value is not number in the getTransaction response.", - "vali_getTransaction_input": "The input value is empty in the getTransaction response.", - "vali_getTransaction_status": "The status value is empty in the getTransaction response.", - "vali_getTransaction_blockExplorerUrl": "The blockExplorerUrl value is empty in the getTransaction response.", - "vali_getTransaction_transactionIndex": "The transactionIndex value is not number in the getTransaction response.", - "vali_getTransaction_gasUsed": "The gasUsed value is not number in the getTransaction response.", - "vali_getTransaction_log_transactionIndex": "The transactionIndex value of the log is not number in the getTransaction response.", - "vali_getTransaction_log_blockNumber": "The blockNumber value of the log is not number in the getTransaction response.", - "vali_getTransaction_log_transactionHash": "The transactionHash value of the log is empty in the getTransaction response.", - "vali_getTransaction_log_address": "The address value of the log is empty in the getTransaction response.", - "vali_getTransaction_log_topics": "The topics value of the log is empty in the getTransaction response.", - "vali_getTransaction_log_data": "The data value of the log is empty in the getTransaction response.", - "vali_getTransaction_log_logIndex": "The logIndex value of the log is not number in the getTransaction response.", - "vali_getTransaction_log_blockHash": "The blockHash value of the log is empty in the getTransaction response.", - "getTransaction_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE GET TRANSACTION", - "_comment13": "Transactions History", - "vali_getTransactions_1": "The transaction details is not display in the transactions history", - "vali_getTransactions_2": "The null is received while fetching the transaction history with incorrect hash.", - "vali_getTransactions_3": "The validation message is displayed when hash not having 32 size hex while fetching the transaction history.", - "vali_getTransactions_4": "The transactions are not displayed in the transactions history with invalid chainid.", - "vali_getTransactions_5": "The transactions are not displayed in the transactions history with incorrect chainid.", - "vali_getTransactions_6": "The transactions are not displayed in the transactions history with invalid account.", - "vali_getTransactions_7": "The transactions are not displayed in the transactions history with incorrect account.", - "fail_getTransactions_1": "An error message is displayed while getting transactions history.", - "fail_getTransactions_2": "An error message is displayed while getting provider", - "fail_getTransactions_3": "An error message is displayed while getting erc20 contract interface", - "fail_getTransactions_4": "An error message is displayed while getting decimal", - "fail_getTransactions_5": "An error message is displayed while getting transfer from encoded data", - "fail_getTransactions_6": "Getting the single transaction history with incorrect Hash.", - "fail_getTransactions_7": "The transaction history is fetched with hash which not having 32 size hex.", - "fail_getTransactions_8": "The transactions are displayed while getting transactions history with invalid chainid", - "fail_getTransactions_9": "The transactions are displayed while getting transactions history with incorrect chainid", - "fail_getTransactions_10": "The transactions are displayed while getting transactions history with invalid account", - "fail_getTransactions_11": "The transactions are displayed while getting transactions history with incorrect account", - "vali_getTransactions_chainId": "The chainId value is not number in the getTransactions response.", - "vali_getTransactions_blockNumber": "The blockNumber value is not number in the getTransactions response.", - "vali_getTransactions_sender": "The sender value is empty in the getTransactions response.", - "vali_getTransactions_target": "The target value is empty in the getTransactions response.", - "vali_getTransactions_transactionHash": "The transactionHash value is empty in the getTransactions response.", - "vali_getTransactions_userOpHash": "The userOpHash value is empty in the getTransactions response.", - "vali_getTransactions_actualGasCost": "The actualGasCost value is not number in the get transactions response.", - "vali_getTransactions_actualGasUsed": "The actualGasUsed value is not number in the get transactions response.", - "vali_getTransactions_success": "The success value is empty in the get transactions response.", - "vali_getTransactions_timestamp": "The timestamp value is not number in the get transactions response.", - "vali_getTransactions_paymaster": "The paymaster value is empty in the get transactions response.", - "vali_getTransactions_value": "The value value is not number in the getTransactions response.", - "vali_getTransactions_blockExplorerUrl": "The blockExplorerUrl value is empty in the getTransactions response.", - "vali_getTransactions_input": "The input value is empty in the getTransactions response.", - "vali_getTransactions_nonce": "The nonce value is not number in the getTransactions response.", - "vali_getTransactions_initCode": "The initCode value is empty in the getTransactions response.", - "vali_getTransactions_callData": "The callData value is empty in the getTransactions response.", - "vali_getTransactions_verificationGasLimit": "The verificationGasLimit value is empty in the getTransactions response.", - "vali_getTransactions_preVerificationGas": "The preVerificationGas value is empty in the getTransactions response.", - "vali_getTransactions_maxFeePerGas": "The maxFeePerGas value is empty in the getTransactions response.", - "vali_getTransactions_maxPriorityFeePerGas": "The maxPriorityFeePerGas value is empty in the getTransactions response.", - "vali_getTransactions_nativeTransfers_from": "The from value of native transaction is empty in the getTransactions response.", - "vali_getTransactions_nativeTransfers_to": "The to value of native transaction is empty in the getTransactions response.", - "vali_getTransactions_nativeTransfers_value": "The value value of native transaction is empty in the getTransactions response.", - "vali_getTransactions_nativeTransfers_asset": "The asset value of native transaction is empty in the getTransactions response.", - "vali_getTransactions_nativeTransfers_address": "The address value of native transaction is empty in the getTransactions response.", - "vali_getTransactions_nativeTransfers_decimal": "The decimal value of native transaction is empty in the getTransactions response.", - "vali_getTransactions_nativeTransfers_data": "The data value of native transaction is empty in the getTransactions response.", - "vali_getTransactions_erc20Transfers_from": "The from value of erc20 transaction is empty in the getTransactions response.", - "vali_getTransactions_erc20Transfers_to": "The to value of erc20 transaction is empty in the getTransactions response.", - "vali_getTransactions_erc20Transfers_value": "The value value of erc20 transaction is empty in the getTransactions response.", - "vali_getTransactions_erc20Transfers_asset": "The asset value of erc20 transaction is empty in the getTransactions response.", - "vali_getTransactions_erc20Transfers_address": "The address value of erc20 transaction is empty in the getTransactions response.", - "vali_getTransactions_erc20Transfers_decimal": "The decimal value of erc20 transaction is empty in the getTransactions response.", - "vali_getTransactions_erc20Transfers_data": "The data value of erc20 transaction is empty in the getTransactions response.", - "getTransactions_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE GET TRANSACTIONS", - "_comment14": "Transaction - ERC 20 Token", - "vali_erc20Transfer_1": "The validation is displayed while transfer ERC20 token with incorrect token address.", - "vali_erc20Transfer_2": "The validation is displayed while transfer ERC20 token with invalid token address.", - "vali_erc20Transfer_3": "The validation is displayed while transfer ERC20 token with null token address.", - "vali_erc20Transfer_4": "The validation is displayed while transfer ERC20 token with incorrect transfer method name.", - "vali_erc20Transfer_5": "The validation is displayed while transfer ERC20 token with invalid value.", - "vali_erc20Transfer_6": "The validation is displayed while transfer ERC20 token with small value.", - "vali_erc20Transfer_7": "The validation is displayed while transfer ERC20 token without value.", - "vali_erc20Transfer_8": "The validation is displayed while transfer ERC20 token with incorrect recipient.", - "vali_erc20Transfer_9": "The validation is displayed while transfer ERC20 token with invalid recipient.", - "vali_erc20Transfer_10": "The validation is displayed while transfer ERC20 token without recipient.", - "fail_erc20Transfer_1": "The validation is not displayed while transfer ERC20 token with incorrect token address.", - "fail_erc20Transfer_2": "The validation is not displayed while transfer ERC20 token with invalid token address.", - "fail_erc20Transfer_3": "The validation is not displayed while transfer ERC20 token with null token address.", - "fail_erc20Transfer_4": "The validation is not displayed while transfer ERC20 token with incorrect transfer method name.", - "fail_erc20Transfer_5": "The validation is not displayed while transfer ERC20 token with invalid value.", - "fail_erc20Transfer_6": "The validation is not displayed while transfer ERC20 token with small value.", - "fail_erc20Transfer_7": "The validation is not displayed while transfer ERC20 token without value.", - "fail_erc20Transfer_8": "The validation is not displayed while transfer ERC20 token with incorrect recipient.", - "fail_erc20Transfer_9": "The validation is not displayed while transfer ERC20 token with invalid recipient.", - "fail_erc20Transfer_10": "The validation is not displayed while transfer ERC20 token without recipient.", - "vali_erc20Transfer_provider": "The isProvider value is false in the provider response.", - "fail_erc20Transfer_provider": "An error is displayed while getting the provider.", - "fail_erc20Transfer_contractInterface": "An error is displayed while getting the erc20 contract interface.", - "vali_erc20Contract_decimals": "The decimals value is empty while getting decimals from erc20 contract.", - "fail_erc20Contract_decimals": "An error is displayed while getting the decimals from erc20 contract.", - "vali_erc20Contract_transferFrom": "The decimals value is empty while getting transferFrom encoded data.", - "fail_erc20Contract_transferFrom": "An error is displayed while getting the transferFrom encoded data.", - "erc20Transaction_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE SEND ERC20 TOKEN", - "_comment15": "Transaction - ERC 721 Token", - "vali_erc721Transfer_1": "The validation is displayed while transfer ERC721 token with incorrect sender address.", - "vali_erc721Transfer_2": "The validation is displayed while transfer ERC721 token with invalid sender address.", - "vali_erc721Transfer_3": "The validation is displayed while transfer ERC721 token without sender address.", - "vali_erc721Transfer_4": "The validation is displayed while transfer ERC721 token with incorrect recipient address.", - "vali_erc721Transfer_5": "The validation is displayed while transfer ERC721 token with invalid recipient address.", - "vali_erc721Transfer_6": "The validation is displayed while transfer ERC721 token without recipient address.", - "vali_erc721Transfer_7": "The validation is displayed while transfer ERC721 token with incorrect tokenId.", - "vali_erc721Transfer_8": "The validation is displayed while transfer ERC721 token without tokenId.", - "fail_erc721Transfer_1": "The validation is not displayed while transfer ERC721 token with incorrect sender address.", - "fail_erc721Transfer_2": "The validation is not displayed while transfer ERC721 token with invalid sender address.", - "fail_erc721Transfer_3": "The validation is not displayed while transfer ERC721 token without sender address.", - "fail_erc721Transfer_4": "The validation is not displayed while transfer ERC721 token with incorrect recipient address.", - "fail_erc721Transfer_5": "The validation is not displayed while transfer ERC721 token with invalid recipient address.", - "fail_erc721Transfer_6": "The validation is not displayed while transfer ERC721 token without recipient address.", - "fail_erc721Transfer_7": "The validation is not displayed while transfer ERC721 token with incorrect tokenId.", - "fail_erc721Transfer_8": "The validation is not displayed while transfer ERC721 token without tokenId.", - "vali_erc721Transfer_contractInterface": "The erc721 Contract Interface value is empty in the erc721 Contract Interface response.", - "fail_erc721Transfer_contractInterface": "An error is displayed while getting the erc20 contract interface.", - "vali_erc721Contract_decimals": "The decimals value is empty while getting decimals from erc20 contract.", - "fail_erc721Contract_decimals": "An error is displayed while getting the decimals from erc20 contract.", - "vali_erc721Contract_transferFrom": "The decimals value is empty while getting transferFrom encoded data.", - "fail_erc721Contract_transferFrom": "An error is displayed while getting the transferFrom encoded data.", - "erc721Transaction_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE SEND ERC721 TOKEN", - "_comment16": "Connext Endpoints", - "vali_connext_getSupportedAssets_symbol": "The symbol value is empty in the getSupportedAssets response.", - "vali_connext_getSupportedAssets_address": "The address value is empty in the getSupportedAssets response.", - "vali_connext_getSupportedAssets_decimals": "The decimals value is not number in the getSupportedAssets response.", - "vali_connext_getSupportedAssets_chainId": "The chainId value is not number in the getSupportedAssets response.", - "vali_connext_getSupportedAssets_name": "The name value is empty in the getSupportedAssets response.", - "vali_connext_getSupportedAssets_icon": "The icon value is empty in the getSupportedAssets response.", - "vali_connext_getQuotes_data": "The data value is empty in the getQuotes response.", - "vali_connext_getQuotes_value": "The value value is empty in the getQuotes response.", - "vali_connext_getQuotes_to": "The to value is empty in the getQuotes response.", - "vali_connext_getTransactionStatus_status": "The status value is empty in the getTransactionStatus response.", - "vali_connext_getTransactionStatus_transactionHash": "The transactionHash value is empty in the getTransactionStatus response.", - "vali_connext_getTransactionStatus_connextscanUrl": "The connextscanUrl value is empty in the getTransactionStatus response.", - "vali_connext_1": "The assert not displayed in the list with invalid chainid.", - "vali_connext_2": "The validation is displayed while getting the quotes with invalid sender address.", - "vali_connext_3": "The validation is displayed while getting the quotes without sender address.", - "vali_connext_4": "The validation is displayed while getting the quotes with incorrect sender address.", - "vali_connext_5": "The validation is displayed while getting the quotes with invalid receipt address.", - "vali_connext_6": "The validation is displayed while getting the quotes without receipt address.", - "vali_connext_7": "The validation is displayed while getting the quotes with incorrect receipt address.", - "vali_connext_8": "The validation is displayed while getting the quotes without fromChainId.", - "vali_connext_9": "The validation is displayed while getting the quotes without toChainId.", - "vali_connext_10": "The validation is displayed while getting the quotes with invalid fromTokenAddress.", - "vali_connext_11": "The validation is displayed while getting the quotes with incorrect fromTokenAddress.", - "vali_connext_12": "The validation is displayed while getting the quotes without fromTokenAddress.", - "vali_connext_13": "The validation is displayed while getting the quotes with invalid value.", - "vali_connext_14": "The validation is displayed while getting the quotes with small value.", - "vali_connext_15": "The validation is displayed while getting the quotes without value.", - "vali_connext_16": "The validation is displayed while getting the quotes without slippage.", - "vali_connext_17": "The validation is displayed while getting the transaction status without fromChainId.", - "vali_connext_18": "The validation is displayed while getting the transaction status without toChainId.", - "vali_connext_19": "The validation is displayed while getting the transaction status with invalid transactionHash.", - "vali_connext_20": "The validation is displayed while getting the transaction status with incorrect transactionHash.", - "vali_connext_21": "The validation is displayed while getting the transaction status without transactionHash.", - "fail_connext_1": "An error is displayed while validating the all supported assets.", - "fail_connext_2": "An error is displayed while validating the selected supported assets.", - "fail_connext_3": "An error is displayed while validating the quotes.", - "fail_connext_4": "An error is displayed while validating the transaction status.", - "fail_connext_5": "The asserts are displayed in the list with invalid chainid.", - "fail_connext_6": "An error is displayed while getting the supported assets with invalid chainId.", - "fail_connext_7": "The validation is not displayed while getting the quotes with invalid sender address.", - "fail_connext_8": "The validation is not displayed while getting the quotes without sender address.", - "fail_connext_9": "The validation is not displayed while getting the quotes with incorrect sender address.", - "fail_connext_10": "The validation is not displayed while getting the quotes with invalid receipt address.", - "fail_connext_11": "The validation is not displayed while getting the quotes without receipts address.", - "fail_connext_12": "The validation is not displayed while getting the quotes with incorrect receipts address.", - "fail_connext_13": "The validation is not displayed while getting the quotes without fromChainId.", - "fail_connext_14": "The validation is not displayed while getting the quotes without toChainId.", - "fail_connext_15": "The validation is not displayed while getting the quotes with invalid fromTokenAddress.", - "fail_connext_16": "The validation is not displayed while getting the quotes with incorrect fromTokenAddress.", - "fail_connext_17": "The validation is not displayed while getting the quotes without fromTokenAddress.", - "fail_connext_18": "The validation is not displayed while getting the quotes with invalid value.", - "fail_connext_19": "The validation is not displayed while getting the quotes with small value.", - "fail_connext_20": "The validation is not displayed while getting the quotes without value.", - "fail_connext_21": "The validation is not displayed while getting the quotes without slippage.", - "fail_connext_22": "The validation is not displayed while getting the transaction status without fromChainId.", - "fail_connext_23": "The validation is not displayed while getting the transaction status without toChainId.", - "fail_connext_24": "The validation is not displayed while getting the transaction status with invalid transactionHash.", - "fail_connext_25": "The validation is not displayed while getting the transaction status with incorrect transactionHash.", - "fail_connext_26": "The validation is not displayed while getting the transaction status without transactionHash.", - "connext_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE CONNEXT ENDPOINTS" -} \ No newline at end of file + "_comment1": "Common Validation", + "vali_eoa_address": "The EOA Address is not calculated correctly.", + "fail_sdk_initialize": "The SDK is not initialled successfully.", + "vali_smart_address": "The Etherspot Wallet Address is not calculated correctly.", + "fail_smart_address": "The Etherspot Wallet Address is not displayed successfully.", + "fail_data_service": "The Data service is not initialled successfully.", + "fail_arka_initialize": "An error is displayed while initializating ArkaPaymaster.", + "fail_wallet_balance": "Validation of the balance of the wallet is not performed.", + "skip_transaction_error": "An error is displayed due to multiple transactions in short period, So skipping the test case.", + "_comment2": "Get Address", + "vali_zero_dev": "The Zero Dev Address is not calculated correctly.", + "fail_zero_dev": "The Zero Dev Address is not displayed successfully.", + "vali_simple_account": "The SimpleAccount Address is not calculated correctly.", + "fail_simple_account": "The SimpleAccount Address is not displayed successfully.", + "vali_account_address": "The Account Address is not calculated correctly.", + "fail_account_address": "The Account Address is not displayed successfully.", + "_comment3": "List and rates - NFT List", + "pass_nftList_1": "The items are available in the NFT list.", + "pass_nftList_2": "The items are not available in the NFT list.", + "pass_nftList_3": "The validation is displayed while getting the NFT list with invalid account address", + "pass_nftList_4": "The validation is displayed while getting the NFT list with inncorrect account address", + "fail_nftList_1": "The get NFT list is not performed correctly.", + "fail_nftList_2": "The respective validate is not displayed for the NFT List with invalid account address", + "fail_nftList_3": "The respective validate is not displayed for the NFT List with incorrect account address", + "vali_nftList_contractName": "The contractName value is empty in the NFT list response.", + "vali_nftList_contractAddress": "The contractAddress value is empty in the NFT list response.", + "vali_nftList_tokenType": "The tokenType value is empty in the NFT list response.", + "vali_nftList_balance": "The balance value is not number in the NFT list response.", + "vali_nftList_items_tokenId": "The tokenId value of the items is empty in the NFT list response.", + "vali_nftList_items_name": "The name value of the items is empty in the NFT list response.", + "vali_nftList_items_amount": "The amount value of the items is not number in the NFT list response.", + "nftList_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE NFT LIST", + "_comment4": "List and rates - Token List", + "pass_tokenList_1": "The items are available in the token list.", + "pass_tokenList_2": "The items are not available in the tokenLists list.", + "pass_tokenList_3": "The tokens are available in the token list tokens.", + "pass_tokenList_4": "The Tokens are not available in the tokenListTokens list.", + "pass_tokenList_5": "The tokens are available in the token list tokens with selected provider.", + "pass_tokenList_6": "The Tokens are not available in the tokenListTokens list with selected provider.", + "fail_tokenList_1": "The get token list is not performed correctly.", + "vali_tokenList_name": "The name value is empty in the token list response.", + "vali_tokenList_endpoint": "The endpoint value is empty in the token list response.", + "vali_tokenListTokens_address": "The address value is empty in the token list tokens response.", + "vali_tokenListTokens_name": "The name value is empty in the token list tokens response.", + "vali_tokenListTokens_symbol": "The symbol value is empty in the token list tokens response.", + "vali_tokenListTokens_decimals": "The decimals value is not number in the token list tokens response.", + "vali_tokenListTokens_logoURI": "The logoURI value is empty in the token list tokens response.", + "vali_tokenListTokens_chainId": "The chainId value is not number in the token list tokens response.", + "vali_selectedTokenListTokens_address": "The address value is empty in the selected token list tokens response.", + "vali_selectedTokenListTokens_name": "The name value is empty in the selected token list tokens response.", + "vali_selectedTokenListTokens_symbol": "The symbol value is empty in the selected token list tokens response.", + "vali_selectedTokenListTokens_decimals": "The decimals value is not number in the selected token list tokens response.", + "vali_selectedTokenListTokens_logoURI": "The logoURI value is empty in the selected token list tokens response.", + "vali_selectedTokenListTokens_chainId": "The chainId value is not number in the selected token list tokens response.", + "tokenList_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE TOKEN LIST", + "_comment5": "List and rates - Exchange Rates", + "pass_exchangeRates_1": "The validation is displayed with invalid Token Address while fetching the exchange rates.", + "pass_exchangeRates_2": "The validation is displayed with incorrect Token Address while fetching the exchange rates.", + "pass_exchangeRates_3": "The validation is displayed when not added the token address while fetching the exchnage rates", + "pass_exchangeRates_4": "The validation is displayed invalid ChainID while fetching the exchange rates.", + "pass_exchangeRates_5": "The validation is displayed without ChainID while fetching the exchange rates.", + "fail_exchangeRates_1": "The fetch exchange rates are not performed correctly.", + "fail_exchangeRates_2": "An error is displayed with other Token Address while fetching the exchange rates.", + "fail_exchangeRates_3": "The respective validate is not displayed with invalid Token Address while fetching the exchange rates.", + "fail_exchangeRates_4": "The respective validate is not displayed with incorrect Token Address while fetching the exchange rates.", + "fail_exchangeRates_5": "The respective validate is not displayed when not added the token address while fetching the exchnage rates.", + "fail_exchangeRates_6": "The respective validate is not displayed invalid ChainID while fetching the exchange rates.", + "fail_exchangeRates_7": "The respective validate is not displayed without ChainID while fetching the exchange rates.", + "vali_exchangeRates_address": "The address value is empty in the rate list response.", + "vali_exchangeRates_eth": "The eth value is not number in the rate list response.", + "vali_exchangeRates_eur": "The eur value is not number in the rate list response.", + "vali_exchangeRates_gbp": "The gbp value is not number in the rate list response.", + "vali_exchangeRates_usd": "The usd value is not number in the rate list response.", + "exchangeRates_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE EXCHANGE RATE", + "_comment6": "Paymaster - Transfer native token on arka paymaster", + "fail_clearTransaction_1": "The transaction of the batch is not clear correctly.", + "vali_addTransaction_to": "The To Address value is empty in the add transactions to batch response.", + "vali_addTransaction_data": "The data value is empty in the add transactions to batch response.", + "vali_addTransaction_value": "The value value is empty in the add transactions to batch response.", + "vali_addTransaction_1": "The validation for transactionBatch is displayed as expected while adding transactions to the batch with invalid value.", + "fail_addTransaction_1": "The addition of transaction in the batch is not performed.", + "fail_addTransaction_2": "The add transactions to the batch is performed with invalid value.", + "fail_addTransaction_3": "The validation is not displayed for the transactionBatch while adding transactions to the batch with invalid value.", + "vali_getBalance_balance": "The balance is empty in the get native balance response.", + "fail_getBalance_1": "The balance of the native token is not displayed.", + "vali_estimateTransaction_sender": "The sender value is empty while estimating the transaction.", + "vali_estimateTransaction_nonce": "The nonce value is empty while estimating the transaction.", + "vali_estimateTransaction_initCode": "The initCode value is empty while estimating the transaction.", + "vali_estimateTransaction_callData": "The callData value is empty while estimating the transaction.", + "vali_estimateTransaction_callGasLimit": "The callGasLimit value is empty while estimating the transaction.", + "vali_estimateTransaction_verificationGasLimit": "The verificationGasLimit value is empty while estimating the transaction.", + "vali_estimateTransaction_maxFeePerGas": "The maxFeePerGas value is empty while estimating the transaction.", + "vali_estimateTransaction_maxPriorityFeePerGas": "The maxPriorityFeePerGas value is empty while estimating the transaction.", + "vali_estimateTransaction_paymasterAndData": "The paymasterAndData value is empty while estimating the transaction.", + "vali_estimateTransaction_preVerificationGas": "The preVerificationGas value is empty while estimating the transaction.", + "vali_estimateTransaction_signature": "The signature value is empty while estimating the transaction.", + "vali_estimateTransaction_1": "The validation is displayed when invalid paymaster url added while estimation.", + "vali_estimateTransaction_2": "The validation is displayed when paymaster url not added while estimation.", + "vali_estimateTransaction_3": "The validation is displayed when invalid API Key added while estimation.", + "vali_estimateTransaction_4": "The validation is displayed when incorrect API Key added while estimation.", + "vali_estimateTransaction_5": "The validation is displayed when API Key not added while estimation.", + "vali_estimateTransaction_6": "The validation is displayed when invalid chainid added while estimation.", + "vali_estimateTransaction_7": "The validation is displayed when chainid not added while estimation.", + "vali_estimateTransaction_8": "The validation is displayed when incorrect To Address added while estimation.", + "vali_estimateTransaction_9": "The validation is displayed when invalid To Address added while estimation.", + "vali_estimateTransaction_10": "The validation is displayed when invalid value added while estimation.", + "vali_estimateTransaction_11": "The validation is displayed when very small value added while estimation.", + "vali_estimateTransaction_12": "The validation is displayed when not added the transaction to the batch while estimation.", + "vali_estimateTransaction_13": "The validation is displayed when provider not added while estimation.", + "vali_estimateTransaction_14": "The validation is displayed when other provider added while estimation.", + "vali_estimateTransaction_15": "The validation is displayed when incorrect token address added while estimation.", + "vali_estimateTransaction_16": "The validation is displayed when invalid token address added while estimation.", + "vali_estimateTransaction_17": "The validation is displayed when null token address added while estimation.", + "vali_estimateTransaction_18": "The validation is displayed when token address not added while estimation.", + "fail_estimateTransaction_1": "An error is displayed while estimating the transaction", + "fail_estimateTransaction_2": "The respective validate is not displayed when invalid paymaster url added while estimation.", + "fail_estimateTransaction_3": "The respective validate is not displayed when paymaster url not added while estimation.", + "fail_estimateTransaction_4": "The respective validate is not displayed when invalid API Key added while estimation.", + "fail_estimateTransaction_5": "The respective validate is not displayed when incorrect API Key added while estimation.", + "fail_estimateTransaction_6": "The respective validate is not displayed when API Key not added while estimation.", + "fail_estimateTransaction_7": "The respective validate is not displayed when invalid chainid added while estimation.", + "fail_estimateTransaction_8": "The respective validate is not displayed when chainid not added while estimation.", + "fail_estimateTransaction_9": "The respective validate is not displayed when incorrect To Address added while estimation.", + "fail_estimateTransaction_10": "The respective validate is not displayed when invalid To Address added while estimation.", + "fail_estimateTransaction_11": "The respective validate is not displayed when invalid value added while estimation.", + "fail_estimateTransaction_12": "The respective validate is not displayed when very small value added while estimation.", + "fail_estimateTransaction_13": "The respective validate is not displayed when not added the transaction to the batch while estimation.", + "fail_estimateTransaction_14": "The respective validate is not displayed when provider not added while estimation.", + "fail_estimateTransaction_15": "The respective validate is not displayed when other provider added while estimation.", + "fail_estimateTransaction_16": "The respective validate is not displayed when incorrect token address added while estimation.", + "fail_estimateTransaction_17": "The respective validate is not displayed when invalid token address added while estimation.", + "fail_estimateTransaction_18": "The respective validate is not displayed when null token address added while estimation.", + "fail_estimateTransaction_19": "The respective validate is not displayed when token address not added while estimation.", + "vali_submitTransaction_uoHash": "The uoHash value is empty while submiting the transaction.", + "vali_submitTransaction_1": "Submitted the user op successfully.", + "vali_submitTransaction_2": "Could not submit any userop.", + "fail_submitTransaction_1": "An error message is displayed while submiting the transaction.", + "fail_getTransactionHash_1": "An error message is displayed while getting transaction hash.", + "fail_getUserOpReceipt_1": "An error is displayed while validating the userops receipts.", + "vali_deployAddress_1": "Account must be created first", + "vali_deployAddress_2": "The validation for non deployed address is displayed as expected while performing the concurrent userops.", + "fail_deployAddress_1": "The validation is not displayed when address is not deployed while performing the concurrent userops.", + "nativeTransaction_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE NATIVE TRANSACTION", + "_comment7": "Paymaster - Pimloco Paymaster", + "vali_pimlico_paymasterAddress_1": "The paymaster address is empty in the fetch paymaster address response.", + "vali_pimlico_paymasterAddress_2": "The paymaster address is not found as expected while fetching the paymaster address with invalid paymaster URL.", + "vali_pimlico_paymasterAddress_3": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address with invalid API Key.", + "vali_pimlico_paymasterAddress_4": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address without API Key.", + "vali_pimlico_paymasterAddress_5": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address with invalid chainid", + "vali_pimlico_paymasterAddress_6": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address without chainid", + "vali_pimlico_paymasterAddress_7": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address with invalid Entry Point Address.", + "vali_pimlico_paymasterAddress_8": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address with invalid token.", + "vali_pimlico_paymasterAddress_9": "The paymaster address is displayed as a undefined as expected while fetching the paymaster address without parameters.", + "fail_pimlico_paymasterAddress_1": "An error is displayed while fetching the pimlico paymaster address.", + "fail_pimlico_paymasterAddress_2": "The paymaster address is fetched with invalid paymaster URL.", + "fail_pimlico_paymasterAddress_3": "The paymaster address is fetched with invalid API Key.", + "fail_pimlico_paymasterAddress_4": "The paymaster address is fetched without API Key.", + "fail_pimlico_paymasterAddress_5": "The paymaster address is fetched with invalid chainid.", + "fail_pimlico_paymasterAddress_6": "The paymaster address is fetched without chainid.", + "fail_pimlico_paymasterAddress_7": "The paymaster address is fetched with invalid Entry Point Address.", + "fail_pimlico_paymasterAddress_8": "The paymaster address is fetched with invalid token.", + "fail_pimlico_paymasterAddress_9": "The paymaster address is fetched without parameters.", + "vali_erc20Contract_to": "The to address value is empty in the erc20 contract response.", + "vali_erc20Contract_data": "The data value is empty in the erc20 contract response.", + "vali_erc20Contract_1": "The validation for erc20Contract is displayed while generating the erc20Contract with incorrect token address.", + "vali_erc20Contract_2": "The validation for erc20Contract is displayed while generating the erc20Contract with invalid token address.", + "vali_erc20Contract_3": "The validation for erc20Contract is displayed while generating the erc20Contract with invalid paymaster address.", + "vali_erc20Contract_4": "The validation for erc20Contract is displayed while generating the erc20Contract with incorrect paymaster address.", + "fail_erc20Contract_1": "An error is displayed in the erc20 contract response.", + "fail_erc20Contract_2": "An error is displayed while fetching the paymaster address.", + "fail_erc20Contract_3": "The validation is not displayed while generating the erc20Contract with incorrect token address.", + "fail_erc20Contract_4": "The validation is not displayed while generating the erc20Contract with invalid token address.", + "fail_erc20Contract_5": "The validation is not displayed while generating the erc20Contract with invalid paymaster address.", + "fail_erc20Contract_6": "The validation is not displayed while generating the erc20Contract with incorrect paymaster address.", + "fail_paymasterAddress_1": "Unable to fetch the paymaster address.", + "pimlocoPaymaster_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE PIMLICO PAYMASTER", + "_comment8": "Paymaster - Arka Functions", + "vali_metadata_sponsorAddress": "The sponsorAddress is empty in the metadata response.", + "vali_metadata_sponsorWalletBalance": "The sponsorWalletBalance is empty in the metadata response.", + "vali_metadata_chainsSupported": "The chainsSupported is empty in the metadata response.", + "vali_metadata_tokenPaymasters": "The tokenPaymasters is empty in the metadata response.", + "fail_metadata_1": "An error is displayed while calling the metadata function of arka.", + "vali_getTokenPaymasterAddress_tokenPaymasterAddress": "The tokenPaymasterAddress is empty in the getTokenPaymasterAddress response.", + "vali_getTokenPaymasterAddress_1": "The validation is displayed while getting token paymaster address for incorrect token.", + "vali_getTokenPaymasterAddress_2": "The validation is displayed while getting token paymaster address without token.", + "fail_getTokenPaymasterAddress_1": "An error is displayed while calling the get token paymaster address function of arka.", + "fail_getTokenPaymasterAddress_2": "The respective validation not displayed while getting token paymaster address with incorrect token", + "fail_getTokenPaymasterAddress_3": "The respective validation not displayed while getting token paymaster address without token", + "vali_removeWhitelist_1": "Removed the address from whitelisted successfully.", + "vali_removeWhitelist_2": "The address is not whitelisted.", + "vali_removeWhitelist_3": "The validation is displayed while removing address from whitelist with invalid address.", + "vali_removeWhitelist_4": "The validation is displayed while removing address from whitelist with incorrect address.", + "fail_removeWhitelist_1": "An error is displayed while removing the address from whitelisting.", + "fail_removeWhitelist_2": "An error is displayed while calling the remove whitelist address function of arka.", + "fail_removeWhitelist_3": "The validation is not displayed while remove whitelist address with invalid address.", + "fail_removeWhitelist_4": "The validation is not displayed while remove whitelist address with incorrect address.", + "fail_removeWhitelist_5": "The validation is not displayed while remove whitelist address with random address.", + "fail_removeWhitelist_6": "The remove whitelist address function performed successfully with multiple random addresses.", + "vali_addWhitelist_1": "The address/es is/are whitelisted successfully.", + "vali_addWhitelist_2": "The address is already whitelisted.", + "vali_addWhitelist_3": "The validation is displayed while removing address from whitelist with invalid address.", + "vali_addWhitelist_4": "The validation is displayed while removing address from whitelist with incorrect address.", + "vali_addWhitelist_5": "The address is whitelisted successfully with random address.", + "fail_addWhitelist_1": "An error is displayed while whitelisting the address/es.", + "fail_addWhitelist_2": "An error is displayed while calling the add whitelist address function of arka.", + "fail_addWhitelist_3": "The validation is not displayed while add whitelist address with invalid address.", + "fail_addWhitelist_4": "The validation is not displayed while add whitelist address with incorrect address.", + "fail_addWhitelist_5": "The validation is not displayed while add whitelist address with random address.", + "fail_addWhitelist_6": "The add whitelist address function performed successfully with multiple random addresses.", + "fail_addWhitelist_7": "An error is displayed while whitelisting the random address.", + "vali_checkWhitelist_1": "The validation is displayed while checking address from whitelist with invalid address.", + "vali_checkWhitelist_2": "The validation is displayed while checking address from whitelist with incorrect address.", + "vali_checkWhitelist_3": "The validation message is displayed while checking the whitelist address without address.", + "fail_checkWhitelist_1": "An error is displayed while calling the check whitelist address function of arka.", + "fail_checkWhitelist_2": "The validation is not displayed while checking whitelist address with invalid address.", + "fail_checkWhitelist_3": "The validation is not displayed while checking whitelist address with incorrect address.", + "fail_checkWhitelist_4": "The validation is not displayed while checking whitelist address with random address.", + "fail_checkWhitelist_5": "The check whitelist address function performed successfully without address.", + "vali_deposit_1": "The amount deposited successfully.", + "vali_deposit_2": "The validation message is displayed while deposit with invalid amount.", + "fail_deposit_1": "An error is displayed while perform the deposit.", + "fail_deposit_2": "An error is displayed while calling the deposit function of arka.", + "fail_deposit_3": "The validation is not displayed while deposit with invalid amount.", + "arkaFunction_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE ARKA FUNCTION", + "_comment9": "Swap - Exchange offers", + "vali_exchangeOffers_1": "Found exchange supported assets.", + "vali_exchangeOffers_2": "The exchange supported assets is not displayed.", + "vali_exchangeOffers_3": "The Offers are not available in the getExchangeOffers response.", + "vali_exchangeOffers_4": "The validation is displayed while getting exchange offers with invalid fromTokenAddress", + "vali_exchangeOffers_5": "The validation is displayed while getting exchange offers without fromTokenAddress", + "vali_exchangeOffers_6": "The validation is displayed while getting exchange offers with invalid toTokenAddress", + "vali_exchangeOffers_7": "The validation is displayed while getting exchange offers without toTokenAddress", + "vali_exchangeOffers_8": "The validation is displayed while getting exchange offers with invalid fromAmount", + "vali_exchangeOffers_9": "The validation is displayed while getting exchange offers with decimal fromAmount", + "vali_exchangeOffers_10": "The validation is displayed while getting exchange offers with big fromAmount", + "vali_exchangeOffers_11": "The validation is displayed while getting exchange offers without fromAmount", + "fail_exchangeOffers_1": "An error is displayed in the Exchange offers response", + "fail_exchangeOffers_2": "The validation is not displayed while getting exchange offers with invalid fromTokenAddress.", + "fail_exchangeOffers_3": "The validation is not displayed while getting exchange offers without fromTokenAddress.", + "fail_exchangeOffers_4": "The validation is not displayed while getting exchange offers with invalid toTokenAddress.", + "fail_exchangeOffers_5": "The validation is not displayed while getting exchange offers without toTokenAddress.", + "fail_exchangeOffers_6": "The validation is not displayed while getting exchange offers with invalid fromAmount.", + "fail_exchangeOffers_7": "The validation is not displayed while getting exchange offers with decimal fromAmount.", + "fail_exchangeOffers_8": "The validation is not displayed while getting exchange offers with big fromAmount.", + "fail_exchangeOffers_9": "The validation is not displayed while getting exchange offers without fromAmount.", + "vali_exchangeOffers_address": "The address value is empty in the getExchangeSupportedAssets response.", + "vali_exchangeOffers_chainId": "The chainId value is not number in the getExchangeSupportedAssets response.", + "vali_exchangeOffers_name": "The name value is empty in the getExchangeSupportedAssets response.", + "vali_exchangeOffers_symbol": "The symbol value is empty in the getExchangeSupportedAssets response.", + "vali_exchangeOffers_decimals": "The decimals value is not number in the getExchangeSupportedAssets response.", + "vali_exchangeOffers_logoURI": "The logoURI value is empty in the getExchangeSupportedAssets response.", + "vali_exchangeOffers_provider": "The provider value is empty in the getExchangeOffers response.", + "vali_exchangeOffers_receiveAmount": "The receiveAmount value is empty in the getExchangeOffers response.", + "vali_exchangeOffers_exchangeRate": "The exchangeRate value is not number in the getExchangeOffers response.", + "vali_exchangeOffers_transactions": "The transactions value is empty in the getExchangeOffers response.", + "vali_exchangeOffers_typename": "The __typename value is empty in the getExchangeOffers response.", + "exchangeOffers_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE EXCHANGE OFFERS", + "_comment10": "Swap - Cross Chain Quotes", + "vali_crossChainQuotes_1": "The items are not available in the getCrossChainQuotes response.", + "vali_crossChainQuotes_2": "The validation is displayed while getting cross chain quotes without fromchainid.", + "vali_crossChainQuotes_3": "The validation is displayed while getting cross chain quotes without tochainid.", + "vali_crossChainQuotes_4": "The validation is displayed while getting cross chain quotes with invalid fromTokenAddress.", + "vali_crossChainQuotes_5": "The validation is displayed while getting cross chain quotes with incorrect fromTokenAddress.", + "vali_crossChainQuotes_6": "The validation is displayed while getting cross chain quotes without fromTokenAddress.", + "vali_crossChainQuotes_7": "The validation is displayed while getting cross chain quotes with invalid toTokenAddress.", + "vali_crossChainQuotes_8": "The validation is displayed while getting cross chain quotes with incorrect toTokenAddress.", + "vali_crossChainQuotes_9": "The validation is displayed while getting cross chain quotes without toTokenAddress.", + "vali_crossChainQuotes_10": "The validation is displayed while getting cross chain quotes with invalid fromAmount.", + "vali_crossChainQuotes_11": "The validation is displayed while getting cross chain quotes with incorrect fromAmount.", + "vali_crossChainQuotes_12": "The validation is displayed while getting cross chain quotes without fromAmount.", + "fail_crossChainQuotes_1": "An error is displayed in the getCrossChainQuotes response", + "fail_crossChainQuotes_2": "The validation is not displayed while getting cross chain quotes without fromchainid.", + "fail_crossChainQuotes_3": "The validation is not displayed while getting cross chain quotes without tochainid.", + "fail_crossChainQuotes_4": "The validation is not displayed while getting cross chain quotes with invalid fromTokenAddress.", + "fail_crossChainQuotes_5": "The validation is not displayed while getting cross chain quotes with incorrect fromTokenAddress.", + "fail_crossChainQuotes_6": "The validation is not displayed while getting cross chain quotes without fromTokenAddress.", + "fail_crossChainQuotes_7": "The validation is not displayed while getting cross chain quotes with invalid toTokenAddress.", + "fail_crossChainQuotes_8": "The validation is not displayed while getting cross chain quotes with incorrect toTokenAddress.", + "fail_crossChainQuotes_9": "The validation is not displayed while getting cross chain quotes without toTokenAddress.", + "fail_crossChainQuotes_10": "The validation is not displayed while getting cross chain quotes with invalid fromAmount.", + "fail_crossChainQuotes_11": "The validation is not displayed while getting cross chain quotes with incorrect fromAmount.", + "fail_crossChainQuotes_12": "The validation is not displayed while getting cross chain quotes without fromAmount.", + "vali_crossChainQuotes_provider": "The provider value is empty in the getCrossChainQuotes response.", + "vali_crossChainQuotes_data": "The data value is empty in the getCrossChainQuotes response.", + "vali_crossChainQuotes_to": "The to value is empty in the getCrossChainQuotes response.", + "vali_crossChainQuotes_value": "The value value is empty in the getCrossChainQuotes response.", + "vali_crossChainQuotes_from": "The from value is empty in the getCrossChainQuotes response.", + "vali_crossChainQuotes_chainId": "The chainId value is not number in the getCrossChainQuotes response.", + "crossChainQuotes_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE CROSS CHAIN QUOTES", + "_comment11": "Swap - Advance Routes LiFi", + "vali_advanceRoutesLiFi_1": "The quotes are not display in the quote list", + "vali_advanceRoutesLiFi_2": "The validation is displayed while getting advance routes lifi without fromChainId.", + "vali_advanceRoutesLiFi_3": "The validation is displayed while getting advance routes lifi without toChainId.", + "vali_advanceRoutesLiFi_4": "The validation is displayed while getting advance routes lifi with invalid fromTokenAddress.", + "vali_advanceRoutesLiFi_5": "The validation is displayed while getting advance routes lifi with incorrect fromTokenAddress.", + "vali_advanceRoutesLiFi_6": "The validation is displayed while getting advance routes lifi without fromTokenAddress.", + "vali_advanceRoutesLiFi_7": "The validation is displayed while getting advance routes lifi with invalid toTokenAddress.", + "vali_advanceRoutesLiFi_8": "The validation is displayed while getting advance routes lifi with incorrect toTokenAddress.", + "vali_advanceRoutesLiFi_9": "The validation is displayed while getting advance routes lifi without toTokenAddress.", + "vali_advanceRoutesLiFi_10": "The validation is displayed while getting advance routes lifi without fromAmount.", + "fail_advanceRoutesLiFi_1": "An error is displayed in the quote list response.", + "fail_advanceRoutesLiFi_2": "The validation is not displayed while getting advance routes lifi without fromChainId.", + "fail_advanceRoutesLiFi_3": "The validation is not displayed while getting advance routes lifi without toChainId.", + "fail_advanceRoutesLiFi_4": "The validation is not displayed while getting advance routes lifi with invalid fromTokenAddress.", + "fail_advanceRoutesLiFi_5": "The validation is not displayed while getting advance routes lifi with incorrect fromTokenAddress.", + "fail_advanceRoutesLiFi_6": "The validation is not displayed while getting advance routes lifi without fromTokenAddress.", + "fail_advanceRoutesLiFi_7": "The validation is not displayed while getting advance routes lifi with invalid toTokenAddress.", + "fail_advanceRoutesLiFi_8": "The validation is not displayed while getting advance routes lifi with incorrect toTokenAddress.", + "fail_advanceRoutesLiFi_9": "The validation is not displayed while getting advance routes lifi without toTokenAddress.", + "fail_advanceRoutesLiFi_10": "The validation is not displayed while getting advance routes lifi without fromAmount.", + "vali_advanceRoutesLiFi_id": "The id value is empty in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_fromChainId": "The fromChainId value is not number in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_fromAmountUSD": "The fromAmountUSD value is empty in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_fromAmount": "The fromAmount value is empty in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_fromToken": "The fromToken value is empty in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_fromAddress": "The fromAddress value is empty in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_toChainId": "The toChainId value is not number in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_toAmountUSD": "The toAmountUSD value is empty in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_toAmount": "The toAmount value is empty in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_toAmountMin": "The toAmountMin value is empty in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_toToken": "The toToken value is empty in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_toAddress": "The toAddress value is empty in the getAdvanceRoutesLiFi response.", + "vali_advanceRoutesLiFi_gasCostUSD": "The gasCostUSD value is empty in the getAdvanceRoutesLiFi response.", + "vali_stepTransaction_data": "The data value is empty in the stepTransaction response.", + "vali_stepTransaction_value": "The value value is empty in the stepTransaction response.", + "vali_stepTransaction_to": "The to value is empty in the stepTransaction response.", + "vali_stepTransaction_chainId": "The chainId value is not number in the stepTransaction response.", + "vali_stepTransaction_transactionType": "The transactionType value is empty in the stepTransaction response.", + "vali_stepTransaction_gasLimit": "The gasLimit value is empty in the stepTransaction response.", + "vali_stepTransaction_gasPrice": "The gasPrice value is empty in the stepTransaction response.", + "advanceRoutesLiFi_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE ADVANCE ROUTES LIFI", + "_comment12": "Transaction History", + "vali_getTransaction_1": "The transaction details is not display in the transaction history", + "fail_getTransaction_1": "An error message is displayed while getting transaction history.", + "vali_getTransaction_chainId": "The chainId value is not number in the getTransaction response.", + "vali_getTransaction_hash": "The hash value is empty in the getTransaction response.", + "vali_getTransaction_nonce": "The nonce value is not number in the getTransaction response.", + "vali_getTransaction_blockHash": "The blockHash value is empty in the getTransaction response.", + "vali_getTransaction_blockNumber": "The blockNumber value is not number in the getTransaction response.", + "vali_getTransaction_from": "The from value is empty in the getTransaction response.", + "vali_getTransaction_to": "The to value is empty in the getTransaction response.", + "vali_getTransaction_value": "The value value is empty in the getTransaction response.", + "vali_getTransaction_gasPrice": "The gasPrice value is empty in the getTransaction response.", + "vali_getTransaction_gasLimit": "The gasLimit value is not number in the getTransaction response.", + "vali_getTransaction_input": "The input value is empty in the getTransaction response.", + "vali_getTransaction_status": "The status value is empty in the getTransaction response.", + "vali_getTransaction_blockExplorerUrl": "The blockExplorerUrl value is empty in the getTransaction response.", + "vali_getTransaction_transactionIndex": "The transactionIndex value is not number in the getTransaction response.", + "vali_getTransaction_gasUsed": "The gasUsed value is not number in the getTransaction response.", + "vali_getTransaction_log_transactionIndex": "The transactionIndex value of the log is not number in the getTransaction response.", + "vali_getTransaction_log_blockNumber": "The blockNumber value of the log is not number in the getTransaction response.", + "vali_getTransaction_log_transactionHash": "The transactionHash value of the log is empty in the getTransaction response.", + "vali_getTransaction_log_address": "The address value of the log is empty in the getTransaction response.", + "vali_getTransaction_log_topics": "The topics value of the log is empty in the getTransaction response.", + "vali_getTransaction_log_data": "The data value of the log is empty in the getTransaction response.", + "vali_getTransaction_log_logIndex": "The logIndex value of the log is not number in the getTransaction response.", + "vali_getTransaction_log_blockHash": "The blockHash value of the log is empty in the getTransaction response.", + "getTransaction_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE GET TRANSACTION", + "_comment13": "Transactions History", + "vali_getTransactions_1": "The transaction details is not display in the transactions history", + "vali_getTransactions_2": "The null is received while fetching the transaction history with incorrect hash.", + "vali_getTransactions_3": "The validation message is displayed when hash not having 32 size hex while fetching the transaction history.", + "vali_getTransactions_4": "The transactions are not displayed in the transactions history with invalid chainid.", + "vali_getTransactions_5": "The transactions are not displayed in the transactions history with incorrect chainid.", + "vali_getTransactions_6": "The transactions are not displayed in the transactions history with invalid account.", + "vali_getTransactions_7": "The transactions are not displayed in the transactions history with incorrect account.", + "fail_getTransactions_1": "An error message is displayed while getting transactions history.", + "fail_getTransactions_2": "An error message is displayed while getting provider", + "fail_getTransactions_3": "An error message is displayed while getting erc20 contract interface", + "fail_getTransactions_4": "An error message is displayed while getting decimal", + "fail_getTransactions_5": "An error message is displayed while getting transfer from encoded data", + "fail_getTransactions_6": "Getting the single transaction history with incorrect Hash.", + "fail_getTransactions_7": "The transaction history is fetched with hash which not having 32 size hex.", + "fail_getTransactions_8": "The transactions are displayed while getting transactions history with invalid chainid", + "fail_getTransactions_9": "The transactions are displayed while getting transactions history with incorrect chainid", + "fail_getTransactions_10": "The transactions are displayed while getting transactions history with invalid account", + "fail_getTransactions_11": "The transactions are displayed while getting transactions history with incorrect account", + "vali_getTransactions_chainId": "The chainId value is not number in the getTransactions response.", + "vali_getTransactions_blockNumber": "The blockNumber value is not number in the getTransactions response.", + "vali_getTransactions_sender": "The sender value is empty in the getTransactions response.", + "vali_getTransactions_target": "The target value is empty in the getTransactions response.", + "vali_getTransactions_transactionHash": "The transactionHash value is empty in the getTransactions response.", + "vali_getTransactions_userOpHash": "The userOpHash value is empty in the getTransactions response.", + "vali_getTransactions_actualGasCost": "The actualGasCost value is not number in the get transactions response.", + "vali_getTransactions_actualGasUsed": "The actualGasUsed value is not number in the get transactions response.", + "vali_getTransactions_success": "The success value is empty in the get transactions response.", + "vali_getTransactions_timestamp": "The timestamp value is not number in the get transactions response.", + "vali_getTransactions_paymaster": "The paymaster value is empty in the get transactions response.", + "vali_getTransactions_value": "The value value is not number in the getTransactions response.", + "vali_getTransactions_blockExplorerUrl": "The blockExplorerUrl value is empty in the getTransactions response.", + "vali_getTransactions_input": "The input value is empty in the getTransactions response.", + "vali_getTransactions_nonce": "The nonce value is not number in the getTransactions response.", + "vali_getTransactions_initCode": "The initCode value is empty in the getTransactions response.", + "vali_getTransactions_callData": "The callData value is empty in the getTransactions response.", + "vali_getTransactions_verificationGasLimit": "The verificationGasLimit value is empty in the getTransactions response.", + "vali_getTransactions_preVerificationGas": "The preVerificationGas value is empty in the getTransactions response.", + "vali_getTransactions_maxFeePerGas": "The maxFeePerGas value is empty in the getTransactions response.", + "vali_getTransactions_maxPriorityFeePerGas": "The maxPriorityFeePerGas value is empty in the getTransactions response.", + "vali_getTransactions_nativeTransfers_from": "The from value of native transaction is empty in the getTransactions response.", + "vali_getTransactions_nativeTransfers_to": "The to value of native transaction is empty in the getTransactions response.", + "vali_getTransactions_nativeTransfers_value": "The value value of native transaction is empty in the getTransactions response.", + "vali_getTransactions_nativeTransfers_asset": "The asset value of native transaction is empty in the getTransactions response.", + "vali_getTransactions_nativeTransfers_address": "The address value of native transaction is empty in the getTransactions response.", + "vali_getTransactions_nativeTransfers_decimal": "The decimal value of native transaction is empty in the getTransactions response.", + "vali_getTransactions_nativeTransfers_data": "The data value of native transaction is empty in the getTransactions response.", + "vali_getTransactions_erc20Transfers_from": "The from value of erc20 transaction is empty in the getTransactions response.", + "vali_getTransactions_erc20Transfers_to": "The to value of erc20 transaction is empty in the getTransactions response.", + "vali_getTransactions_erc20Transfers_value": "The value value of erc20 transaction is empty in the getTransactions response.", + "vali_getTransactions_erc20Transfers_asset": "The asset value of erc20 transaction is empty in the getTransactions response.", + "vali_getTransactions_erc20Transfers_address": "The address value of erc20 transaction is empty in the getTransactions response.", + "vali_getTransactions_erc20Transfers_decimal": "The decimal value of erc20 transaction is empty in the getTransactions response.", + "vali_getTransactions_erc20Transfers_data": "The data value of erc20 transaction is empty in the getTransactions response.", + "getTransactions_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE GET TRANSACTIONS", + "_comment14": "Transaction - ERC 20 Token", + "vali_erc20Transfer_1": "The validation is displayed while transfer ERC20 token with incorrect token address.", + "vali_erc20Transfer_2": "The validation is displayed while transfer ERC20 token with invalid token address.", + "vali_erc20Transfer_3": "The validation is displayed while transfer ERC20 token with null token address.", + "vali_erc20Transfer_4": "The validation is displayed while transfer ERC20 token with incorrect transfer method name.", + "vali_erc20Transfer_5": "The validation is displayed while transfer ERC20 token with invalid value.", + "vali_erc20Transfer_6": "The validation is displayed while transfer ERC20 token with small value.", + "vali_erc20Transfer_7": "The validation is displayed while transfer ERC20 token without value.", + "vali_erc20Transfer_8": "The validation is displayed while transfer ERC20 token with incorrect recipient.", + "vali_erc20Transfer_9": "The validation is displayed while transfer ERC20 token with invalid recipient.", + "vali_erc20Transfer_10": "The validation is displayed while transfer ERC20 token without recipient.", + "fail_erc20Transfer_1": "The validation is not displayed while transfer ERC20 token with incorrect token address.", + "fail_erc20Transfer_2": "The validation is not displayed while transfer ERC20 token with invalid token address.", + "fail_erc20Transfer_3": "The validation is not displayed while transfer ERC20 token with null token address.", + "fail_erc20Transfer_4": "The validation is not displayed while transfer ERC20 token with incorrect transfer method name.", + "fail_erc20Transfer_5": "The validation is not displayed while transfer ERC20 token with invalid value.", + "fail_erc20Transfer_6": "The validation is not displayed while transfer ERC20 token with small value.", + "fail_erc20Transfer_7": "The validation is not displayed while transfer ERC20 token without value.", + "fail_erc20Transfer_8": "The validation is not displayed while transfer ERC20 token with incorrect recipient.", + "fail_erc20Transfer_9": "The validation is not displayed while transfer ERC20 token with invalid recipient.", + "fail_erc20Transfer_10": "The validation is not displayed while transfer ERC20 token without recipient.", + "vali_erc20Transfer_provider": "The isProvider value is false in the provider response.", + "fail_erc20Transfer_provider": "An error is displayed while getting the provider.", + "fail_erc20Transfer_contractInterface": "An error is displayed while getting the erc20 contract interface.", + "vali_erc20Contract_decimals": "The decimals value is empty while getting decimals from erc20 contract.", + "fail_erc20Contract_decimals": "An error is displayed while getting the decimals from erc20 contract.", + "vali_erc20Contract_transferFrom": "The decimals value is empty while getting transferFrom encoded data.", + "fail_erc20Contract_transferFrom": "An error is displayed while getting the transferFrom encoded data.", + "erc20Transaction_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE SEND ERC20 TOKEN", + "_comment15": "Transaction - ERC 721 Token", + "vali_erc721Transfer_1": "The validation is displayed while transfer ERC721 token with incorrect sender address.", + "vali_erc721Transfer_2": "The validation is displayed while transfer ERC721 token with invalid sender address.", + "vali_erc721Transfer_3": "The validation is displayed while transfer ERC721 token without sender address.", + "vali_erc721Transfer_4": "The validation is displayed while transfer ERC721 token with incorrect recipient address.", + "vali_erc721Transfer_5": "The validation is displayed while transfer ERC721 token with invalid recipient address.", + "vali_erc721Transfer_6": "The validation is displayed while transfer ERC721 token without recipient address.", + "vali_erc721Transfer_7": "The validation is displayed while transfer ERC721 token with incorrect tokenId.", + "vali_erc721Transfer_8": "The validation is displayed while transfer ERC721 token without tokenId.", + "fail_erc721Transfer_1": "The validation is not displayed while transfer ERC721 token with incorrect sender address.", + "fail_erc721Transfer_2": "The validation is not displayed while transfer ERC721 token with invalid sender address.", + "fail_erc721Transfer_3": "The validation is not displayed while transfer ERC721 token without sender address.", + "fail_erc721Transfer_4": "The validation is not displayed while transfer ERC721 token with incorrect recipient address.", + "fail_erc721Transfer_5": "The validation is not displayed while transfer ERC721 token with invalid recipient address.", + "fail_erc721Transfer_6": "The validation is not displayed while transfer ERC721 token without recipient address.", + "fail_erc721Transfer_7": "The validation is not displayed while transfer ERC721 token with incorrect tokenId.", + "fail_erc721Transfer_8": "The validation is not displayed while transfer ERC721 token without tokenId.", + "vali_erc721Transfer_contractInterface": "The erc721 Contract Interface value is empty in the erc721 Contract Interface response.", + "fail_erc721Transfer_contractInterface": "An error is displayed while getting the erc20 contract interface.", + "vali_erc721Contract_decimals": "The decimals value is empty while getting decimals from erc20 contract.", + "fail_erc721Contract_decimals": "An error is displayed while getting the decimals from erc20 contract.", + "vali_erc721Contract_transferFrom": "The decimals value is empty while getting transferFrom encoded data.", + "fail_erc721Contract_transferFrom": "An error is displayed while getting the transferFrom encoded data.", + "erc721Transaction_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE SEND ERC721 TOKEN", + "_comment16": "Connext Endpoints", + "vali_connext_getSupportedAssets_symbol": "The symbol value is empty in the getSupportedAssets response.", + "vali_connext_getSupportedAssets_address": "The address value is empty in the getSupportedAssets response.", + "vali_connext_getSupportedAssets_decimals": "The decimals value is not number in the getSupportedAssets response.", + "vali_connext_getSupportedAssets_chainId": "The chainId value is not number in the getSupportedAssets response.", + "vali_connext_getSupportedAssets_name": "The name value is empty in the getSupportedAssets response.", + "vali_connext_getSupportedAssets_icon": "The icon value is empty in the getSupportedAssets response.", + "vali_connext_getQuotes_data": "The data value is empty in the getQuotes response.", + "vali_connext_getQuotes_value": "The value value is empty in the getQuotes response.", + "vali_connext_getQuotes_to": "The to value is empty in the getQuotes response.", + "vali_connext_getTransactionStatus_status": "The status value is empty in the getTransactionStatus response.", + "vali_connext_getTransactionStatus_transactionHash": "The transactionHash value is empty in the getTransactionStatus response.", + "vali_connext_getTransactionStatus_connextscanUrl": "The connextscanUrl value is empty in the getTransactionStatus response.", + "vali_connext_1": "The assert not displayed in the list with invalid chainid.", + "vali_connext_2": "The validation is displayed while getting the quotes with invalid sender address.", + "vali_connext_3": "The validation is displayed while getting the quotes without sender address.", + "vali_connext_4": "The validation is displayed while getting the quotes with incorrect sender address.", + "vali_connext_5": "The validation is displayed while getting the quotes with invalid receipt address.", + "vali_connext_6": "The validation is displayed while getting the quotes without receipt address.", + "vali_connext_7": "The validation is displayed while getting the quotes with incorrect receipt address.", + "vali_connext_8": "The validation is displayed while getting the quotes without fromChainId.", + "vali_connext_9": "The validation is displayed while getting the quotes without toChainId.", + "vali_connext_10": "The validation is displayed while getting the quotes with invalid fromTokenAddress.", + "vali_connext_11": "The validation is displayed while getting the quotes with incorrect fromTokenAddress.", + "vali_connext_12": "The validation is displayed while getting the quotes without fromTokenAddress.", + "vali_connext_13": "The validation is displayed while getting the quotes with invalid value.", + "vali_connext_14": "The validation is displayed while getting the quotes with small value.", + "vali_connext_15": "The validation is displayed while getting the quotes without value.", + "vali_connext_16": "The validation is displayed while getting the quotes without slippage.", + "vali_connext_17": "The validation is displayed while getting the transaction status without fromChainId.", + "vali_connext_18": "The validation is displayed while getting the transaction status without toChainId.", + "vali_connext_19": "The validation is displayed while getting the transaction status with invalid transactionHash.", + "vali_connext_20": "The validation is displayed while getting the transaction status with incorrect transactionHash.", + "vali_connext_21": "The validation is displayed while getting the transaction status without transactionHash.", + "fail_connext_1": "An error is displayed while validating the all supported assets.", + "fail_connext_2": "An error is displayed while validating the selected supported assets.", + "fail_connext_3": "An error is displayed while validating the quotes.", + "fail_connext_4": "An error is displayed while validating the transaction status.", + "fail_connext_5": "The asserts are displayed in the list with invalid chainid.", + "fail_connext_6": "An error is displayed while getting the supported assets with invalid chainId.", + "fail_connext_7": "The validation is not displayed while getting the quotes with invalid sender address.", + "fail_connext_8": "The validation is not displayed while getting the quotes without sender address.", + "fail_connext_9": "The validation is not displayed while getting the quotes with incorrect sender address.", + "fail_connext_10": "The validation is not displayed while getting the quotes with invalid receipt address.", + "fail_connext_11": "The validation is not displayed while getting the quotes without receipts address.", + "fail_connext_12": "The validation is not displayed while getting the quotes with incorrect receipts address.", + "fail_connext_13": "The validation is not displayed while getting the quotes without fromChainId.", + "fail_connext_14": "The validation is not displayed while getting the quotes without toChainId.", + "fail_connext_15": "The validation is not displayed while getting the quotes with invalid fromTokenAddress.", + "fail_connext_16": "The validation is not displayed while getting the quotes with incorrect fromTokenAddress.", + "fail_connext_17": "The validation is not displayed while getting the quotes without fromTokenAddress.", + "fail_connext_18": "The validation is not displayed while getting the quotes with invalid value.", + "fail_connext_19": "The validation is not displayed while getting the quotes with small value.", + "fail_connext_20": "The validation is not displayed while getting the quotes without value.", + "fail_connext_21": "The validation is not displayed while getting the quotes without slippage.", + "fail_connext_22": "The validation is not displayed while getting the transaction status without fromChainId.", + "fail_connext_23": "The validation is not displayed while getting the transaction status without toChainId.", + "fail_connext_24": "The validation is not displayed while getting the transaction status with invalid transactionHash.", + "fail_connext_25": "The validation is not displayed while getting the transaction status with incorrect transactionHash.", + "fail_connext_26": "The validation is not displayed while getting the transaction status without transactionHash.", + "connext_insufficientBalance": "DUE TO INSUFFICIENT WALLET BALANCE, SKIPPING TEST CASE OF THE CONNEXT ENDPOINTS" +} diff --git a/test/specs/hostedServiceBanchmark/arbitrum.spec.js b/test/specs/hostedServiceBanchmark/arbitrum.spec.js index a328f67..5d647e5 100644 --- a/test/specs/hostedServiceBanchmark/arbitrum.spec.js +++ b/test/specs/hostedServiceBanchmark/arbitrum.spec.js @@ -11,7 +11,6 @@ import data from '../../data/testData.json' assert { type: 'json' }; let arbitrumMainNetSdk; describe('The PrimeSDK, when transfer a token with arbitrum network on the MainNet', function () { - it('SMOKE: Validate the time taken for the regular ERC20 token transaction on the arbitrum network', async function () { var test = this; @@ -24,8 +23,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }, + projectKey: process.env.PROJECT_KEY, + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } ); } catch (e) { console.error(e); @@ -38,7 +41,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum, + data.providerNetwork_arbitrum ); } catch (e) { console.error(e); @@ -53,7 +56,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider, + provider ); } catch (e) { console.error(e); @@ -71,7 +74,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The decimals from erc20 contract is not displayed correctly.', + 'The decimals from erc20 contract is not displayed correctly.' ); } @@ -80,14 +83,14 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)], + [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)] ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); assert.fail( - 'The decimals from erc20 contract is not displayed correctly.', + 'The decimals from erc20 contract is not displayed correctly.' ); } @@ -123,7 +126,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The estimate transactions added to the batch is not performed.', + 'The estimate transactions added to the batch is not performed.' ); } @@ -140,8 +143,17 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const ttfb_ms = performance.now() - startTime; // Calculate TTFB in milliseconds const ttfb_s = (ttfb_ms / 1000).toFixed(2); - addContext(test, 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the arbitrum network is ' + ttfb_s + ' seconds'); - console.log('Time to First Byte (TTFB) for the regular ERC20 token transaction on the arbitrum network is ' + ttfb_s + ' seconds') + addContext( + test, + 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the arbitrum network is ' + + ttfb_s + + ' seconds' + ); + console.log( + 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the arbitrum network is ' + + ttfb_s + + ' seconds' + ); }, data.retry); // Retry this async test up to 5 times }); @@ -149,7 +161,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; await customRetryAsync(async function () { const startTime = performance.now(); @@ -160,8 +172,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }, + projectKey: process.env.PROJECT_KEY, + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } ); } catch (e) { console.error(e); @@ -170,7 +186,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN assert.fail('The SDK is not initialled successfully.'); } - // get balance of the account address let balance; try { @@ -205,7 +220,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN body: JSON.stringify({ params: [data.entryPointAddress, { token: 'USDC' }], }), - }, + } ).then((res) => { return res.json(); }); @@ -216,7 +231,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The fetched value of the arka pimlico paymaster is not displayed.', + 'The fetched value of the arka pimlico paymaster is not displayed.' ); } @@ -225,12 +240,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { erc20Contract = new ethers.Contract( data.tokenAddress_arbitrumUSDC, - ERC20_ABI, - ); - encodedData = erc20Contract.interface.encodeFunctionData( - 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + ERC20_ABI ); + encodedData = erc20Contract.interface.encodeFunctionData('approve', [ + paymasterAddress, + ethers.constants.MaxUint256, + ]); await arbitrumMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_arbitrumUSDC, @@ -241,7 +256,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The erc20Contract value of the arka pimlico paymaster is not displayed.', + 'The erc20Contract value of the arka pimlico paymaster is not displayed.' ); } @@ -253,7 +268,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The approveOp value of the arka pimlico paymaster is not displayed.', + 'The approveOp value of the arka pimlico paymaster is not displayed.' ); } @@ -265,7 +280,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The uoHash1 value of the arka pimlico paymaster is not displayed.', + 'The uoHash1 value of the arka pimlico paymaster is not displayed.' ); } @@ -277,7 +292,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'Clear the transaction batch of the arka pimlico paymaster is not displayed.', + 'Clear the transaction batch of the arka pimlico paymaster is not displayed.' ); } @@ -292,7 +307,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The fetched value of the arka pimlico paymaster is not displayed.', + 'The fetched value of the arka pimlico paymaster is not displayed.' ); } @@ -304,7 +319,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The fetched value of the arka pimlico paymaster is not displayed.', + 'The fetched value of the arka pimlico paymaster is not displayed.' ); } @@ -314,14 +329,14 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN paymasterDetails: { url: `${data.paymaster_arka}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); assert.fail( - 'The fetched value of the arka pimlico paymaster is not displayed.', + 'The fetched value of the arka pimlico paymaster is not displayed.' ); } @@ -333,7 +348,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The fetched value of the arka pimlico paymaster is not displayed.', + 'The fetched value of the arka pimlico paymaster is not displayed.' ); } } else { @@ -344,8 +359,17 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN const ttfb_ms = performance.now() - startTime; // Calculate TTFB in milliseconds const ttfb_s = (ttfb_ms / 1000).toFixed(2); - addContext(test, 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the arbitrum network is ' + ttfb_s + ' seconds'); - console.log('Time to First Byte (TTFB) for the gasless ERC20 token transaction on the arbitrum network is ' + ttfb_s + ' seconds') + addContext( + test, + 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the arbitrum network is ' + + ttfb_s + + ' seconds' + ); + console.log( + 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the arbitrum network is ' + + ttfb_s + + ' seconds' + ); }, data.retry); // Retry this async test up to 5 times }); }); diff --git a/test/specs/hostedServiceBanchmark/fuse.spec.js b/test/specs/hostedServiceBanchmark/fuse.spec.js index 87d7445..569a5d8 100644 --- a/test/specs/hostedServiceBanchmark/fuse.spec.js +++ b/test/specs/hostedServiceBanchmark/fuse.spec.js @@ -11,7 +11,6 @@ import data from '../../data/testData.json' assert { type: 'json' }; let fuseMainNetSdk; describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', function () { - it('SMOKE: Validate the time taken for the regular ERC20 token transaction on the fuse network', async function () { var test = this; @@ -24,8 +23,12 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.fuse_chainid), - projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.fuse_chainid), process.env.BUNDLER_API_KEY) - }, + projectKey: process.env.PROJECT_KEY, + bundlerProvider: new EtherspotBundler( + Number(data.fuse_chainid), + process.env.BUNDLER_API_KEY + ), + } ); } catch (e) { console.error(e); @@ -38,7 +41,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_fuse, + data.providerNetwork_fuse ); } catch (e) { console.error(e); @@ -53,7 +56,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_fuseUSDC, ERC20_ABI, - provider, + provider ); } catch (e) { console.error(e); @@ -82,14 +85,14 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, "6")], + [data.recipient, ethers.utils.parseUnits(data.erc20_value, '6')] ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); assert.fail( - 'The decimals from erc20 contract is not displayed correctly.', + 'The decimals from erc20 contract is not displayed correctly.' ); } @@ -125,7 +128,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const eString = e.toString(); addContext(test, eString); assert.fail( - 'The estimate transactions added to the batch is not performed.', + 'The estimate transactions added to the batch is not performed.' ); } @@ -142,8 +145,17 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const ttfb_ms = performance.now() - startTime; // Calculate TTFB in milliseconds const ttfb_s = (ttfb_ms / 1000).toFixed(2); - addContext(test, 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the fuse network is : ' + ttfb_s + ' seconds'); - console.log('Time to First Byte (TTFB) for the regular ERC20 token transaction on the fuse network is : ' + ttfb_s + ' seconds') + addContext( + test, + 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the fuse network is : ' + + ttfb_s + + ' seconds' + ); + console.log( + 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the fuse network is : ' + + ttfb_s + + ' seconds' + ); }, data.retry); // Retry this async test up to 5 times }); @@ -159,8 +171,12 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.fuse_chainid), - projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.fuse_chainid), process.env.BUNDLER_API_KEY) - }, + projectKey: process.env.PROJECT_KEY, + bundlerProvider: new EtherspotBundler( + Number(data.fuse_chainid), + process.env.BUNDLER_API_KEY + ), + } ); } catch (e) { console.error(e); @@ -171,7 +187,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.fuse_chainid, + data.fuse_chainid )}`; // clear the transaction batch @@ -182,7 +198,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const eString = e.toString(); addContext(test, eString); assert.fail( - 'Clear the transaction batch of the arka pimlico paymaster is not displayed.', + 'Clear the transaction batch of the arka pimlico paymaster is not displayed.' ); } @@ -197,7 +213,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const eString = e.toString(); addContext(test, eString); assert.fail( - 'The add transactions to the batch of the arka pimlico paymaster is not displayed.', + 'The add transactions to the batch of the arka pimlico paymaster is not displayed.' ); } @@ -212,14 +228,14 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); assert.fail( - 'The estimate transactions added to the batch and get the fee data for the UserOp of the arka pimlico paymaster is not displayed.', + 'The estimate transactions added to the batch and get the fee data for the UserOp of the arka pimlico paymaster is not displayed.' ); } @@ -231,15 +247,24 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const eString = e.toString(); addContext(test, eString); assert.fail( - 'The sign the UserOp and sending to the bundler of the arka pimlico paymaster is not displayed.', + 'The sign the UserOp and sending to the bundler of the arka pimlico paymaster is not displayed.' ); } const ttfb_ms = performance.now() - startTime; // Calculate TTFB in milliseconds const ttfb_s = (ttfb_ms / 1000).toFixed(2); - addContext(test, 'Time to First Byte (TTFB) for the sponsored ERC20 token transaction on the fuse network is ' + ttfb_s + ' seconds'); - console.log('Time to First Byte (TTFB) for the sponsored ERC20 token transaction on the fuse network is ' + ttfb_s + ' seconds') + addContext( + test, + 'Time to First Byte (TTFB) for the sponsored ERC20 token transaction on the fuse network is ' + + ttfb_s + + ' seconds' + ); + console.log( + 'Time to First Byte (TTFB) for the sponsored ERC20 token transaction on the fuse network is ' + + ttfb_s + + ' seconds' + ); }, data.retry); // Retry this async test up to 5 times }); @@ -247,10 +272,9 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.fuse_chainid, + data.fuse_chainid )}`; await customRetryAsync(async function () { - const startTime = performance.now(); // initializating sdk @@ -259,8 +283,12 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.fuse_chainid), - projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.fuse_chainid), process.env.BUNDLER_API_KEY) - }, + projectKey: process.env.PROJECT_KEY, + bundlerProvider: new EtherspotBundler( + Number(data.fuse_chainid), + process.env.BUNDLER_API_KEY + ), + } ); } catch (e) { console.error(e); @@ -292,7 +320,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', body: JSON.stringify({ params: [data.entryPointAddress, { token: 'USDC' }], }), - }, + } ).then((res) => { return res.json(); }); @@ -303,7 +331,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const eString = e.toString(); addContext(test, eString); assert.fail( - 'The fetched value of the arka pimlico paymaster is not displayed.', + 'The fetched value of the arka pimlico paymaster is not displayed.' ); } @@ -312,12 +340,12 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', try { erc20Contract = new ethers.Contract( data.tokenAddress_fuseUSDC, - ERC20_ABI, - ); - encodedData = erc20Contract.interface.encodeFunctionData( - 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + ERC20_ABI ); + encodedData = erc20Contract.interface.encodeFunctionData('approve', [ + paymasterAddress, + ethers.constants.MaxUint256, + ]); await fuseMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_fuseUSDC, @@ -328,7 +356,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const eString = e.toString(); addContext(test, eString); assert.fail( - 'The erc20Contract value of the arka pimlico paymaster is not displayed.', + 'The erc20Contract value of the arka pimlico paymaster is not displayed.' ); } @@ -340,7 +368,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const eString = e.toString(); addContext(test, eString); assert.fail( - 'The get estimation of transaction of the arka pimlico paymaster is not displayed.', + 'The get estimation of transaction of the arka pimlico paymaster is not displayed.' ); } @@ -352,7 +380,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const eString = e.toString(); addContext(test, eString); assert.fail( - 'The uoHash1 value of the arka pimlico paymaster is not displayed.', + 'The uoHash1 value of the arka pimlico paymaster is not displayed.' ); } @@ -364,7 +392,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const eString = e.toString(); addContext(test, eString); assert.fail( - 'Clear the transaction batch of the arka pimlico paymaster is not displayed.', + 'Clear the transaction batch of the arka pimlico paymaster is not displayed.' ); } @@ -379,7 +407,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const eString = e.toString(); addContext(test, eString); assert.fail( - 'The add transactions to the batch of the arka pimlico paymaster is not displayed.', + 'The add transactions to the batch of the arka pimlico paymaster is not displayed.' ); } @@ -389,14 +417,14 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', paymasterDetails: { url: `${data.paymaster_arka}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); assert.fail( - 'The estimate transactions added to the batch and get the fee data for the UserOp of the arka pimlico paymaster is not displayed.', + 'The estimate transactions added to the batch and get the fee data for the UserOp of the arka pimlico paymaster is not displayed.' ); } @@ -408,7 +436,7 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const eString = e.toString(); addContext(test, eString); assert.fail( - 'The sign the UserOp and sending to the bundler of the arka pimlico paymaster is not displayed.', + 'The sign the UserOp and sending to the bundler of the arka pimlico paymaster is not displayed.' ); } } else { @@ -419,8 +447,17 @@ describe('The PrimeSDK, when transfer a token with fuse network on the MainNet', const ttfb_ms = performance.now() - startTime; // Calculate TTFB in milliseconds const ttfb_s = (ttfb_ms / 1000).toFixed(2); - addContext(test, 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the fuse network is ' + ttfb_s + ' seconds'); - console.log('Time to First Byte (TTFB) for the gasless ERC20 token transaction on the fuse network is ' + ttfb_s + ' seconds') + addContext( + test, + 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the fuse network is ' + + ttfb_s + + ' seconds' + ); + console.log( + 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the fuse network is ' + + ttfb_s + + ' seconds' + ); }, data.retry); // Retry this async test up to 5 times }); }); diff --git a/test/specs/hostedServiceBanchmark/matic.spec.js b/test/specs/hostedServiceBanchmark/matic.spec.js index 22694a5..a8a8cc6 100644 --- a/test/specs/hostedServiceBanchmark/matic.spec.js +++ b/test/specs/hostedServiceBanchmark/matic.spec.js @@ -11,7 +11,6 @@ import data from '../../data/testData.json' assert { type: 'json' }; let maticMainNetSdk; describe('The PrimeSDK, when transfer a token with matic network on the MainNet', function () { - it('SMOKE: Validate the time taken for the regular ERC20 token transaction on the matic network', async function () { var test = this; @@ -24,8 +23,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }, + projectKey: process.env.PROJECT_KEY, + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } ); } catch (e) { console.error(e); @@ -38,7 +41,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic, + data.providerNetwork_matic ); } catch (e) { console.error(e); @@ -53,7 +56,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider, + provider ); } catch (e) { console.error(e); @@ -71,7 +74,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' const eString = e.toString(); addContext(test, eString); assert.fail( - 'The decimals from erc20 contract is not displayed correctly.', + 'The decimals from erc20 contract is not displayed correctly.' ); } @@ -80,14 +83,14 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)], + [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)] ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); assert.fail( - 'The decimals from erc20 contract is not displayed correctly.', + 'The decimals from erc20 contract is not displayed correctly.' ); } @@ -123,7 +126,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' const eString = e.toString(); addContext(test, eString); assert.fail( - 'The estimate transactions added to the batch is not performed.', + 'The estimate transactions added to the batch is not performed.' ); } @@ -140,8 +143,17 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' const ttfb_ms = performance.now() - startTime; // Calculate TTFB in milliseconds const ttfb_s = (ttfb_ms / 1000).toFixed(2); - addContext(test, 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the matic network is: ' + ttfb_s + ' seconds'); - console.log('Time to First Byte (TTFB) for the regular ERC20 token transaction on the matic network is: ' + ttfb_s + ' seconds') + addContext( + test, + 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the matic network is: ' + + ttfb_s + + ' seconds' + ); + console.log( + 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the matic network is: ' + + ttfb_s + + ' seconds' + ); }, data.retry); // Retry this async test up to 5 times }); @@ -149,10 +161,9 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; await customRetryAsync(async function () { - const startTime = performance.now(); // initializating sdk @@ -161,8 +172,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }, + projectKey: process.env.PROJECT_KEY, + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } ); } catch (e) { console.error(e); @@ -194,7 +209,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' body: JSON.stringify({ params: [data.entryPointAddress, { token: 'USDC' }], }), - }, + } ).then((res) => { return res.json(); }); @@ -205,7 +220,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' const eString = e.toString(); addContext(test, eString); assert.fail( - 'The fetched value of the arka pimlico paymaster is not displayed.', + 'The fetched value of the arka pimlico paymaster is not displayed.' ); } @@ -214,12 +229,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { erc20Contract = new ethers.Contract( data.tokenAddress_maticUSDC, - ERC20_ABI, - ); - encodedData = erc20Contract.interface.encodeFunctionData( - 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + ERC20_ABI ); + encodedData = erc20Contract.interface.encodeFunctionData('approve', [ + paymasterAddress, + ethers.constants.MaxUint256, + ]); await maticMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_maticUSDC, @@ -230,7 +245,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' const eString = e.toString(); addContext(test, eString); assert.fail( - 'The erc20Contract value of the arka pimlico paymaster is not displayed.', + 'The erc20Contract value of the arka pimlico paymaster is not displayed.' ); } @@ -242,7 +257,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' const eString = e.toString(); addContext(test, eString); assert.fail( - 'The get estimation of transaction of the arka pimlico paymaster is not displayed.', + 'The get estimation of transaction of the arka pimlico paymaster is not displayed.' ); } @@ -254,7 +269,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' const eString = e.toString(); addContext(test, eString); assert.fail( - 'The uoHash1 value of the arka pimlico paymaster is not displayed.', + 'The uoHash1 value of the arka pimlico paymaster is not displayed.' ); } @@ -266,7 +281,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' const eString = e.toString(); addContext(test, eString); assert.fail( - 'Clear the transaction batch of the arka pimlico paymaster is not displayed.', + 'Clear the transaction batch of the arka pimlico paymaster is not displayed.' ); } @@ -281,7 +296,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' const eString = e.toString(); addContext(test, eString); assert.fail( - 'The add transactions to the batch of the arka pimlico paymaster is not displayed.', + 'The add transactions to the batch of the arka pimlico paymaster is not displayed.' ); } @@ -291,14 +306,14 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' paymasterDetails: { url: `${data.paymaster_arka}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); assert.fail( - 'The estimate transactions added to the batch and get the fee data for the UserOp of the arka pimlico paymaster is not displayed.', + 'The estimate transactions added to the batch and get the fee data for the UserOp of the arka pimlico paymaster is not displayed.' ); } @@ -310,7 +325,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' const eString = e.toString(); addContext(test, eString); assert.fail( - 'The sign the UserOp and sending to the bundler of the arka pimlico paymaster is not displayed.', + 'The sign the UserOp and sending to the bundler of the arka pimlico paymaster is not displayed.' ); } } else { @@ -321,8 +336,17 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' const ttfb_ms = performance.now() - startTime; // Calculate TTFB in milliseconds const ttfb_s = (ttfb_ms / 1000).toFixed(2); - addContext(test, 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the matic network is ' + ttfb_s + ' seconds'); - console.log('Time to First Byte (TTFB) for the gasless ERC20 token transaction on the matic network is ' + ttfb_s + ' seconds') + addContext( + test, + 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the matic network is ' + + ttfb_s + + ' seconds' + ); + console.log( + 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the matic network is ' + + ttfb_s + + ' seconds' + ); }, data.retry); // Retry this async test up to 5 times }); }); diff --git a/test/specs/hostedServiceBanchmark/optimism.spec.js b/test/specs/hostedServiceBanchmark/optimism.spec.js index a3bea32..4a3a07e 100644 --- a/test/specs/hostedServiceBanchmark/optimism.spec.js +++ b/test/specs/hostedServiceBanchmark/optimism.spec.js @@ -11,7 +11,6 @@ import data from '../../data/testData.json' assert { type: 'json' }; let optimismMainNetSdk; describe('The PrimeSDK, when transfer a token with optimism network on the MainNet', function () { - it('SMOKE: Validate the time taken for the regular ERC20 token transaction on the optimism network', async function () { var test = this; @@ -24,8 +23,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }, + projectKey: process.env.PROJECT_KEY, + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } ); } catch (e) { console.error(e); @@ -38,7 +41,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism, + data.providerNetwork_optimism ); } catch (e) { console.error(e); @@ -53,7 +56,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider, + provider ); } catch (e) { console.error(e); @@ -71,7 +74,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The decimals from erc20 contract is not displayed correctly.', + 'The decimals from erc20 contract is not displayed correctly.' ); } @@ -80,14 +83,14 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)], + [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)] ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); assert.fail( - 'The decimals from erc20 contract is not displayed correctly.', + 'The decimals from erc20 contract is not displayed correctly.' ); } @@ -123,7 +126,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The estimate transactions added to the batch is not performed.', + 'The estimate transactions added to the batch is not performed.' ); } @@ -140,8 +143,17 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN const ttfb_ms = performance.now() - startTime; // Calculate TTFB in milliseconds const ttfb_s = (ttfb_ms / 1000).toFixed(2); - addContext(test, 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the optimism network is ' + ttfb_s + ' seconds'); - console.log('Time to First Byte (TTFB) for the regular ERC20 token transaction on the optimism network is ' + ttfb_s + ' seconds'); + addContext( + test, + 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the optimism network is ' + + ttfb_s + + ' seconds' + ); + console.log( + 'Time to First Byte (TTFB) for the regular ERC20 token transaction on the optimism network is ' + + ttfb_s + + ' seconds' + ); }, data.retry); // Retry this async test up to 5 times }); @@ -149,10 +161,9 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; await customRetryAsync(async function () { - const startTime = performance.now(); // initializating sdk @@ -161,8 +172,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }, + projectKey: process.env.PROJECT_KEY, + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } ); } catch (e) { console.error(e); @@ -194,19 +209,18 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN body: JSON.stringify({ params: [data.entryPointAddress, { token: 'USDC' }], }), - }, + } ).then((res) => { return res.json(); }); paymasterAddress = returnedValue.message; - } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); assert.fail( - 'The fetched value of the arka pimlico paymaster is not displayed.', + 'The fetched value of the arka pimlico paymaster is not displayed.' ); } @@ -215,12 +229,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { erc20Contract = new ethers.Contract( data.tokenAddress_optimismUSDC, - ERC20_ABI, - ); - encodedData = erc20Contract.interface.encodeFunctionData( - 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + ERC20_ABI ); + encodedData = erc20Contract.interface.encodeFunctionData('approve', [ + paymasterAddress, + ethers.constants.MaxUint256, + ]); await optimismMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_optimismUSDC, @@ -231,7 +245,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The erc20Contract value of the arka pimlico paymaster is not displayed.', + 'The erc20Contract value of the arka pimlico paymaster is not displayed.' ); } @@ -243,7 +257,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The get estimation of transaction of the arka pimlico paymaster is not displayed.', + 'The get estimation of transaction of the arka pimlico paymaster is not displayed.' ); } @@ -255,7 +269,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The uoHash1 value of the arka pimlico paymaster is not displayed.', + 'The uoHash1 value of the arka pimlico paymaster is not displayed.' ); } @@ -267,7 +281,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'Clear the transaction batch of the arka pimlico paymaster is not displayed.', + 'Clear the transaction batch of the arka pimlico paymaster is not displayed.' ); } @@ -282,7 +296,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The add transactions to the batch of the arka pimlico paymaster is not displayed.', + 'The add transactions to the batch of the arka pimlico paymaster is not displayed.' ); } @@ -292,14 +306,14 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN paymasterDetails: { url: `${data.paymaster_arka}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); assert.fail( - 'The estimate transactions added to the batch and get the fee data for the UserOp of the arka pimlico paymaster is not displayed.', + 'The estimate transactions added to the batch and get the fee data for the UserOp of the arka pimlico paymaster is not displayed.' ); } @@ -311,7 +325,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN const eString = e.toString(); addContext(test, eString); assert.fail( - 'The sign the UserOp and sending to the bundler of the arka pimlico paymaster is not displayed.', + 'The sign the UserOp and sending to the bundler of the arka pimlico paymaster is not displayed.' ); } } else { @@ -322,8 +336,17 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN const ttfb_ms = performance.now() - startTime; // Calculate TTFB in milliseconds const ttfb_s = (ttfb_ms / 1000).toFixed(2); - addContext(test, 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the optimism network is ' + ttfb_s + ' seconds'); - console.log('Time to First Byte (TTFB) for the gasless ERC20 token transaction on the optimism network is ' + ttfb_s + ' seconds'); + addContext( + test, + 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the optimism network is ' + + ttfb_s + + ' seconds' + ); + console.log( + 'Time to First Byte (TTFB) for the gasless ERC20 token transaction on the optimism network is ' + + ttfb_s + + ' seconds' + ); }, data.retry); // Retry this async test up to 5 times }); }); diff --git a/test/specs/loadAndPerformance/arka/goerli.spec.js b/test/specs/loadAndPerformance/arka/goerli.spec.js index 042f0fd..e2e4026 100644 --- a/test/specs/loadAndPerformance/arka/goerli.spec.js +++ b/test/specs/loadAndPerformance/arka/goerli.spec.js @@ -1,6 +1,6 @@ import * as dotenv from 'dotenv'; dotenv.config(); // init dotenv -import { PrimeSdk} from '@etherspot/prime-sdk'; +import { PrimeSdk } from '@etherspot/prime-sdk'; import { ethers } from 'ethers'; import { assert } from 'chai'; import addContext from 'mochawesome/addContext.js'; @@ -249,14 +249,14 @@ describe('Performance testing of Arka Endpoints with Goerli Network', function ( { chainId: Number(data.goerli_chainid_testnet), projectKey: process.env.PROJECT_KEY_TESTNET, - }, + } ); try { assert.strictEqual( goerliTestNetSdk.state.EOAAddress, data.eoaAddress, - 'The EOA Address is not calculated correctly.', + 'The EOA Address is not calculated correctly.' ); } catch (e) { console.error(e); @@ -278,7 +278,7 @@ describe('Performance testing of Arka Endpoints with Goerli Network', function ( const eString = e.toString(); addContext(test, eString); assert.fail( - 'The Etherspot Wallet Address is not displayed successfully.', + 'The Etherspot Wallet Address is not displayed successfully.' ); } @@ -329,7 +329,7 @@ describe('Performance testing of Arka Endpoints with Goerli Network', function ( addContext(test, eString); assert.fail( - 'The estimate transactions added to the batch and get the fee data for the UserOp is not performed.', + 'The estimate transactions added to the batch and get the fee data for the UserOp is not performed.' ); } @@ -342,7 +342,7 @@ describe('Performance testing of Arka Endpoints with Goerli Network', function ( const eString = e.toString(); addContext(test, eString); assert.fail( - 'The sign the UserOp and sending to the bundler action is not performed.', + 'The sign the UserOp and sending to the bundler action is not performed.' ); } diff --git a/test/specs/loadAndPerformance/arka/mumbai.spec.js b/test/specs/loadAndPerformance/arka/mumbai.spec.js index 6225d74..3457ced 100644 --- a/test/specs/loadAndPerformance/arka/mumbai.spec.js +++ b/test/specs/loadAndPerformance/arka/mumbai.spec.js @@ -1,6 +1,6 @@ import * as dotenv from 'dotenv'; dotenv.config(); // init dotenv -import { PrimeSdk} from '@etherspot/prime-sdk'; +import { PrimeSdk } from '@etherspot/prime-sdk'; import { ethers } from 'ethers'; import { assert } from 'chai'; import addContext from 'mochawesome/addContext.js'; @@ -247,14 +247,14 @@ describe('Performance testing of Arka Endpoints with Mumbai Network', function ( { chainId: Number(data.mumbai_chainid_testnet), projectKey: process.env.PROJECT_KEY_TESTNET, - }, + } ); try { assert.strictEqual( mumbaiTestNetSdk.state.EOAAddress, data.eoaAddress, - 'The EOA Address is not calculated correctly.', + 'The EOA Address is not calculated correctly.' ); } catch (e) { console.error(e); @@ -276,7 +276,7 @@ describe('Performance testing of Arka Endpoints with Mumbai Network', function ( const eString = e.toString(); addContext(test, eString); assert.fail( - 'The Etherspot Wallet Address is not displayed successfully.', + 'The Etherspot Wallet Address is not displayed successfully.' ); } @@ -326,7 +326,7 @@ describe('Performance testing of Arka Endpoints with Mumbai Network', function ( const eString = e.toString(); addContext(test, eString); assert.fail( - 'The estimate transactions added to the batch and get the fee data for the UserOp is not performed.', + 'The estimate transactions added to the batch and get the fee data for the UserOp is not performed.' ); } @@ -338,7 +338,7 @@ describe('Performance testing of Arka Endpoints with Mumbai Network', function ( const eString = e.toString(); addContext(test, eString); assert.fail( - 'The sign the UserOp and sending to the bundler action is not performed.', + 'The sign the UserOp and sending to the bundler action is not performed.' ); } diff --git a/test/specs/loadAndPerformance/skandha/goerli.spec.js b/test/specs/loadAndPerformance/skandha/goerli.spec.js index ecec58f..6762fc4 100644 --- a/test/specs/loadAndPerformance/skandha/goerli.spec.js +++ b/test/specs/loadAndPerformance/skandha/goerli.spec.js @@ -42,7 +42,7 @@ describe('Performance testing of Skandha Endpoints with Goerli Network', functio try { assert.isNotEmpty( returnedValue.result, - 'The result value is empty in the skandha_getGasPrice response.', + 'The result value is empty in the skandha_getGasPrice response.' ); } catch (e) { console.error(e); @@ -94,7 +94,7 @@ describe('Performance testing of Skandha Endpoints with Goerli Network', functio try { assert.isNotEmpty( returnedValue.result, - 'The result value is empty in the skandha_config response.', + 'The result value is empty in the skandha_config response.' ); } catch (e) { console.error(e); @@ -146,7 +146,7 @@ describe('Performance testing of Skandha Endpoints with Goerli Network', functio try { assert.isNotEmpty( returnedValue.result, - 'The result value is empty in the skandha_feeHistory response.', + 'The result value is empty in the skandha_feeHistory response.' ); } catch (e) { console.error(e); @@ -198,7 +198,7 @@ describe('Performance testing of Skandha Endpoints with Goerli Network', functio try { assert.isNotEmpty( returnedValue.result, - 'The result value is empty in the eth_chainId response.', + 'The result value is empty in the eth_chainId response.' ); } catch (e) { console.error(e); @@ -250,7 +250,7 @@ describe('Performance testing of Skandha Endpoints with Goerli Network', functio try { assert.isNotEmpty( returnedValue.result, - 'The result value is empty in the eth_supportedEntryPoints response.', + 'The result value is empty in the eth_supportedEntryPoints response.' ); } catch (e) { console.error(e); @@ -306,48 +306,48 @@ describe('Performance testing of Skandha Endpoints with Goerli Network', functio try { assert.isNotEmpty( returnedValue[0].result, - 'The first result value is empty in the Batch RPC calls response.', + 'The first result value is empty in the Batch RPC calls response.' ); } catch (e) { console.error(e); assert.fail( - 'The first result value is not displayed correctly in the Batch RPC calls response.', + 'The first result value is not displayed correctly in the Batch RPC calls response.' ); } try { assert.isNotEmpty( returnedValue[1].result, - 'The second result value is empty in the Batch RPC calls response.', + 'The second result value is empty in the Batch RPC calls response.' ); } catch (e) { console.error(e); assert.fail( - 'The second result value is not displayed correctly in the Batch RPC calls response.', + 'The second result value is not displayed correctly in the Batch RPC calls response.' ); } try { assert.isNotEmpty( returnedValue[2].result, - 'The third result value is empty in the Batch RPC calls response.', + 'The third result value is empty in the Batch RPC calls response.' ); } catch (e) { console.error(e); assert.fail( - 'The third result value is not displayed correctly in the Batch RPC calls response.', + 'The third result value is not displayed correctly in the Batch RPC calls response.' ); } try { assert.isNotEmpty( returnedValue[3].result, - 'The fourth result value is empty in the Batch RPC calls response.', + 'The fourth result value is empty in the Batch RPC calls response.' ); } catch (e) { console.error(e); assert.fail( - 'The fourth result value is not displayed correctly in the Batch RPC calls response.', + 'The fourth result value is not displayed correctly in the Batch RPC calls response.' ); } } diff --git a/test/specs/loadAndPerformance/skandha/mumbai.spec.js b/test/specs/loadAndPerformance/skandha/mumbai.spec.js index 41ab0dd..7e4862d 100644 --- a/test/specs/loadAndPerformance/skandha/mumbai.spec.js +++ b/test/specs/loadAndPerformance/skandha/mumbai.spec.js @@ -42,7 +42,7 @@ describe('Performance testing of Skandha Endpoints with Mumbai Network', functio try { assert.isNotEmpty( returnedValue.result, - 'The result value is empty in the skandha_getGasPrice response.', + 'The result value is empty in the skandha_getGasPrice response.' ); } catch (e) { console.error(e); @@ -94,7 +94,7 @@ describe('Performance testing of Skandha Endpoints with Mumbai Network', functio try { assert.isNotEmpty( returnedValue.result, - 'The result value is empty in the skandha_config response.', + 'The result value is empty in the skandha_config response.' ); } catch (e) { console.error(e); @@ -146,7 +146,7 @@ describe('Performance testing of Skandha Endpoints with Mumbai Network', functio try { assert.isNotEmpty( returnedValue.result, - 'The result value is empty in the skandha_feeHistory response.', + 'The result value is empty in the skandha_feeHistory response.' ); } catch (e) { console.error(e); @@ -198,7 +198,7 @@ describe('Performance testing of Skandha Endpoints with Mumbai Network', functio try { assert.isNotEmpty( returnedValue.result, - 'The result value is empty in the eth_chainId response.', + 'The result value is empty in the eth_chainId response.' ); } catch (e) { console.error(e); @@ -250,7 +250,7 @@ describe('Performance testing of Skandha Endpoints with Mumbai Network', functio try { assert.isNotEmpty( returnedValue.result, - 'The result value is empty in the eth_supportedEntryPoints response.', + 'The result value is empty in the eth_supportedEntryPoints response.' ); } catch (e) { console.error(e); @@ -306,48 +306,48 @@ describe('Performance testing of Skandha Endpoints with Mumbai Network', functio try { assert.isNotEmpty( returnedValue[0].result, - 'The first result value is empty in the Batch RPC calls response.', + 'The first result value is empty in the Batch RPC calls response.' ); } catch (e) { console.error(e); assert.fail( - 'The first result value is not displayed correctly in the Batch RPC calls response.', + 'The first result value is not displayed correctly in the Batch RPC calls response.' ); } try { assert.isNotEmpty( returnedValue[1].result, - 'The second result value is empty in the Batch RPC calls response.', + 'The second result value is empty in the Batch RPC calls response.' ); } catch (e) { console.error(e); assert.fail( - 'The second result value is not displayed correctly in the Batch RPC calls response.', + 'The second result value is not displayed correctly in the Batch RPC calls response.' ); } try { assert.isNotEmpty( returnedValue[2].result, - 'The third result value is empty in the Batch RPC calls response.', + 'The third result value is empty in the Batch RPC calls response.' ); } catch (e) { console.error(e); assert.fail( - 'The third result value is not displayed correctly in the Batch RPC calls response.', + 'The third result value is not displayed correctly in the Batch RPC calls response.' ); } try { assert.isNotEmpty( returnedValue[3].result, - 'The fourth result value is empty in the Batch RPC calls response.', + 'The fourth result value is empty in the Batch RPC calls response.' ); } catch (e) { console.error(e); assert.fail( - 'The fourth result value is not displayed correctly in the Batch RPC calls response.', + 'The fourth result value is not displayed correctly in the Batch RPC calls response.' ); } } diff --git a/test/specs/mainnet/connext/arbitrum.spec.js b/test/specs/mainnet/connext/arbitrum.spec.js index 898afcc..a7a8c55 100644 --- a/test/specs/mainnet/connext/arbitrum.spec.js +++ b/test/specs/mainnet/connext/arbitrum.spec.js @@ -22,7 +22,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -31,8 +30,11 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -62,7 +64,8 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on assert.strictEqual( arbitrumEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -77,9 +80,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on // initializating Data service... try { - arbitrumDataService = new DataUtils( - process.env.DATA_API_KEY - ); + arbitrumDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -131,12 +132,10 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let allSupportedAssets; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { - allSupportedAssets = - await arbitrumDataService.getSupportedAssets({}); + allSupportedAssets = await arbitrumDataService.getSupportedAssets({}); try { assert.isNotEmpty( @@ -209,15 +208,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let supportedAssets; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { - supportedAssets = - await arbitrumDataService.getSupportedAssets({ - chainId: data.arbitrum_chainid, - provider: BridgingProvider.Connext, - }); + supportedAssets = await arbitrumDataService.getSupportedAssets({ + chainId: data.arbitrum_chainid, + provider: BridgingProvider.Connext, + }); try { assert.isNotEmpty( @@ -291,7 +288,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { @@ -318,10 +314,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on } try { - assert.isNotEmpty( - quotes[0].to, - message.vali_connext_getQuotes_to - ); + assert.isNotEmpty(quotes[0].to, message.vali_connext_getQuotes_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -354,7 +347,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -408,9 +400,9 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -493,22 +485,18 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let supportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { - supportedAssets = - await arbitrumDataService.getSupportedAssets({ - chainId: data.invalid_arbitrum_chainid, - provider: BridgingProvider.Connext, - }); + supportedAssets = await arbitrumDataService.getSupportedAssets({ + chainId: data.invalid_arbitrum_chainid, + provider: BridgingProvider.Connext, + }); if (supportedAssets.length === 0) { - addContext(test, message.vali_connext_1) - console.log(message.vali_connext_1) + addContext(test, message.vali_connext_1); + console.log(message.vali_connext_1); } else { - addContext(test, message.fail_connext_5) - assert.fail(message.fail_connext_5) + addContext(test, message.fail_connext_5); + assert.fail(message.fail_connext_5); } } catch (e) { console.error(e); @@ -527,9 +515,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.invalidSender, @@ -542,11 +527,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_7) + addContext(test, message.fail_connext_7); assert.fail(message.fail_connext_7); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_2) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_2); console.log(message.vali_connext_2); } else { console.error(e); @@ -566,9 +553,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ toAddress: data.recipient, @@ -580,11 +564,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_8) + addContext(test, message.fail_connext_8); assert.fail(message.fail_connext_8); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_3) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_3); console.log(message.vali_connext_3); } else { console.error(e); @@ -604,9 +590,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.incorrectSender, @@ -619,11 +602,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_9) + addContext(test, message.fail_connext_9); assert.fail(message.fail_connext_9); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_4) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_4); console.log(message.vali_connext_4); } else { console.error(e); @@ -643,9 +628,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -658,11 +640,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_10) + addContext(test, message.fail_connext_10); assert.fail(message.fail_connext_10); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_5) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_5); console.log(message.vali_connext_5); } else { console.error(e); @@ -682,9 +666,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -696,11 +677,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_11) + addContext(test, message.fail_connext_11); assert.fail(message.fail_connext_11); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_6) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_6); console.log(message.vali_connext_6); } else { console.error(e); @@ -720,9 +703,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -735,11 +715,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_12) + addContext(test, message.fail_connext_12); assert.fail(message.fail_connext_12); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_7) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_7); console.log(message.vali_connext_7); } else { console.error(e); @@ -759,9 +741,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -773,11 +752,11 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_13) + addContext(test, message.fail_connext_13); assert.fail(message.fail_connext_13); } catch (e) { if (e.message === constant.invalid_address_9) { - addContext(test, message.vali_connext_8) + addContext(test, message.vali_connext_8); console.log(message.vali_connext_8); } else { console.error(e); @@ -797,9 +776,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -811,11 +787,11 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_14) + addContext(test, message.fail_connext_14); assert.fail(message.fail_connext_14); } catch (e) { if (e.message === constant.invalid_address_10) { - addContext(test, message.vali_connext_9) + addContext(test, message.vali_connext_9); console.log(message.vali_connext_9); } else { console.error(e); @@ -835,9 +811,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -850,11 +823,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_15) + addContext(test, message.fail_connext_15); assert.fail(message.fail_connext_15); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_10) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_10); console.log(message.vali_connext_10); } else { console.error(e); @@ -874,9 +849,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -889,11 +861,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_16) + addContext(test, message.fail_connext_16); assert.fail(message.fail_connext_16); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_11) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_11); console.log(message.vali_connext_11); } else { console.error(e); @@ -913,9 +887,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -927,11 +898,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_17) + addContext(test, message.fail_connext_17); assert.fail(message.fail_connext_17); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_12) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_12); console.log(message.vali_connext_12); } else { console.error(e); @@ -951,9 +924,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -966,11 +936,11 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_18) + addContext(test, message.fail_connext_18); assert.fail(message.fail_connext_18); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_connext_13) + addContext(test, message.vali_connext_13); console.log(message.vali_connext_13); } else { console.error(e); @@ -990,9 +960,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -1005,11 +972,11 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_19) + addContext(test, message.fail_connext_19); assert.fail(message.fail_connext_19); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_connext_14) + addContext(test, message.vali_connext_14); console.log(message.vali_connext_14); } else { console.error(e); @@ -1029,9 +996,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -1043,11 +1007,14 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_20) + addContext(test, message.fail_connext_20); assert.fail(message.fail_connext_20); } catch (e) { - if (e.errors[0].constraints.IsBigNumberish === constant.invalid_bignumber_2) { - addContext(test, message.vali_connext_15) + if ( + e.errors[0].constraints.IsBigNumberish === + constant.invalid_bignumber_2 + ) { + addContext(test, message.vali_connext_15); console.log(message.vali_connext_15); } else { console.error(e); @@ -1067,9 +1034,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await arbitrumDataService.getQuotes({ fromAddress: data.sender, @@ -1081,11 +1045,11 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_21) + addContext(test, message.fail_connext_21); assert.fail(message.fail_connext_21); } catch (e) { if (e.message === constant.invalid_address_13) { - addContext(test, message.vali_connext_16) + addContext(test, message.vali_connext_16); console.log(message.vali_connext_16); } else { console.error(e); @@ -1104,9 +1068,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1116,11 +1077,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_22) + addContext(test, message.fail_connext_22); assert.fail(message.fail_connext_22); } catch (e) { - if (e.errors[0].constraints.isPositive === constant.invalid_chainid_4) { - addContext(test, message.vali_connext_17) + if ( + e.errors[0].constraints.isPositive === constant.invalid_chainid_4 + ) { + addContext(test, message.vali_connext_17); console.log(message.vali_connext_17); } else { console.error(e); @@ -1139,9 +1102,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1151,11 +1111,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_23) + addContext(test, message.fail_connext_23); assert.fail(message.fail_connext_23); } catch (e) { - if (e.errors[0].constraints.isPositive === constant.invalid_chainid_5) { - addContext(test, message.vali_connext_18) + if ( + e.errors[0].constraints.isPositive === constant.invalid_chainid_5 + ) { + addContext(test, message.vali_connext_18); console.log(message.vali_connext_18); } else { console.error(e); @@ -1174,9 +1136,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1187,11 +1146,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_24) + addContext(test, message.fail_connext_24); assert.fail(message.fail_connext_24); } catch (e) { - if (e.errors[0].constraints.isHex === constant.transactionHash_32hex) { - addContext(test, message.vali_connext_19) + if ( + e.errors[0].constraints.isHex === constant.transactionHash_32hex + ) { + addContext(test, message.vali_connext_19); console.log(message.vali_connext_19); } else { console.error(e); @@ -1210,9 +1171,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1224,7 +1182,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on }); if (transactionStatus.status === constant.invalid_chainid_6) { - addContext(test, message.vali_connext_20) + addContext(test, message.vali_connext_20); console.log(message.vali_connext_20); } else { addContext(test, eString); @@ -1246,9 +1204,6 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1258,11 +1213,13 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_26) + addContext(test, message.fail_connext_26); assert.fail(message.fail_connext_26); } catch (e) { - if (e.errors[0].constraints.isHex === constant.transactionHash_32hex) { - addContext(test, message.vali_connext_21) + if ( + e.errors[0].constraints.isHex === constant.transactionHash_32hex + ) { + addContext(test, message.vali_connext_21); console.log(message.vali_connext_21); } else { console.error(e); diff --git a/test/specs/mainnet/connext/matic.spec.js b/test/specs/mainnet/connext/matic.spec.js index 8b659ae..afffbf5 100644 --- a/test/specs/mainnet/connext/matic.spec.js +++ b/test/specs/mainnet/connext/matic.spec.js @@ -22,7 +22,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -31,8 +30,11 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -62,7 +64,8 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the assert.strictEqual( maticEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -77,9 +80,7 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the // initializating Data service... try { - maticDataService = new DataUtils( - process.env.DATA_API_KEY - ); + maticDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -131,12 +132,10 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let allSupportedAssets; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { - allSupportedAssets = - await maticDataService.getSupportedAssets({}); + allSupportedAssets = await maticDataService.getSupportedAssets({}); try { assert.isNotEmpty( @@ -209,15 +208,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let supportedAssets; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { - supportedAssets = - await maticDataService.getSupportedAssets({ - chainId: data.matic_chainid, - provider: BridgingProvider.Connext, - }); + supportedAssets = await maticDataService.getSupportedAssets({ + chainId: data.matic_chainid, + provider: BridgingProvider.Connext, + }); try { assert.isNotEmpty( @@ -291,7 +288,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { @@ -318,10 +314,7 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the } try { - assert.isNotEmpty( - quotes[0].to, - message.vali_connext_getQuotes_to - ); + assert.isNotEmpty(quotes[0].to, message.vali_connext_getQuotes_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -354,7 +347,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -408,9 +400,9 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -493,22 +485,18 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let supportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { - supportedAssets = - await maticDataService.getSupportedAssets({ - chainId: data.invalid_matic_chainid, - provider: BridgingProvider.Connext, - }); + supportedAssets = await maticDataService.getSupportedAssets({ + chainId: data.invalid_matic_chainid, + provider: BridgingProvider.Connext, + }); if (supportedAssets.length === 0) { - addContext(test, message.vali_connext_1) - console.log(message.vali_connext_1) + addContext(test, message.vali_connext_1); + console.log(message.vali_connext_1); } else { - addContext(test, message.fail_connext_5) - assert.fail(message.fail_connext_5) + addContext(test, message.fail_connext_5); + assert.fail(message.fail_connext_5); } } catch (e) { console.error(e); @@ -527,9 +515,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.invalidSender, @@ -542,11 +527,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_7) + addContext(test, message.fail_connext_7); assert.fail(message.fail_connext_7); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_2) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_2); console.log(message.vali_connext_2); } else { console.error(e); @@ -566,9 +553,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ toAddress: data.recipient, @@ -580,11 +564,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_8) + addContext(test, message.fail_connext_8); assert.fail(message.fail_connext_8); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_3) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_3); console.log(message.vali_connext_3); } else { console.error(e); @@ -604,9 +590,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.incorrectSender, @@ -619,11 +602,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_9) + addContext(test, message.fail_connext_9); assert.fail(message.fail_connext_9); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_4) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_4); console.log(message.vali_connext_4); } else { console.error(e); @@ -643,9 +628,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -658,11 +640,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_10) + addContext(test, message.fail_connext_10); assert.fail(message.fail_connext_10); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_5) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_5); console.log(message.vali_connext_5); } else { console.error(e); @@ -682,9 +666,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -696,11 +677,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_11) + addContext(test, message.fail_connext_11); assert.fail(message.fail_connext_11); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_6) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_6); console.log(message.vali_connext_6); } else { console.error(e); @@ -720,9 +703,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -735,11 +715,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_12) + addContext(test, message.fail_connext_12); assert.fail(message.fail_connext_12); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_7) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_7); console.log(message.vali_connext_7); } else { console.error(e); @@ -759,9 +741,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -773,11 +752,11 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_13) + addContext(test, message.fail_connext_13); assert.fail(message.fail_connext_13); } catch (e) { if (e.message === constant.invalid_address_9) { - addContext(test, message.vali_connext_8) + addContext(test, message.vali_connext_8); console.log(message.vali_connext_8); } else { console.error(e); @@ -797,9 +776,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -811,11 +787,11 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_14) + addContext(test, message.fail_connext_14); assert.fail(message.fail_connext_14); } catch (e) { if (e.message === constant.invalid_address_10) { - addContext(test, message.vali_connext_9) + addContext(test, message.vali_connext_9); console.log(message.vali_connext_9); } else { console.error(e); @@ -835,9 +811,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -850,11 +823,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_15) + addContext(test, message.fail_connext_15); assert.fail(message.fail_connext_15); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_10) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_10); console.log(message.vali_connext_10); } else { console.error(e); @@ -874,9 +849,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -889,11 +861,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_16) + addContext(test, message.fail_connext_16); assert.fail(message.fail_connext_16); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_11) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_11); console.log(message.vali_connext_11); } else { console.error(e); @@ -913,9 +887,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -927,11 +898,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_17) + addContext(test, message.fail_connext_17); assert.fail(message.fail_connext_17); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_12) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_12); console.log(message.vali_connext_12); } else { console.error(e); @@ -951,9 +924,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -966,11 +936,11 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_18) + addContext(test, message.fail_connext_18); assert.fail(message.fail_connext_18); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_connext_13) + addContext(test, message.vali_connext_13); console.log(message.vali_connext_13); } else { console.error(e); @@ -990,9 +960,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -1005,11 +972,11 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_19) + addContext(test, message.fail_connext_19); assert.fail(message.fail_connext_19); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_connext_14) + addContext(test, message.vali_connext_14); console.log(message.vali_connext_14); } else { console.error(e); @@ -1029,9 +996,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -1043,11 +1007,14 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_20) + addContext(test, message.fail_connext_20); assert.fail(message.fail_connext_20); } catch (e) { - if (e.errors[0].constraints.IsBigNumberish === constant.invalid_bignumber_2) { - addContext(test, message.vali_connext_15) + if ( + e.errors[0].constraints.IsBigNumberish === + constant.invalid_bignumber_2 + ) { + addContext(test, message.vali_connext_15); console.log(message.vali_connext_15); } else { console.error(e); @@ -1067,9 +1034,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await maticDataService.getQuotes({ fromAddress: data.sender, @@ -1081,11 +1045,11 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_21) + addContext(test, message.fail_connext_21); assert.fail(message.fail_connext_21); } catch (e) { if (e.message === constant.invalid_address_13) { - addContext(test, message.vali_connext_16) + addContext(test, message.vali_connext_16); console.log(message.vali_connext_16); } else { console.error(e); @@ -1104,9 +1068,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1116,11 +1077,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_22) + addContext(test, message.fail_connext_22); assert.fail(message.fail_connext_22); } catch (e) { - if (e.errors[0].constraints.isPositive === constant.invalid_chainid_4) { - addContext(test, message.vali_connext_17) + if ( + e.errors[0].constraints.isPositive === constant.invalid_chainid_4 + ) { + addContext(test, message.vali_connext_17); console.log(message.vali_connext_17); } else { console.error(e); @@ -1139,9 +1102,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1151,11 +1111,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_23) + addContext(test, message.fail_connext_23); assert.fail(message.fail_connext_23); } catch (e) { - if (e.errors[0].constraints.isPositive === constant.invalid_chainid_5) { - addContext(test, message.vali_connext_18) + if ( + e.errors[0].constraints.isPositive === constant.invalid_chainid_5 + ) { + addContext(test, message.vali_connext_18); console.log(message.vali_connext_18); } else { console.error(e); @@ -1174,9 +1136,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1187,11 +1146,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_24) + addContext(test, message.fail_connext_24); assert.fail(message.fail_connext_24); } catch (e) { - if (e.errors[0].constraints.isHex === constant.transactionHash_32hex) { - addContext(test, message.vali_connext_19) + if ( + e.errors[0].constraints.isHex === constant.transactionHash_32hex + ) { + addContext(test, message.vali_connext_19); console.log(message.vali_connext_19); } else { console.error(e); @@ -1210,9 +1171,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1224,7 +1182,7 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the }); if (transactionStatus.status === constant.invalid_chainid_6) { - addContext(test, message.vali_connext_20) + addContext(test, message.vali_connext_20); console.log(message.vali_connext_20); } else { addContext(test, eString); @@ -1246,9 +1204,6 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1258,11 +1213,13 @@ describe('The PrimeSDK, Validate the connext endpoints with matic network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_26) + addContext(test, message.fail_connext_26); assert.fail(message.fail_connext_26); } catch (e) { - if (e.errors[0].constraints.isHex === constant.transactionHash_32hex) { - addContext(test, message.vali_connext_21) + if ( + e.errors[0].constraints.isHex === constant.transactionHash_32hex + ) { + addContext(test, message.vali_connext_21); console.log(message.vali_connext_21); } else { console.error(e); diff --git a/test/specs/mainnet/connext/optimism.spec.js b/test/specs/mainnet/connext/optimism.spec.js index 9b2483c..3cf8022 100644 --- a/test/specs/mainnet/connext/optimism.spec.js +++ b/test/specs/mainnet/connext/optimism.spec.js @@ -22,7 +22,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -31,8 +30,11 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -62,7 +64,8 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on assert.strictEqual( optimismEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -77,9 +80,7 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on // initializating Data service... try { - optimismDataService = new DataUtils( - process.env.DATA_API_KEY - ); + optimismDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -131,12 +132,10 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let allSupportedAssets; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { - allSupportedAssets = - await optimismDataService.getSupportedAssets({}); + allSupportedAssets = await optimismDataService.getSupportedAssets({}); try { assert.isNotEmpty( @@ -209,15 +208,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let supportedAssets; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { - supportedAssets = - await optimismDataService.getSupportedAssets({ - chainId: data.optimism_chainid, - provider: BridgingProvider.Connext, - }); + supportedAssets = await optimismDataService.getSupportedAssets({ + chainId: data.optimism_chainid, + provider: BridgingProvider.Connext, + }); try { assert.isNotEmpty( @@ -291,7 +288,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { @@ -318,10 +314,7 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on } try { - assert.isNotEmpty( - quotes[0].to, - message.vali_connext_getQuotes_to - ); + assert.isNotEmpty(quotes[0].to, message.vali_connext_getQuotes_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -354,7 +347,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -408,9 +400,9 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -493,22 +485,18 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let supportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { - supportedAssets = - await optimismDataService.getSupportedAssets({ - chainId: data.invalid_optimism_chainid, - provider: BridgingProvider.Connext, - }); + supportedAssets = await optimismDataService.getSupportedAssets({ + chainId: data.invalid_optimism_chainid, + provider: BridgingProvider.Connext, + }); if (supportedAssets.length === 0) { - addContext(test, message.vali_connext_1) - console.log(message.vali_connext_1) + addContext(test, message.vali_connext_1); + console.log(message.vali_connext_1); } else { - addContext(test, message.fail_connext_5) - assert.fail(message.fail_connext_5) + addContext(test, message.fail_connext_5); + assert.fail(message.fail_connext_5); } } catch (e) { console.error(e); @@ -527,9 +515,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.invalidSender, @@ -542,11 +527,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_7) + addContext(test, message.fail_connext_7); assert.fail(message.fail_connext_7); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_2) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_2); console.log(message.vali_connext_2); } else { console.error(e); @@ -566,9 +553,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ toAddress: data.recipient, @@ -580,11 +564,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_8) + addContext(test, message.fail_connext_8); assert.fail(message.fail_connext_8); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_3) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_3); console.log(message.vali_connext_3); } else { console.error(e); @@ -604,9 +590,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.incorrectSender, @@ -619,11 +602,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_9) + addContext(test, message.fail_connext_9); assert.fail(message.fail_connext_9); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_4) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_4); console.log(message.vali_connext_4); } else { console.error(e); @@ -643,9 +628,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -658,11 +640,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_10) + addContext(test, message.fail_connext_10); assert.fail(message.fail_connext_10); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_5) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_5); console.log(message.vali_connext_5); } else { console.error(e); @@ -682,9 +666,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -696,11 +677,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_11) + addContext(test, message.fail_connext_11); assert.fail(message.fail_connext_11); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_6) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_6); console.log(message.vali_connext_6); } else { console.error(e); @@ -720,9 +703,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -735,11 +715,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_12) + addContext(test, message.fail_connext_12); assert.fail(message.fail_connext_12); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_7) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_7); console.log(message.vali_connext_7); } else { console.error(e); @@ -759,9 +741,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -773,11 +752,11 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_13) + addContext(test, message.fail_connext_13); assert.fail(message.fail_connext_13); } catch (e) { if (e.message === constant.invalid_address_9) { - addContext(test, message.vali_connext_8) + addContext(test, message.vali_connext_8); console.log(message.vali_connext_8); } else { console.error(e); @@ -797,9 +776,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -811,11 +787,11 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_14) + addContext(test, message.fail_connext_14); assert.fail(message.fail_connext_14); } catch (e) { if (e.message === constant.invalid_address_10) { - addContext(test, message.vali_connext_9) + addContext(test, message.vali_connext_9); console.log(message.vali_connext_9); } else { console.error(e); @@ -835,9 +811,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -850,11 +823,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_15) + addContext(test, message.fail_connext_15); assert.fail(message.fail_connext_15); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_10) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_10); console.log(message.vali_connext_10); } else { console.error(e); @@ -874,9 +849,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -889,11 +861,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_16) + addContext(test, message.fail_connext_16); assert.fail(message.fail_connext_16); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_11) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_11); console.log(message.vali_connext_11); } else { console.error(e); @@ -913,9 +887,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -927,11 +898,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_17) + addContext(test, message.fail_connext_17); assert.fail(message.fail_connext_17); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_12) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_12); console.log(message.vali_connext_12); } else { console.error(e); @@ -951,9 +924,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -966,11 +936,11 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_18) + addContext(test, message.fail_connext_18); assert.fail(message.fail_connext_18); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_connext_13) + addContext(test, message.vali_connext_13); console.log(message.vali_connext_13); } else { console.error(e); @@ -990,9 +960,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -1005,11 +972,11 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_19) + addContext(test, message.fail_connext_19); assert.fail(message.fail_connext_19); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_connext_14) + addContext(test, message.vali_connext_14); console.log(message.vali_connext_14); } else { console.error(e); @@ -1029,9 +996,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -1043,11 +1007,14 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_20) + addContext(test, message.fail_connext_20); assert.fail(message.fail_connext_20); } catch (e) { - if (e.errors[0].constraints.IsBigNumberish === constant.invalid_bignumber_2) { - addContext(test, message.vali_connext_15) + if ( + e.errors[0].constraints.IsBigNumberish === + constant.invalid_bignumber_2 + ) { + addContext(test, message.vali_connext_15); console.log(message.vali_connext_15); } else { console.error(e); @@ -1067,9 +1034,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await optimismDataService.getQuotes({ fromAddress: data.sender, @@ -1081,11 +1045,11 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_21) + addContext(test, message.fail_connext_21); assert.fail(message.fail_connext_21); } catch (e) { if (e.message === constant.invalid_address_13) { - addContext(test, message.vali_connext_16) + addContext(test, message.vali_connext_16); console.log(message.vali_connext_16); } else { console.error(e); @@ -1104,9 +1068,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1116,11 +1077,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_22) + addContext(test, message.fail_connext_22); assert.fail(message.fail_connext_22); } catch (e) { - if (e.errors[0].constraints.isPositive === constant.invalid_chainid_4) { - addContext(test, message.vali_connext_17) + if ( + e.errors[0].constraints.isPositive === constant.invalid_chainid_4 + ) { + addContext(test, message.vali_connext_17); console.log(message.vali_connext_17); } else { console.error(e); @@ -1139,9 +1102,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1151,11 +1111,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_23) + addContext(test, message.fail_connext_23); assert.fail(message.fail_connext_23); } catch (e) { - if (e.errors[0].constraints.isPositive === constant.invalid_chainid_5) { - addContext(test, message.vali_connext_18) + if ( + e.errors[0].constraints.isPositive === constant.invalid_chainid_5 + ) { + addContext(test, message.vali_connext_18); console.log(message.vali_connext_18); } else { console.error(e); @@ -1174,9 +1136,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1187,11 +1146,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_24) + addContext(test, message.fail_connext_24); assert.fail(message.fail_connext_24); } catch (e) { - if (e.errors[0].constraints.isHex === constant.transactionHash_32hex) { - addContext(test, message.vali_connext_19) + if ( + e.errors[0].constraints.isHex === constant.transactionHash_32hex + ) { + addContext(test, message.vali_connext_19); console.log(message.vali_connext_19); } else { console.error(e); @@ -1210,9 +1171,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1224,7 +1182,7 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on }); if (transactionStatus.status === constant.invalid_chainid_6) { - addContext(test, message.vali_connext_20) + addContext(test, message.vali_connext_20); console.log(message.vali_connext_20); } else { addContext(test, eString); @@ -1246,9 +1204,6 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1258,11 +1213,13 @@ describe('The PrimeSDK, Validate the connext endpoints with optimism network on provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_26) + addContext(test, message.fail_connext_26); assert.fail(message.fail_connext_26); } catch (e) { - if (e.errors[0].constraints.isHex === constant.transactionHash_32hex) { - addContext(test, message.vali_connext_21) + if ( + e.errors[0].constraints.isHex === constant.transactionHash_32hex + ) { + addContext(test, message.vali_connext_21); console.log(message.vali_connext_21); } else { console.error(e); diff --git a/test/specs/mainnet/connext/xdai.spec.js b/test/specs/mainnet/connext/xdai.spec.js index 8c13ae9..444b9b4 100644 --- a/test/specs/mainnet/connext/xdai.spec.js +++ b/test/specs/mainnet/connext/xdai.spec.js @@ -22,7 +22,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -31,8 +30,11 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.xdai_chainid), - bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.xdai_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -62,7 +64,8 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the assert.strictEqual( xdaiEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -77,9 +80,7 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the // initializating Data service... try { - xdaiDataService = new DataUtils( - process.env.DATA_API_KEY - ); + xdaiDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -131,12 +132,10 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let allSupportedAssets; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { - allSupportedAssets = - await xdaiDataService.getSupportedAssets({}); + allSupportedAssets = await xdaiDataService.getSupportedAssets({}); try { assert.isNotEmpty( @@ -209,15 +208,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let supportedAssets; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { - supportedAssets = - await xdaiDataService.getSupportedAssets({ - chainId: data.xdai_chainid, - provider: BridgingProvider.Connext, - }); + supportedAssets = await xdaiDataService.getSupportedAssets({ + chainId: data.xdai_chainid, + provider: BridgingProvider.Connext, + }); try { assert.isNotEmpty( @@ -291,7 +288,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { @@ -318,10 +314,7 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the } try { - assert.isNotEmpty( - quotes[0].to, - message.vali_connext_getQuotes_to - ); + assert.isNotEmpty(quotes[0].to, message.vali_connext_getQuotes_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -354,7 +347,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -408,9 +400,9 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -493,22 +485,18 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let supportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { - supportedAssets = - await xdaiDataService.getSupportedAssets({ - chainId: data.invalid_xdai_chainid, - provider: BridgingProvider.Connext, - }); + supportedAssets = await xdaiDataService.getSupportedAssets({ + chainId: data.invalid_xdai_chainid, + provider: BridgingProvider.Connext, + }); if (supportedAssets.length === 0) { - addContext(test, message.vali_connext_1) - console.log(message.vali_connext_1) + addContext(test, message.vali_connext_1); + console.log(message.vali_connext_1); } else { - addContext(test, message.fail_connext_5) - assert.fail(message.fail_connext_5) + addContext(test, message.fail_connext_5); + assert.fail(message.fail_connext_5); } } catch (e) { console.error(e); @@ -527,9 +515,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.invalidSender, @@ -542,11 +527,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_7) + addContext(test, message.fail_connext_7); assert.fail(message.fail_connext_7); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_2) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_2); console.log(message.vali_connext_2); } else { console.error(e); @@ -566,9 +553,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ toAddress: data.recipient, @@ -580,11 +564,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_8) + addContext(test, message.fail_connext_8); assert.fail(message.fail_connext_8); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_3) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_3); console.log(message.vali_connext_3); } else { console.error(e); @@ -604,9 +590,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.incorrectSender, @@ -619,11 +602,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_9) + addContext(test, message.fail_connext_9); assert.fail(message.fail_connext_9); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_4) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_4); console.log(message.vali_connext_4); } else { console.error(e); @@ -643,9 +628,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -658,11 +640,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_10) + addContext(test, message.fail_connext_10); assert.fail(message.fail_connext_10); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_5) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_5); console.log(message.vali_connext_5); } else { console.error(e); @@ -682,9 +666,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -696,11 +677,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_11) + addContext(test, message.fail_connext_11); assert.fail(message.fail_connext_11); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_6) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_6); console.log(message.vali_connext_6); } else { console.error(e); @@ -720,9 +703,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -735,11 +715,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_12) + addContext(test, message.fail_connext_12); assert.fail(message.fail_connext_12); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_7) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_7); console.log(message.vali_connext_7); } else { console.error(e); @@ -759,9 +741,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -773,11 +752,11 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_13) + addContext(test, message.fail_connext_13); assert.fail(message.fail_connext_13); } catch (e) { if (e.message === constant.invalid_address_9) { - addContext(test, message.vali_connext_8) + addContext(test, message.vali_connext_8); console.log(message.vali_connext_8); } else { console.error(e); @@ -797,9 +776,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -811,11 +787,11 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_14) + addContext(test, message.fail_connext_14); assert.fail(message.fail_connext_14); } catch (e) { if (e.message === constant.invalid_address_10) { - addContext(test, message.vali_connext_9) + addContext(test, message.vali_connext_9); console.log(message.vali_connext_9); } else { console.error(e); @@ -835,9 +811,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -850,11 +823,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_15) + addContext(test, message.fail_connext_15); assert.fail(message.fail_connext_15); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_10) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_10); console.log(message.vali_connext_10); } else { console.error(e); @@ -874,9 +849,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -889,11 +861,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_16) + addContext(test, message.fail_connext_16); assert.fail(message.fail_connext_16); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_11) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_11); console.log(message.vali_connext_11); } else { console.error(e); @@ -913,9 +887,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -927,11 +898,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_17) + addContext(test, message.fail_connext_17); assert.fail(message.fail_connext_17); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_12) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_12); console.log(message.vali_connext_12); } else { console.error(e); @@ -951,9 +924,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -966,11 +936,11 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_18) + addContext(test, message.fail_connext_18); assert.fail(message.fail_connext_18); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_connext_13) + addContext(test, message.vali_connext_13); console.log(message.vali_connext_13); } else { console.error(e); @@ -990,9 +960,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -1005,11 +972,11 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_19) + addContext(test, message.fail_connext_19); assert.fail(message.fail_connext_19); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_connext_14) + addContext(test, message.vali_connext_14); console.log(message.vali_connext_14); } else { console.error(e); @@ -1029,9 +996,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -1043,11 +1007,14 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_20) + addContext(test, message.fail_connext_20); assert.fail(message.fail_connext_20); } catch (e) { - if (e.errors[0].constraints.IsBigNumberish === constant.invalid_bignumber_2) { - addContext(test, message.vali_connext_15) + if ( + e.errors[0].constraints.IsBigNumberish === + constant.invalid_bignumber_2 + ) { + addContext(test, message.vali_connext_15); console.log(message.vali_connext_15); } else { console.error(e); @@ -1067,9 +1034,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await xdaiDataService.getQuotes({ fromAddress: data.sender, @@ -1081,11 +1045,11 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_21) + addContext(test, message.fail_connext_21); assert.fail(message.fail_connext_21); } catch (e) { if (e.message === constant.invalid_address_13) { - addContext(test, message.vali_connext_16) + addContext(test, message.vali_connext_16); console.log(message.vali_connext_16); } else { console.error(e); @@ -1104,9 +1068,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1116,11 +1077,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_22) + addContext(test, message.fail_connext_22); assert.fail(message.fail_connext_22); } catch (e) { - if (e.errors[0].constraints.isPositive === constant.invalid_chainid_4) { - addContext(test, message.vali_connext_17) + if ( + e.errors[0].constraints.isPositive === constant.invalid_chainid_4 + ) { + addContext(test, message.vali_connext_17); console.log(message.vali_connext_17); } else { console.error(e); @@ -1139,9 +1102,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1151,11 +1111,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_23) + addContext(test, message.fail_connext_23); assert.fail(message.fail_connext_23); } catch (e) { - if (e.errors[0].constraints.isPositive === constant.invalid_chainid_5) { - addContext(test, message.vali_connext_18) + if ( + e.errors[0].constraints.isPositive === constant.invalid_chainid_5 + ) { + addContext(test, message.vali_connext_18); console.log(message.vali_connext_18); } else { console.error(e); @@ -1174,9 +1136,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1187,11 +1146,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_24) + addContext(test, message.fail_connext_24); assert.fail(message.fail_connext_24); } catch (e) { - if (e.errors[0].constraints.isHex === constant.transactionHash_32hex) { - addContext(test, message.vali_connext_19) + if ( + e.errors[0].constraints.isHex === constant.transactionHash_32hex + ) { + addContext(test, message.vali_connext_19); console.log(message.vali_connext_19); } else { console.error(e); @@ -1210,9 +1171,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1224,7 +1182,7 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the }); if (transactionStatus.status === constant.invalid_chainid_6) { - addContext(test, message.vali_connext_20) + addContext(test, message.vali_connext_20); console.log(message.vali_connext_20); } else { addContext(test, eString); @@ -1246,9 +1204,6 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1258,11 +1213,13 @@ describe('The PrimeSDK, Validate the connext endpoints with xdai network on the provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_26) + addContext(test, message.fail_connext_26); assert.fail(message.fail_connext_26); } catch (e) { - if (e.errors[0].constraints.isHex === constant.transactionHash_32hex) { - addContext(test, message.vali_connext_21) + if ( + e.errors[0].constraints.isHex === constant.transactionHash_32hex + ) { + addContext(test, message.vali_connext_21); console.log(message.vali_connext_21); } else { console.error(e); diff --git a/test/specs/mainnet/getAddresses/arbitrum.spec.js b/test/specs/mainnet/getAddresses/arbitrum.spec.js index 767747b..bf9c94f 100644 --- a/test/specs/mainnet/getAddresses/arbitrum.spec.js +++ b/test/specs/mainnet/getAddresses/arbitrum.spec.js @@ -19,17 +19,18 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { arbitrumMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - factoryWallet: Factory.ZERO_DEV, bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }, + factoryWallet: Factory.ZERO_DEV, + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -79,17 +80,18 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { arbitrumMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - factoryWallet: Factory.SIMPLE_ACCOUNT, bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }, + factoryWallet: Factory.SIMPLE_ACCOUNT, + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -119,7 +121,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( arbitrumSimpleAccountAddress, data.simpleaccount_address, - message.vali_simple_account, + message.vali_simple_account ); } catch (e) { console.error(e); @@ -139,17 +141,17 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { arbitrumMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -179,7 +181,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( arbitrumAccountAddress, data.sender, - message.vali_account_address, + message.vali_account_address ); } catch (e) { console.error(e); @@ -199,8 +201,14 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - projectKey: process.env.PROJECT_KEY, index: 1, bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }); + projectKey: process.env.PROJECT_KEY, + index: 1, + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } + ); try { assert.strictEqual( @@ -229,7 +237,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( arbitrumAccountAddress1, data.sender1, - message.vali_account_address, + message.vali_account_address ); } catch (e) { console.error(e); diff --git a/test/specs/mainnet/getAddresses/matic.spec.js b/test/specs/mainnet/getAddresses/matic.spec.js index e11de40..aa5583f 100644 --- a/test/specs/mainnet/getAddresses/matic.spec.js +++ b/test/specs/mainnet/getAddresses/matic.spec.js @@ -19,17 +19,18 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { maticMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - factoryWallet: Factory.ZERO_DEV, bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }, + factoryWallet: Factory.ZERO_DEV, + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -79,17 +80,18 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { maticMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - factoryWallet: Factory.SIMPLE_ACCOUNT, bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }, + factoryWallet: Factory.SIMPLE_ACCOUNT, + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -119,7 +121,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( maticSimpleAccountAddress, data.simpleaccount_address, - message.vali_simple_account, + message.vali_simple_account ); } catch (e) { console.error(e); @@ -139,17 +141,17 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { maticMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -172,14 +174,13 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d // get account address try { - maticAccountAddress = - await maticMainNetSdk.getCounterFactualAddress(); + maticAccountAddress = await maticMainNetSdk.getCounterFactualAddress(); try { assert.strictEqual( maticAccountAddress, data.sender, - message.vali_account_address, + message.vali_account_address ); } catch (e) { console.error(e); @@ -199,8 +200,14 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - projectKey: process.env.PROJECT_KEY, index: 1, bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }); + projectKey: process.env.PROJECT_KEY, + index: 1, + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } + ); try { assert.strictEqual( @@ -229,7 +236,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( maticAccountAddress1, data.sender1, - message.vali_account_address, + message.vali_account_address ); } catch (e) { console.error(e); diff --git a/test/specs/mainnet/getAddresses/optimism.spec.js b/test/specs/mainnet/getAddresses/optimism.spec.js index c6837dc..a3157f8 100644 --- a/test/specs/mainnet/getAddresses/optimism.spec.js +++ b/test/specs/mainnet/getAddresses/optimism.spec.js @@ -19,17 +19,18 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { optimismMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - factoryWallet: Factory.ZERO_DEV, bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }, + factoryWallet: Factory.ZERO_DEV, + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -79,17 +80,18 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { optimismMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - factoryWallet: Factory.SIMPLE_ACCOUNT, bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }, + factoryWallet: Factory.SIMPLE_ACCOUNT, + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -119,7 +121,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( optimismSimpleAccountAddress, data.simpleaccount_address, - message.vali_simple_account, + message.vali_simple_account ); } catch (e) { console.error(e); @@ -139,17 +141,17 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { optimismMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -179,7 +181,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( optimismAccountAddress, data.sender, - message.vali_account_address, + message.vali_account_address ); } catch (e) { console.error(e); @@ -199,8 +201,14 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - projectKey: process.env.PROJECT_KEY, index: 1, bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }); + projectKey: process.env.PROJECT_KEY, + index: 1, + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } + ); try { assert.strictEqual( @@ -229,7 +237,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( optimismAccountAddress1, data.sender1, - message.vali_account_address, + message.vali_account_address ); } catch (e) { console.error(e); diff --git a/test/specs/mainnet/getAddresses/xdai.spec.js b/test/specs/mainnet/getAddresses/xdai.spec.js index e48ea9a..1f551ac 100644 --- a/test/specs/mainnet/getAddresses/xdai.spec.js +++ b/test/specs/mainnet/getAddresses/xdai.spec.js @@ -19,17 +19,18 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { xdaiMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.xdai_chainid), - factoryWallet: Factory.ZERO_DEV, bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY) - }, + factoryWallet: Factory.ZERO_DEV, + bundlerProvider: new EtherspotBundler( + Number(data.xdai_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -79,17 +80,18 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { xdaiMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.xdai_chainid), - factoryWallet: Factory.SIMPLE_ACCOUNT, bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY) - }, + factoryWallet: Factory.SIMPLE_ACCOUNT, + bundlerProvider: new EtherspotBundler( + Number(data.xdai_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -119,7 +121,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( xdaiSimpleAccountAddress, data.simpleaccount_address, - message.vali_simple_account, + message.vali_simple_account ); } catch (e) { console.error(e); @@ -139,17 +141,17 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { xdaiMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.xdai_chainid), - bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.xdai_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -172,14 +174,13 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d // get account address try { - xdaiAccountAddress = - await xdaiMainNetSdk.getCounterFactualAddress(); + xdaiAccountAddress = await xdaiMainNetSdk.getCounterFactualAddress(); try { assert.strictEqual( xdaiAccountAddress, data.sender, - message.vali_account_address, + message.vali_account_address ); } catch (e) { console.error(e); @@ -199,8 +200,14 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.xdai_chainid), - projectKey: process.env.PROJECT_KEY, index: 1, bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY) - }); + projectKey: process.env.PROJECT_KEY, + index: 1, + bundlerProvider: new EtherspotBundler( + Number(data.xdai_chainid), + process.env.BUNDLER_API_KEY + ), + } + ); try { assert.strictEqual( @@ -222,14 +229,13 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d // get account address try { - xdaiAccountAddress1 = - await xdaiMainNetSdk1.getCounterFactualAddress(); + xdaiAccountAddress1 = await xdaiMainNetSdk1.getCounterFactualAddress(); try { assert.strictEqual( xdaiAccountAddress1, data.sender1, - message.vali_account_address, + message.vali_account_address ); } catch (e) { console.error(e); diff --git a/test/specs/mainnet/listAndRates/arbitrum.spec.js b/test/specs/mainnet/listAndRates/arbitrum.spec.js index 30ac208..b774ff3 100644 --- a/test/specs/mainnet/listAndRates/arbitrum.spec.js +++ b/test/specs/mainnet/listAndRates/arbitrum.spec.js @@ -21,7 +21,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -30,15 +29,19 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( arbitrumMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -60,7 +63,8 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det assert.strictEqual( arbitrumEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -75,9 +79,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det // initializating Data service... try { - arbitrumDataService = new DataUtils( - process.env.DATA_API_KEY - ); + arbitrumDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -128,7 +130,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let nfts; @@ -139,13 +140,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det }); if (nfts.items.length > 0) { - addContext(test, message.pass_nft_list_1) + addContext(test, message.pass_nft_list_1); console.log(message.pass_nftList_1); try { assert.isNotEmpty( nfts.items[0].contractName, - message.vali_nftList_contractName, + message.vali_nftList_contractName ); } catch (e) { console.error(e); @@ -156,7 +157,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( nfts.items[0].contractAddress, - message.vali_nftList_contractAddress, + message.vali_nftList_contractAddress ); } catch (e) { console.error(e); @@ -200,7 +201,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( nfts.items[0].items[0].name, - message.vali_nftList_items_name, + message.vali_nftList_items_name ); } catch (e) { console.error(e); @@ -211,7 +212,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( nfts.items[0].items[0].amount, - message.vali_nftList_items_amount, + message.vali_nftList_items_amount ); } catch (e) { console.error(e); @@ -219,7 +220,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_nftList_2) + addContext(test, message.pass_nftList_2); console.log(message.pass_nftList_2); } } catch (e) { @@ -238,13 +239,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let tokenLists; let tokenListTokens; try { - tokenLists = await arbitrumDataService.getTokenLists({ chainId: data.arbitrum_chainid }); + tokenLists = await arbitrumDataService.getTokenLists({ + chainId: data.arbitrum_chainid, + }); if (tokenLists.length > 0) { console.log(message.pass_tokenList_1); @@ -253,7 +255,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenLists[0].name, - message.vali_tokenList_name, + message.vali_tokenList_name ); } catch (e) { console.error(e); @@ -264,7 +266,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenLists[0].endpoint, - message.vali_tokenList_endpoint, + message.vali_tokenList_endpoint ); } catch (e) { console.error(e); @@ -272,11 +274,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_2) + addContext(test, message.pass_tokenList_2); console.log(message.pass_tokenList_2); } - tokenListTokens = await arbitrumDataService.getTokenListTokens({ chainId: data.arbitrum_chainid }); + tokenListTokens = await arbitrumDataService.getTokenListTokens({ + chainId: data.arbitrum_chainid, + }); if (tokenListTokens.length > 0) { console.log(message.pass_tokenList_3); @@ -285,7 +289,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].address, - message.vali_tokenListTokens_address, + message.vali_tokenListTokens_address ); } catch (e) { console.error(e); @@ -296,7 +300,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].name, - message.vali_tokenListTokens_name, + message.vali_tokenListTokens_name ); } catch (e) { console.error(e); @@ -307,7 +311,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].symbol, - message.vali_tokenListTokens_symbol, + message.vali_tokenListTokens_symbol ); } catch (e) { console.error(e); @@ -318,7 +322,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( tokenListTokens[0].decimals, - message.vali_tokenListTokens_decimals, + message.vali_tokenListTokens_decimals ); } catch (e) { console.error(e); @@ -340,7 +344,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( tokenListTokens[0].chainId, - message.vali_tokenListTokens_chainId, + message.vali_tokenListTokens_chainId ); } catch (e) { console.error(e); @@ -348,12 +352,11 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_4) + addContext(test, message.pass_tokenList_4); console.log(message.pass_tokenList_4); } if (tokenLists.length > 0) { - const { name } = tokenLists[0]; tokenListTokens = await arbitrumDataService.getTokenListTokens({ @@ -362,13 +365,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det }); if (tokenListTokens.length > 0) { - addContext(test, message.pass_tokenList_5) + addContext(test, message.pass_tokenList_5); console.log(message.pass_tokenList_5); - + try { assert.isNotEmpty( tokenListTokens[0].address, - message.vali_selectedTokenListTokens_address, + message.vali_selectedTokenListTokens_address ); } catch (e) { console.error(e); @@ -431,11 +434,11 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_6) + addContext(test, message.pass_tokenList_6); console.log(message.pass_tokenList_6); } } else { - addContext(test, message.pass_tokenList_2) + addContext(test, message.pass_tokenList_2); console.log(message.pass_tokenList_2); } } catch (e) { @@ -454,14 +457,16 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let TOKEN_LIST; let rates; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_arbitrumUSDC, data.tokenAddress_arbitrumUSDT]; + TOKEN_LIST = [ + data.tokenAddress_arbitrumUSDC, + data.tokenAddress_arbitrumUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -474,7 +479,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( rates.items[i].address, - message.vali_exchangeRates_address, + message.vali_exchangeRates_address ); } catch (e) { console.error(e); @@ -485,7 +490,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].eth, - message.vali_exchangeRates_eth, + message.vali_exchangeRates_eth ); } catch (e) { console.error(e); @@ -496,7 +501,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].eur, - message.vali_exchangeRates_eur, + message.vali_exchangeRates_eur ); } catch (e) { console.error(e); @@ -507,7 +512,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].gbp, - message.vali_exchangeRates_gbp, + message.vali_exchangeRates_gbp ); } catch (e) { console.error(e); @@ -518,7 +523,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].usd, - message.vali_exchangeRates_usd, + message.vali_exchangeRates_usd ); } catch (e) { console.error(e); @@ -542,21 +547,21 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await arbitrumDataService.getNftList({ chainId: Number(data.arbitrum_chainid), account: data.invalidSender, }); - addContext(test, message.fail_nftList_2) + addContext(test, message.fail_nftList_2); assert.fail(message.fail_nftList_2); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.pass_nftList_3) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.pass_nftList_3); console.log(message.pass_nftList_3); } else { console.error(e); @@ -575,21 +580,21 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await arbitrumDataService.getNftList({ chainId: Number(data.arbitrum_chainid), account: data.incorrectSender, }); - addContext(test, message.fail_nftList_3) + addContext(test, message.fail_nftList_3); assert.fail(message.fail_nftList_3); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.pass_nftList_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.pass_nftList_4); console.log(message.pass_nftList_4); } else { console.error(e); @@ -608,9 +613,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { @@ -642,9 +644,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { @@ -660,12 +659,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await arbitrumDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_3) + addContext(test, message.fail_exchangeRates_3); assert.fail(message.fail_exchangeRates_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_1) + addContext(test, message.pass_exchangeRates_1); console.log(message.pass_exchangeRates_1); } else { console.error(e); @@ -684,9 +683,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; @@ -703,12 +699,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await arbitrumDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_4) + addContext(test, message.fail_exchangeRates_4); assert.fail(message.fail_exchangeRates_4); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_2) + addContext(test, message.pass_exchangeRates_2); console.log(message.pass_exchangeRates_2); } else { console.error(e); @@ -727,9 +723,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let TOKEN_LIST = []; @@ -740,12 +733,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await arbitrumDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_5) + addContext(test, message.fail_exchangeRates_5); assert.fail(message.fail_exchangeRates_5); } catch (e) { let error = e.message; if (error.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_3) + addContext(test, message.pass_exchangeRates_3); console.log(message.pass_exchangeRates_3); } else { console.error(e); @@ -764,14 +757,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_arbitrumUSDC, data.tokenAddress_arbitrumUSDT]; + TOKEN_LIST = [ + data.tokenAddress_arbitrumUSDC, + data.tokenAddress_arbitrumUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -782,7 +775,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_4) + addContext(test, message.pass_exchangeRates_4); console.log(message.pass_exchangeRates_4); } else { console.error(e); @@ -801,14 +794,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_arbitrumUSDC, data.tokenAddress_arbitrumUSDT]; + TOKEN_LIST = [ + data.tokenAddress_arbitrumUSDC, + data.tokenAddress_arbitrumUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -816,12 +809,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await arbitrumDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_7) + addContext(test, message.fail_exchangeRates_7); assert.fail(message.fail_exchangeRates_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_5) + addContext(test, message.pass_exchangeRates_5); console.log(message.pass_exchangeRates_5); } else { console.error(e); diff --git a/test/specs/mainnet/listAndRates/matic.spec.js b/test/specs/mainnet/listAndRates/matic.spec.js index 4bee892..236f13f 100644 --- a/test/specs/mainnet/listAndRates/matic.spec.js +++ b/test/specs/mainnet/listAndRates/matic.spec.js @@ -21,7 +21,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -30,15 +29,19 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( maticMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -60,7 +63,8 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det assert.strictEqual( maticEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -75,9 +79,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det // initializating Data service... try { - maticDataService = new DataUtils( - process.env.DATA_API_KEY - ); + maticDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -128,7 +130,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let nfts; @@ -139,13 +140,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det }); if (nfts.items.length > 0) { - addContext(test, message.pass_nft_list_1) + addContext(test, message.pass_nft_list_1); console.log(message.pass_nftList_1); try { assert.isNotEmpty( nfts.items[0].contractName, - message.vali_nftList_contractName, + message.vali_nftList_contractName ); } catch (e) { console.error(e); @@ -156,7 +157,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( nfts.items[0].contractAddress, - message.vali_nftList_contractAddress, + message.vali_nftList_contractAddress ); } catch (e) { console.error(e); @@ -200,7 +201,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( nfts.items[0].items[0].name, - message.vali_nftList_items_name, + message.vali_nftList_items_name ); } catch (e) { console.error(e); @@ -211,7 +212,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( nfts.items[0].items[0].amount, - message.vali_nftList_items_amount, + message.vali_nftList_items_amount ); } catch (e) { console.error(e); @@ -219,7 +220,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_nftList_2) + addContext(test, message.pass_nftList_2); console.log(message.pass_nftList_2); } } catch (e) { @@ -238,13 +239,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let tokenLists; let tokenListTokens; try { - tokenLists = await maticDataService.getTokenLists({ chainId: data.matic_chainid }); + tokenLists = await maticDataService.getTokenLists({ + chainId: data.matic_chainid, + }); if (tokenLists.length > 0) { console.log(message.pass_tokenList_1); @@ -253,7 +255,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenLists[0].name, - message.vali_tokenList_name, + message.vali_tokenList_name ); } catch (e) { console.error(e); @@ -264,7 +266,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenLists[0].endpoint, - message.vali_tokenList_endpoint, + message.vali_tokenList_endpoint ); } catch (e) { console.error(e); @@ -272,11 +274,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_2) + addContext(test, message.pass_tokenList_2); console.log(message.pass_tokenList_2); } - tokenListTokens = await maticDataService.getTokenListTokens({ chainId: data.matic_chainid }); + tokenListTokens = await maticDataService.getTokenListTokens({ + chainId: data.matic_chainid, + }); if (tokenListTokens.length > 0) { console.log(message.pass_tokenList_3); @@ -285,7 +289,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].address, - message.vali_tokenListTokens_address, + message.vali_tokenListTokens_address ); } catch (e) { console.error(e); @@ -296,7 +300,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].name, - message.vali_tokenListTokens_name, + message.vali_tokenListTokens_name ); } catch (e) { console.error(e); @@ -307,7 +311,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].symbol, - message.vali_tokenListTokens_symbol, + message.vali_tokenListTokens_symbol ); } catch (e) { console.error(e); @@ -318,7 +322,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( tokenListTokens[0].decimals, - message.vali_tokenListTokens_decimals, + message.vali_tokenListTokens_decimals ); } catch (e) { console.error(e); @@ -340,7 +344,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( tokenListTokens[0].chainId, - message.vali_tokenListTokens_chainId, + message.vali_tokenListTokens_chainId ); } catch (e) { console.error(e); @@ -348,12 +352,11 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_4) + addContext(test, message.pass_tokenList_4); console.log(message.pass_tokenList_4); } if (tokenLists.length > 0) { - const { name } = tokenLists[0]; tokenListTokens = await maticDataService.getTokenListTokens({ @@ -362,13 +365,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det }); if (tokenListTokens.length > 0) { - addContext(test, message.pass_tokenList_5) + addContext(test, message.pass_tokenList_5); console.log(message.pass_tokenList_5); - + try { assert.isNotEmpty( tokenListTokens[0].address, - message.vali_selectedTokenListTokens_address, + message.vali_selectedTokenListTokens_address ); } catch (e) { console.error(e); @@ -431,11 +434,11 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_6) + addContext(test, message.pass_tokenList_6); console.log(message.pass_tokenList_6); } } else { - addContext(test, message.pass_tokenList_2) + addContext(test, message.pass_tokenList_2); console.log(message.pass_tokenList_2); } } catch (e) { @@ -454,14 +457,16 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let TOKEN_LIST; let rates; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_maticUSDC, data.tokenAddress_maticUSDT]; + TOKEN_LIST = [ + data.tokenAddress_maticUSDC, + data.tokenAddress_maticUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -474,7 +479,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( rates.items[i].address, - message.vali_exchangeRates_address, + message.vali_exchangeRates_address ); } catch (e) { console.error(e); @@ -485,7 +490,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].eth, - message.vali_exchangeRates_eth, + message.vali_exchangeRates_eth ); } catch (e) { console.error(e); @@ -496,7 +501,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].eur, - message.vali_exchangeRates_eur, + message.vali_exchangeRates_eur ); } catch (e) { console.error(e); @@ -507,7 +512,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].gbp, - message.vali_exchangeRates_gbp, + message.vali_exchangeRates_gbp ); } catch (e) { console.error(e); @@ -518,7 +523,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].usd, - message.vali_exchangeRates_usd, + message.vali_exchangeRates_usd ); } catch (e) { console.error(e); @@ -542,21 +547,21 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await maticDataService.getNftList({ chainId: Number(data.matic_chainid), account: data.invalidSender, }); - addContext(test, message.fail_nftList_2) + addContext(test, message.fail_nftList_2); assert.fail(message.fail_nftList_2); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.pass_nftList_3) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.pass_nftList_3); console.log(message.pass_nftList_3); } else { console.error(e); @@ -575,21 +580,21 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await maticDataService.getNftList({ chainId: Number(data.matic_chainid), account: data.incorrectSender, }); - addContext(test, message.fail_nftList_3) + addContext(test, message.fail_nftList_3); assert.fail(message.fail_nftList_3); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.pass_nftList_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.pass_nftList_4); console.log(message.pass_nftList_4); } else { console.error(e); @@ -608,9 +613,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { @@ -642,9 +644,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { @@ -660,12 +659,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await maticDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_3) + addContext(test, message.fail_exchangeRates_3); assert.fail(message.fail_exchangeRates_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_1) + addContext(test, message.pass_exchangeRates_1); console.log(message.pass_exchangeRates_1); } else { console.error(e); @@ -684,9 +683,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; @@ -703,12 +699,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await maticDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_4) + addContext(test, message.fail_exchangeRates_4); assert.fail(message.fail_exchangeRates_4); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_2) + addContext(test, message.pass_exchangeRates_2); console.log(message.pass_exchangeRates_2); } else { console.error(e); @@ -727,9 +723,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let TOKEN_LIST = []; @@ -740,12 +733,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await maticDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_5) + addContext(test, message.fail_exchangeRates_5); assert.fail(message.fail_exchangeRates_5); } catch (e) { let error = e.message; if (error.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_3) + addContext(test, message.pass_exchangeRates_3); console.log(message.pass_exchangeRates_3); } else { console.error(e); @@ -764,14 +757,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_maticUSDC, data.tokenAddress_maticUSDT]; + TOKEN_LIST = [ + data.tokenAddress_maticUSDC, + data.tokenAddress_maticUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -782,7 +775,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_4) + addContext(test, message.pass_exchangeRates_4); console.log(message.pass_exchangeRates_4); } else { console.error(e); @@ -801,14 +794,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_maticUSDC, data.tokenAddress_maticUSDT]; + TOKEN_LIST = [ + data.tokenAddress_maticUSDC, + data.tokenAddress_maticUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -816,12 +809,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await maticDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_7) + addContext(test, message.fail_exchangeRates_7); assert.fail(message.fail_exchangeRates_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_5) + addContext(test, message.pass_exchangeRates_5); console.log(message.pass_exchangeRates_5); } else { console.error(e); diff --git a/test/specs/mainnet/listAndRates/optimism.spec.js b/test/specs/mainnet/listAndRates/optimism.spec.js index ecbc788..2308066 100644 --- a/test/specs/mainnet/listAndRates/optimism.spec.js +++ b/test/specs/mainnet/listAndRates/optimism.spec.js @@ -21,7 +21,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -30,15 +29,19 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( optimismMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -60,7 +63,8 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det assert.strictEqual( optimismEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -75,9 +79,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det // initializating Data service... try { - optimismDataService = new DataUtils( - process.env.DATA_API_KEY - ); + optimismDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -128,7 +130,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let nfts; @@ -139,13 +140,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det }); if (nfts.items.length > 0) { - addContext(test, message.pass_nft_list_1) + addContext(test, message.pass_nft_list_1); console.log(message.pass_nftList_1); try { assert.isNotEmpty( nfts.items[0].contractName, - message.vali_nftList_contractName, + message.vali_nftList_contractName ); } catch (e) { console.error(e); @@ -156,7 +157,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( nfts.items[0].contractAddress, - message.vali_nftList_contractAddress, + message.vali_nftList_contractAddress ); } catch (e) { console.error(e); @@ -200,7 +201,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( nfts.items[0].items[0].name, - message.vali_nftList_items_name, + message.vali_nftList_items_name ); } catch (e) { console.error(e); @@ -211,7 +212,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( nfts.items[0].items[0].amount, - message.vali_nftList_items_amount, + message.vali_nftList_items_amount ); } catch (e) { console.error(e); @@ -219,7 +220,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_nftList_2) + addContext(test, message.pass_nftList_2); console.log(message.pass_nftList_2); } } catch (e) { @@ -238,13 +239,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let tokenLists; let tokenListTokens; try { - tokenLists = await optimismDataService.getTokenLists({ chainId: data.optimism_chainid }); + tokenLists = await optimismDataService.getTokenLists({ + chainId: data.optimism_chainid, + }); if (tokenLists.length > 0) { console.log(message.pass_tokenList_1); @@ -253,7 +255,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenLists[0].name, - message.vali_tokenList_name, + message.vali_tokenList_name ); } catch (e) { console.error(e); @@ -264,7 +266,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenLists[0].endpoint, - message.vali_tokenList_endpoint, + message.vali_tokenList_endpoint ); } catch (e) { console.error(e); @@ -272,11 +274,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_2) + addContext(test, message.pass_tokenList_2); console.log(message.pass_tokenList_2); } - tokenListTokens = await optimismDataService.getTokenListTokens({ chainId: data.optimism_chainid }); + tokenListTokens = await optimismDataService.getTokenListTokens({ + chainId: data.optimism_chainid, + }); if (tokenListTokens.length > 0) { console.log(message.pass_tokenList_3); @@ -285,7 +289,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].address, - message.vali_tokenListTokens_address, + message.vali_tokenListTokens_address ); } catch (e) { console.error(e); @@ -296,7 +300,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].name, - message.vali_tokenListTokens_name, + message.vali_tokenListTokens_name ); } catch (e) { console.error(e); @@ -307,7 +311,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].symbol, - message.vali_tokenListTokens_symbol, + message.vali_tokenListTokens_symbol ); } catch (e) { console.error(e); @@ -318,7 +322,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( tokenListTokens[0].decimals, - message.vali_tokenListTokens_decimals, + message.vali_tokenListTokens_decimals ); } catch (e) { console.error(e); @@ -340,7 +344,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( tokenListTokens[0].chainId, - message.vali_tokenListTokens_chainId, + message.vali_tokenListTokens_chainId ); } catch (e) { console.error(e); @@ -348,12 +352,11 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_4) + addContext(test, message.pass_tokenList_4); console.log(message.pass_tokenList_4); } if (tokenLists.length > 0) { - const { name } = tokenLists[0]; tokenListTokens = await optimismDataService.getTokenListTokens({ @@ -362,13 +365,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det }); if (tokenListTokens.length > 0) { - addContext(test, message.pass_tokenList_5) + addContext(test, message.pass_tokenList_5); console.log(message.pass_tokenList_5); - + try { assert.isNotEmpty( tokenListTokens[0].address, - message.vali_selectedTokenListTokens_address, + message.vali_selectedTokenListTokens_address ); } catch (e) { console.error(e); @@ -431,11 +434,11 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_6) + addContext(test, message.pass_tokenList_6); console.log(message.pass_tokenList_6); } } else { - addContext(test, message.pass_tokenList_2) + addContext(test, message.pass_tokenList_2); console.log(message.pass_tokenList_2); } } catch (e) { @@ -454,14 +457,16 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let TOKEN_LIST; let rates; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_optimismUSDC, data.tokenAddress_optimismUSDT]; + TOKEN_LIST = [ + data.tokenAddress_optimismUSDC, + data.tokenAddress_optimismUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -474,7 +479,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( rates.items[i].address, - message.vali_exchangeRates_address, + message.vali_exchangeRates_address ); } catch (e) { console.error(e); @@ -485,7 +490,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].eth, - message.vali_exchangeRates_eth, + message.vali_exchangeRates_eth ); } catch (e) { console.error(e); @@ -496,7 +501,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].eur, - message.vali_exchangeRates_eur, + message.vali_exchangeRates_eur ); } catch (e) { console.error(e); @@ -507,7 +512,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].gbp, - message.vali_exchangeRates_gbp, + message.vali_exchangeRates_gbp ); } catch (e) { console.error(e); @@ -518,7 +523,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].usd, - message.vali_exchangeRates_usd, + message.vali_exchangeRates_usd ); } catch (e) { console.error(e); @@ -542,21 +547,21 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await optimismDataService.getNftList({ chainId: Number(data.optimism_chainid), account: data.invalidSender, }); - addContext(test, message.fail_nftList_2) + addContext(test, message.fail_nftList_2); assert.fail(message.fail_nftList_2); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.pass_nftList_3) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.pass_nftList_3); console.log(message.pass_nftList_3); } else { console.error(e); @@ -575,21 +580,21 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await optimismDataService.getNftList({ chainId: Number(data.optimism_chainid), account: data.incorrectSender, }); - addContext(test, message.fail_nftList_3) + addContext(test, message.fail_nftList_3); assert.fail(message.fail_nftList_3); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.pass_nftList_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.pass_nftList_4); console.log(message.pass_nftList_4); } else { console.error(e); @@ -608,9 +613,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { @@ -642,9 +644,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { @@ -660,12 +659,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await optimismDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_3) + addContext(test, message.fail_exchangeRates_3); assert.fail(message.fail_exchangeRates_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_1) + addContext(test, message.pass_exchangeRates_1); console.log(message.pass_exchangeRates_1); } else { console.error(e); @@ -684,9 +683,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; @@ -703,12 +699,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await optimismDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_4) + addContext(test, message.fail_exchangeRates_4); assert.fail(message.fail_exchangeRates_4); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_2) + addContext(test, message.pass_exchangeRates_2); console.log(message.pass_exchangeRates_2); } else { console.error(e); @@ -727,9 +723,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let TOKEN_LIST = []; @@ -740,12 +733,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await optimismDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_5) + addContext(test, message.fail_exchangeRates_5); assert.fail(message.fail_exchangeRates_5); } catch (e) { let error = e.message; if (error.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_3) + addContext(test, message.pass_exchangeRates_3); console.log(message.pass_exchangeRates_3); } else { console.error(e); @@ -764,14 +757,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_optimismUSDC, data.tokenAddress_optimismUSDT]; + TOKEN_LIST = [ + data.tokenAddress_optimismUSDC, + data.tokenAddress_optimismUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -782,7 +775,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_4) + addContext(test, message.pass_exchangeRates_4); console.log(message.pass_exchangeRates_4); } else { console.error(e); @@ -801,14 +794,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_optimismUSDC, data.tokenAddress_optimismUSDT]; + TOKEN_LIST = [ + data.tokenAddress_optimismUSDC, + data.tokenAddress_optimismUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -816,12 +809,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await optimismDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_7) + addContext(test, message.fail_exchangeRates_7); assert.fail(message.fail_exchangeRates_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_5) + addContext(test, message.pass_exchangeRates_5); console.log(message.pass_exchangeRates_5); } else { console.error(e); @@ -835,4 +828,4 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det console.warn(message.exchangeRates_insufficientBalance); } }); -}); \ No newline at end of file +}); diff --git a/test/specs/mainnet/listAndRates/xdai.spec.js b/test/specs/mainnet/listAndRates/xdai.spec.js index 1832385..bca8f40 100644 --- a/test/specs/mainnet/listAndRates/xdai.spec.js +++ b/test/specs/mainnet/listAndRates/xdai.spec.js @@ -21,7 +21,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -30,15 +29,19 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.xdai_chainid), - bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.xdai_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( xdaiMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -60,7 +63,8 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det assert.strictEqual( xdaiEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -75,9 +79,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det // initializating Data service... try { - xdaiDataService = new DataUtils( - process.env.DATA_API_KEY - ); + xdaiDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -128,7 +130,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let nfts; @@ -139,13 +140,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det }); if (nfts.items.length > 0) { - addContext(test, message.pass_nft_list_1) + addContext(test, message.pass_nft_list_1); console.log(message.pass_nftList_1); try { assert.isNotEmpty( nfts.items[0].contractName, - message.vali_nftList_contractName, + message.vali_nftList_contractName ); } catch (e) { console.error(e); @@ -156,7 +157,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( nfts.items[0].contractAddress, - message.vali_nftList_contractAddress, + message.vali_nftList_contractAddress ); } catch (e) { console.error(e); @@ -200,7 +201,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( nfts.items[0].items[0].name, - message.vali_nftList_items_name, + message.vali_nftList_items_name ); } catch (e) { console.error(e); @@ -211,7 +212,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( nfts.items[0].items[0].amount, - message.vali_nftList_items_amount, + message.vali_nftList_items_amount ); } catch (e) { console.error(e); @@ -219,7 +220,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_nftList_2) + addContext(test, message.pass_nftList_2); console.log(message.pass_nftList_2); } } catch (e) { @@ -238,13 +239,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let tokenLists; let tokenListTokens; try { - tokenLists = await xdaiDataService.getTokenLists({ chainId: data.xdai_chainid }); + tokenLists = await xdaiDataService.getTokenLists({ + chainId: data.xdai_chainid, + }); if (tokenLists.length > 0) { console.log(message.pass_tokenList_1); @@ -253,7 +255,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenLists[0].name, - message.vali_tokenList_name, + message.vali_tokenList_name ); } catch (e) { console.error(e); @@ -264,7 +266,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenLists[0].endpoint, - message.vali_tokenList_endpoint, + message.vali_tokenList_endpoint ); } catch (e) { console.error(e); @@ -272,11 +274,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_2) + addContext(test, message.pass_tokenList_2); console.log(message.pass_tokenList_2); } - tokenListTokens = await xdaiDataService.getTokenListTokens({ chainId: data.xdai_chainid }); + tokenListTokens = await xdaiDataService.getTokenListTokens({ + chainId: data.xdai_chainid, + }); if (tokenListTokens.length > 0) { console.log(message.pass_tokenList_3); @@ -285,7 +289,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].address, - message.vali_tokenListTokens_address, + message.vali_tokenListTokens_address ); } catch (e) { console.error(e); @@ -296,7 +300,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].name, - message.vali_tokenListTokens_name, + message.vali_tokenListTokens_name ); } catch (e) { console.error(e); @@ -307,7 +311,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].symbol, - message.vali_tokenListTokens_symbol, + message.vali_tokenListTokens_symbol ); } catch (e) { console.error(e); @@ -318,7 +322,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( tokenListTokens[0].decimals, - message.vali_tokenListTokens_decimals, + message.vali_tokenListTokens_decimals ); } catch (e) { console.error(e); @@ -340,7 +344,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( tokenListTokens[0].chainId, - message.vali_tokenListTokens_chainId, + message.vali_tokenListTokens_chainId ); } catch (e) { console.error(e); @@ -348,12 +352,11 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_4) + addContext(test, message.pass_tokenList_4); console.log(message.pass_tokenList_4); } if (tokenLists.length > 0) { - const { name } = tokenLists[0]; tokenListTokens = await xdaiDataService.getTokenListTokens({ @@ -362,13 +365,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det }); if (tokenListTokens.length > 0) { - addContext(test, message.pass_tokenList_5) + addContext(test, message.pass_tokenList_5); console.log(message.pass_tokenList_5); - + try { assert.isNotEmpty( tokenListTokens[0].address, - message.vali_selectedTokenListTokens_address, + message.vali_selectedTokenListTokens_address ); } catch (e) { console.error(e); @@ -431,11 +434,11 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_6) + addContext(test, message.pass_tokenList_6); console.log(message.pass_tokenList_6); } } else { - addContext(test, message.pass_tokenList_2) + addContext(test, message.pass_tokenList_2); console.log(message.pass_tokenList_2); } } catch (e) { @@ -454,7 +457,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let TOKEN_LIST; @@ -474,7 +476,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( rates.items[i].address, - message.vali_exchangeRates_address, + message.vali_exchangeRates_address ); } catch (e) { console.error(e); @@ -485,7 +487,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].eth, - message.vali_exchangeRates_eth, + message.vali_exchangeRates_eth ); } catch (e) { console.error(e); @@ -496,7 +498,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].eur, - message.vali_exchangeRates_eur, + message.vali_exchangeRates_eur ); } catch (e) { console.error(e); @@ -507,7 +509,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].gbp, - message.vali_exchangeRates_gbp, + message.vali_exchangeRates_gbp ); } catch (e) { console.error(e); @@ -518,7 +520,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].usd, - message.vali_exchangeRates_usd, + message.vali_exchangeRates_usd ); } catch (e) { console.error(e); @@ -542,21 +544,21 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await xdaiDataService.getNftList({ chainId: Number(data.xdai_chainid), account: data.invalidSender, }); - addContext(test, message.fail_nftList_2) + addContext(test, message.fail_nftList_2); assert.fail(message.fail_nftList_2); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.pass_nftList_3) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.pass_nftList_3); console.log(message.pass_nftList_3); } else { console.error(e); @@ -575,21 +577,21 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await xdaiDataService.getNftList({ chainId: Number(data.xdai_chainid), account: data.incorrectSender, }); - addContext(test, message.fail_nftList_3) + addContext(test, message.fail_nftList_3); assert.fail(message.fail_nftList_3); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.pass_nftList_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.pass_nftList_4); console.log(message.pass_nftList_4); } else { console.error(e); @@ -608,9 +610,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { @@ -642,9 +641,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { @@ -660,12 +656,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await xdaiDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_3) + addContext(test, message.fail_exchangeRates_3); assert.fail(message.fail_exchangeRates_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_1) + addContext(test, message.pass_exchangeRates_1); console.log(message.pass_exchangeRates_1); } else { console.error(e); @@ -684,9 +680,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; @@ -703,12 +696,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await xdaiDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_4) + addContext(test, message.fail_exchangeRates_4); assert.fail(message.fail_exchangeRates_4); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_2) + addContext(test, message.pass_exchangeRates_2); console.log(message.pass_exchangeRates_2); } else { console.error(e); @@ -727,9 +720,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let TOKEN_LIST = []; @@ -740,12 +730,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await xdaiDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_5) + addContext(test, message.fail_exchangeRates_5); assert.fail(message.fail_exchangeRates_5); } catch (e) { let error = e.message; if (error.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_3) + addContext(test, message.pass_exchangeRates_3); console.log(message.pass_exchangeRates_3); } else { console.error(e); @@ -764,9 +754,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; @@ -782,7 +769,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_4) + addContext(test, message.pass_exchangeRates_4); console.log(message.pass_exchangeRates_4); } else { console.error(e); @@ -801,9 +788,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; @@ -816,12 +800,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await xdaiDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_7) + addContext(test, message.fail_exchangeRates_7); assert.fail(message.fail_exchangeRates_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_5) + addContext(test, message.pass_exchangeRates_5); console.log(message.pass_exchangeRates_5); } else { console.error(e); diff --git a/test/specs/mainnet/paymaster/arbitrum.spec.js b/test/specs/mainnet/paymaster/arbitrum.spec.js index a8c2053..246c507 100644 --- a/test/specs/mainnet/paymaster/arbitrum.spec.js +++ b/test/specs/mainnet/paymaster/arbitrum.spec.js @@ -1,6 +1,11 @@ import * as dotenv from 'dotenv'; dotenv.config(); // init dotenv -import { PrimeSdk, DataUtils, EtherspotBundler, ArkaPaymaster } from '@etherspot/prime-sdk'; +import { + PrimeSdk, + DataUtils, + EtherspotBundler, + ArkaPaymaster, +} from '@etherspot/prime-sdk'; import { ethers, utils } from 'ethers'; import { assert } from 'chai'; import { ERC20_ABI } from '@etherspot/prime-sdk/dist/sdk/helpers/abi/ERC20_ABI.js'; @@ -24,7 +29,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -33,15 +37,19 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( arbitrumMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -63,7 +71,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a assert.strictEqual( arbitrumEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -73,16 +82,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a console.error(e.message); const eString = e.toString(); addContext(test, eString); - assert.fail( - message.fail_smart_address, - ); + assert.fail(message.fail_smart_address); } // initializating Data service... try { - arbitrumDataService = new DataUtils( - process.env.DATA_API_KEY - ); + arbitrumDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -92,7 +97,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a // initializating ArkaPaymaster... try { - arkaPaymaster = new ArkaPaymaster(Number(data.arbitrum_chainid), process.env.API_KEY, data.paymaster_arka); + arkaPaymaster = new ArkaPaymaster( + Number(data.arbitrum_chainid), + process.env.API_KEY, + data.paymaster_arka + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -143,7 +152,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -167,7 +175,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -177,7 +186,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -187,7 +197,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -206,9 +217,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a balance = await arbitrumMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -226,16 +235,18 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { op = await arbitrumMainNetSdk.estimate({ paymasterDetails: { - url: `https://arka.etherspot.io?apiKey=${process.env.API_KEY - }&chainId=${Number(data.arbitrum_chainid)}`, + url: `https://arka.etherspot.io?apiKey=${ + process.env.API_KEY + }&chainId=${Number(data.arbitrum_chainid)}`, context: { mode: 'sponsor' }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -243,9 +254,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -255,7 +264,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -265,7 +275,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -275,7 +286,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -285,7 +297,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -295,7 +308,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -305,7 +319,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -315,7 +330,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -325,7 +341,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -335,7 +352,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -354,9 +372,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a uoHash = await arbitrumMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -365,9 +381,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -384,11 +400,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let balance; @@ -397,9 +412,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a balance = await arbitrumMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -438,7 +451,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -448,7 +461,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( paymasterAddress, - message.vali_pimlico_paymasterAddress_1); + message.vali_pimlico_paymasterAddress_1 + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -467,11 +481,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { erc20Contract = new ethers.Contract( data.tokenAddress_arbitrumUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); contract = await arbitrumMainNetSdk.addUserOpsToBatch({ @@ -480,9 +494,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a }); try { - assert.isNotEmpty( - contract.to, - message.vali_erc20Contract_to); + assert.isNotEmpty(contract.to, message.vali_erc20Contract_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -490,9 +502,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } try { - assert.isNotEmpty( - contract.data, - message.vali_erc20Contract_data); + assert.isNotEmpty(contract.data, message.vali_erc20Contract_data); } catch (e) { console.error(e); const eString = e.toString(); @@ -512,7 +522,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( approveOp.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -522,7 +533,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( approveOp.nonce, - message.vali_estimateTransaction_nonce); + message.vali_estimateTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -532,7 +544,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( approveOp.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -542,7 +555,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( approveOp.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -552,7 +566,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( approveOp.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -562,7 +577,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( approveOp.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -572,7 +588,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( approveOp.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -582,7 +599,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( approveOp.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -592,7 +610,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( approveOp.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -602,7 +621,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( approveOp.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -612,7 +632,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( approveOp.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -630,9 +651,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a uoHash1 = await arbitrumMainNetSdk.send(approveOp); try { - assert.isNotEmpty( - uoHash1, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash1, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -641,9 +660,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -671,7 +690,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -681,7 +701,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -699,9 +720,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a balance = await arbitrumMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -720,13 +739,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a paymasterDetails: { url: `${arka_url}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -736,7 +756,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.nonce, - message.vali_estimateTransaction_nonce); + message.vali_estimateTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -746,7 +767,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -756,7 +778,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -766,7 +789,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -776,7 +800,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -786,7 +811,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -796,7 +822,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -806,7 +833,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -816,7 +844,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -826,7 +855,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -844,9 +874,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a uoHash = await arbitrumMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -855,9 +883,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -878,11 +906,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let balance; @@ -895,9 +922,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a balance = await arbitrumMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -930,7 +955,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -940,7 +966,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -958,9 +985,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a balance = await arbitrumMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -989,13 +1014,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1003,9 +1029,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -1015,7 +1039,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1025,7 +1050,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1035,7 +1061,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1045,7 +1072,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1055,7 +1083,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1065,7 +1094,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1075,7 +1105,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1085,7 +1116,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1095,7 +1127,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1113,9 +1146,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a uoHash = await arbitrumMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -1124,9 +1155,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1143,10 +1174,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // get the metadata try { let metadata = await arkaPaymaster.metadata(); @@ -1154,7 +1183,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( metadata.sponsorAddress, - message.vali_metadata_sponsorAddress); + message.vali_metadata_sponsorAddress + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1164,7 +1194,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( metadata.sponsorWalletBalance, - message.vali_metadata_sponsorWalletBalance); + message.vali_metadata_sponsorWalletBalance + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1174,7 +1205,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( metadata.chainsSupported, - message.vali_metadata_chainsSupported); + message.vali_metadata_chainsSupported + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1184,7 +1216,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { assert.isNotEmpty( metadata.tokenPaymasters, - message.vali_metadata_tokenPaymasters); + message.vali_metadata_tokenPaymasters + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1206,18 +1239,18 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the get token paymaster address try { - let getTokenPaymasterAddress = await arkaPaymaster.getTokenPaymasterAddress("USDC"); + let getTokenPaymasterAddress = + await arkaPaymaster.getTokenPaymasterAddress('USDC'); try { assert.isNotEmpty( getTokenPaymasterAddress, - message.vali_getTokenPaymasterAddress_tokenPaymasterAddress); + message.vali_getTokenPaymasterAddress_tokenPaymasterAddress + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1239,13 +1272,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the remove whitelist address try { - let removeWhitelist = await arkaPaymaster.removeWhitelist([data.sender]); + let removeWhitelist = await arkaPaymaster.removeWhitelist([ + data.sender, + ]); if (removeWhitelist.includes(constant.remove_whitelist_2)) { addContext(test, message.vali_removeWhitelist_1); @@ -1276,10 +1309,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the add whitelist address try { let addWhitelist = await arkaPaymaster.addWhitelist([data.sender]); @@ -1313,10 +1344,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the whilelist address try { let checkWhitelist = await arkaPaymaster.checkWhitelist(data.sender); @@ -1344,20 +1373,18 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the deposit try { let deposit = await arkaPaymaster.deposit(data.value); if (deposit.includes(constant.deposit_1)) { - addContext(test, message.vali_deposit_1) - console.log(message.vali_deposit_1) + addContext(test, message.vali_deposit_1); + console.log(message.vali_deposit_1); } else { - addContext(test, message.fail_deposit_1) - assert.fail(message.fail_deposit_1) + addContext(test, message.fail_deposit_1); + assert.fail(message.fail_deposit_1); } } catch (e) { console.error(e); @@ -1375,9 +1402,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1418,14 +1442,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a url: data.invalid_paymaster_arka, // invalid URL api_key: process.env.API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { if (e.message === constant.not_found) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -1444,9 +1468,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1487,14 +1508,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a url: data.paymaster_arka, api_key: process.env.INVALID_API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -1513,9 +1534,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1556,14 +1574,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a url: data.paymaster_arka, api_key: process.env.INCORRECT_API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_5) + addContext(test, message.fail_estimateTransaction_5); assert.fail(message.fail_estimateTransaction_5); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_4) + addContext(test, message.vali_estimateTransaction_4); console.log(message.vali_estimateTransaction_4); } else { console.error(e); @@ -1582,9 +1600,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1625,14 +1640,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a url: data.paymaster_arka, // without api_key context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_5) + addContext(test, message.vali_estimateTransaction_5); console.log(message.vali_estimateTransaction_5); } else { console.error(e); @@ -1651,13 +1666,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; const invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -1673,7 +1685,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1687,7 +1699,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } if (paymasterAddress.includes(constant.not_found)) { - addContext(test, message.vali_pimlico_paymasterAddress_2) + addContext(test, message.vali_pimlico_paymasterAddress_2); console.log(message.vali_pimlico_paymasterAddress_2); } else { addContext(test, message.fail_pimlico_paymasterAddress_2); @@ -1703,13 +1715,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.INVALID_API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1724,7 +1733,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1736,7 +1745,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } if (returnedValue.error === constant.invalid_apiKey) { - addContext(test, message.vali_pimlico_paymasterAddress_3) + addContext(test, message.vali_pimlico_paymasterAddress_3); console.log(message.vali_pimlico_paymasterAddress_3); } else { addContext(test, message.fail_pimlico_paymasterAddress_3); @@ -1754,9 +1763,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a let queryString = `?chainId=${Number(data.arbitrum_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1771,7 +1777,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1783,7 +1789,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } if (returnedValue.error === constant.invalid_apiKey) { - addContext(test, message.vali_pimlico_paymasterAddress_4) + addContext(test, message.vali_pimlico_paymasterAddress_4); console.log(message.vali_pimlico_paymasterAddress_4); } else { addContext(test, message.fail_pimlico_paymasterAddress_4); @@ -1799,13 +1805,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_arbitrum_chainid, + data.invalid_arbitrum_chainid )}`; // invalid chainid in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1820,7 +1823,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1832,7 +1835,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } if (returnedValue.error === constant.invalid_network_3) { - addContext(test, message.vali_pimlico_paymasterAddress_5) + addContext(test, message.vali_pimlico_paymasterAddress_5); console.log(message.vali_pimlico_paymasterAddress_5); } else { addContext(test, message.fail_pimlico_paymasterAddress_5); @@ -1850,9 +1853,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a let queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { returnedValue = await fetch( @@ -1867,7 +1867,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1879,7 +1879,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } if (returnedValue.error === constant.invalid_data) { - addContext(test, message.vali_pimlico_paymasterAddress_6) + addContext(test, message.vali_pimlico_paymasterAddress_6); console.log(message.vali_pimlico_paymasterAddress_6); } else { addContext(test, message.fail_pimlico_paymasterAddress_6); @@ -1895,13 +1895,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1919,14 +1916,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a { token: data.usdc_token }, ], }), - }, + } ).then((res) => { return res.json(); }); } catch (e) { const errorMessage = returnedValue.error; if (errorMessage.includes(constant.invalid_address_4)) { - addContext(test, message.vali_pimlico_paymasterAddress_7) + addContext(test, message.vali_pimlico_paymasterAddress_7); console.log(message.vali_pimlico_paymasterAddress_7); } else { addContext(test, message.fail_pimlico_paymasterAddress_7); @@ -1943,13 +1940,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1967,7 +1961,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a { token: data.invalid_usdc_token }, // invalid token ], }), - }, + } ).then((res) => { return res.json(); }); @@ -1979,7 +1973,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } if (returnedValue.error === constant.invalid_network_1) { - addContext(test, message.vali_pimlico_paymasterAddress_8) + addContext(test, message.vali_pimlico_paymasterAddress_8); console.log(message.vali_pimlico_paymasterAddress_8); } else { addContext(test, message.fail_pimlico_paymasterAddress_8); @@ -1995,13 +1989,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -2016,7 +2007,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [], // without parametets }), - }, + } ).then((res) => { return res.json(); }); @@ -2028,7 +2019,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } if (returnedValue.error === constant.invalid_data) { - addContext(test, message.vali_pimlico_paymasterAddress_9) + addContext(test, message.vali_pimlico_paymasterAddress_9); console.log(message.vali_pimlico_paymasterAddress_9); } else { addContext(test, message.fail_pimlico_paymasterAddress_9); @@ -2044,13 +2035,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -2066,7 +2054,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2084,11 +2072,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { erc20Contract = new ethers.Contract( data.incorrectTokenAddress_arbitrumUSDC, // incorrect token address - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await arbitrumMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_arbitrumUSDC, @@ -2097,7 +2085,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.contract_address_1)) { - addContext(test, message.vali_erc20Contract_1) + addContext(test, message.vali_erc20Contract_1); console.log(message.vali_erc20Contract_1); } else { console.error(e); @@ -2120,13 +2108,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -2142,7 +2127,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2160,11 +2145,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { erc20Contract = new ethers.Contract( data.invalidTokenAddress_arbitrumUSDC, // invalid token address - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await arbitrumMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_arbitrumUSDC, @@ -2173,7 +2158,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.contract_address_1)) { - addContext(test, message.vali_erc20Contract_2) + addContext(test, message.vali_erc20Contract_2); console.log(message.vali_erc20Contract_2); } else { console.error(e); @@ -2196,13 +2181,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2219,7 +2201,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2237,11 +2219,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { erc20Contract = new ethers.Contract( data.tokenAddress_arbitrumUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [data.invalid_paymasterAddress, ethers.constants.MaxUint256], // invalid paymaster address + [data.invalid_paymasterAddress, ethers.constants.MaxUint256] // invalid paymaster address ); await arbitrumMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_arbitrumUSDC, @@ -2250,7 +2232,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc20Contract_3) + addContext(test, message.vali_erc20Contract_3); console.log(message.vali_erc20Contract_3); } else { console.error(e); @@ -2273,13 +2255,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2296,7 +2275,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2314,11 +2293,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { erc20Contract = new ethers.Contract( data.tokenAddress_arbitrumUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [data.incorrect_paymasterAddress, ethers.constants.MaxUint256], // incorrect paymaster address + [data.incorrect_paymasterAddress, ethers.constants.MaxUint256] // incorrect paymaster address ); await arbitrumMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_arbitrumUSDC, @@ -2327,7 +2306,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc20Contract_4) + addContext(test, message.vali_erc20Contract_4); console.log(message.vali_erc20Contract_4); } else { console.error(e); @@ -2350,13 +2329,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2375,7 +2351,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2393,11 +2369,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { erc20Contract = new ethers.Contract( data.tokenAddress_arbitrumUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await arbitrumMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_arbitrumUSDC, @@ -2426,9 +2402,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2453,12 +2429,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a value: ethers.utils.parseEther(data.invalidValue), }); - addContext(test, message.fail_addTransaction_2) + addContext(test, message.fail_addTransaction_2); assert.fail(message.fail_addTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_value_1)) { - addContext(test, vali_addTransaction_1) + addContext(test, vali_addTransaction_1); console.log(vali_addTransaction_1); } else { console.error(e); @@ -2482,13 +2458,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a let arka_url = data.paymaster_arka; let invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2507,7 +2480,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2525,11 +2498,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { erc20Contract = new ethers.Contract( data.tokenAddress_arbitrumUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await arbitrumMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_arbitrumUSDC, @@ -2558,9 +2531,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2597,15 +2570,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a paymasterDetails: { url: `${invalid_arka_url}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.not_found)) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -2628,15 +2601,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; - let invalid_queryString = `?apiKey=${process.env.INVALID_API_KEY - }&chainId=${Number(data.arbitrum_chainid)}`; // invalid API Key in queryString + let invalid_queryString = `?apiKey=${ + process.env.INVALID_API_KEY + }&chainId=${Number(data.arbitrum_chainid)}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2655,7 +2626,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2673,11 +2644,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { erc20Contract = new ethers.Contract( data.tokenAddress_arbitrumUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await arbitrumMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_arbitrumUSDC, @@ -2706,9 +2677,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2745,15 +2716,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_apiKey)) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -2776,14 +2747,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; let invalid_queryString = `?chainId=${Number(data.arbitrum_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2802,7 +2770,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2820,11 +2788,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { erc20Contract = new ethers.Contract( data.tokenAddress_arbitrumUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await arbitrumMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_arbitrumUSDC, @@ -2853,9 +2821,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2892,15 +2860,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_apiKey)) { - addContext(test, message.vali_estimateTransaction_5) + addContext(test, message.vali_estimateTransaction_5); console.log(message.vali_estimateTransaction_5); } else { console.error(e); @@ -2923,16 +2891,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; let invalid_queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_arbitrum_chainid, + data.invalid_arbitrum_chainid )}`; // invalid chainid in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2951,7 +2916,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2969,11 +2934,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { erc20Contract = new ethers.Contract( data.tokenAddress_arbitrumUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await arbitrumMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_arbitrumUSDC, @@ -3002,9 +2967,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3041,15 +3006,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_7) + addContext(test, message.fail_estimateTransaction_7); assert.fail(message.fail_estimateTransaction_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_3)) { - addContext(test, message.vali_estimateTransaction_6) + addContext(test, message.vali_estimateTransaction_6); console.log(message.vali_estimateTransaction_6); } else { console.error(e); @@ -3072,14 +3037,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; let invalid_queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -3098,7 +3060,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -3116,11 +3078,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a try { erc20Contract = new ethers.Contract( data.tokenAddress_arbitrumUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await arbitrumMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_arbitrumUSDC, @@ -3149,9 +3111,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3188,15 +3150,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_8) + addContext(test, message.fail_estimateTransaction_8); assert.fail(message.fail_estimateTransaction_8); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { - addContext(test, message.vali_estimateTransaction_7) + addContext(test, message.vali_estimateTransaction_7); console.log(message.vali_estimateTransaction_7); } else { console.error(e); @@ -3219,13 +3181,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.arbitrum_chainid, + data.arbitrum_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await arbitrumMainNetSdk.getNativeBalance(); @@ -3285,15 +3244,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.not_found)) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -3311,13 +3270,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a it('REGRESSION: Perform the transfer token on arka paymaster with validUntil and validAfter with invalid API Token on the arbitrum network', async function () { var test = this; let arka_url = data.paymaster_arka; - let invalid_queryString = `?apiKey=${process.env.INVALID_API_KEY - }&chainId=${Number(data.arbitrum_chainid)}`; // invalid API Key in queryString + let invalid_queryString = `?apiKey=${ + process.env.INVALID_API_KEY + }&chainId=${Number(data.arbitrum_chainid)}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await arbitrumMainNetSdk.getNativeBalance(); @@ -3377,14 +3334,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -3405,9 +3362,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a let invalid_queryString = `?chainId=${Number(data.arbitrum_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await arbitrumMainNetSdk.getNativeBalance(); @@ -3467,14 +3421,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -3493,13 +3447,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; let arka_url = data.paymaster_arka; let invalid_queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_arbitrum_chainid, + data.invalid_arbitrum_chainid )}`; // invalid ChainID in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await arbitrumMainNetSdk.getNativeBalance(); @@ -3559,15 +3510,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_7) + addContext(test, message.fail_estimateTransaction_7); assert.fail(message.fail_estimateTransaction_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_3)) { - addContext(test, message.vali_estimateTransaction_6) + addContext(test, message.vali_estimateTransaction_6); console.log(message.vali_estimateTransaction_6); } else { console.error(e); @@ -3588,9 +3539,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a let invalid_queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await arbitrumMainNetSdk.getNativeBalance(); @@ -3650,15 +3598,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_8) + addContext(test, message.fail_estimateTransaction_8); assert.fail(message.fail_estimateTransaction_8); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { - addContext(test, message.vali_estimateTransaction_7) + addContext(test, message.vali_estimateTransaction_7); console.log(message.vali_estimateTransaction_7); } else { console.error(e); @@ -3677,16 +3625,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the get token paymaster address try { await arkaPaymaster.getTokenPaymasterAddress(data.invalid_usdc_token); - addContext(test, message.fail_getTokenPaymasterAddress_2) - assert.fail(message.fail_getTokenPaymasterAddress_2) + addContext(test, message.fail_getTokenPaymasterAddress_2); + assert.fail(message.fail_getTokenPaymasterAddress_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_1)) { @@ -3709,16 +3653,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the get token paymaster address try { await arkaPaymaster.getTokenPaymasterAddress(); - addContext(test, message.fail_getTokenPaymasterAddress_3) - assert.fail(message.fail_getTokenPaymasterAddress_3) + addContext(test, message.fail_getTokenPaymasterAddress_3); + assert.fail(message.fail_getTokenPaymasterAddress_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { @@ -3741,15 +3681,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { await arkaPaymaster.removeWhitelist([data.invalidSender]); - addContext(test, message.fail_removeWhitelist_3) + addContext(test, message.fail_removeWhitelist_3); assert.fail(message.fail_removeWhitelist_3); } catch (e) { let errorMessage = e.message; @@ -3773,15 +3709,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { await arkaPaymaster.removeWhitelist([data.incorrectSender]); - addContext(test, message.fail_removeWhitelist_4) + addContext(test, message.fail_removeWhitelist_4); assert.fail(message.fail_removeWhitelist_4); } catch (e) { let errorMessage = e.message; @@ -3805,16 +3737,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress = ethers.Wallet.createRandom(); await arkaPaymaster.removeWhitelist([randomAddress.address]); - addContext(test, message.fail_removeWhitelist_5) + addContext(test, message.fail_removeWhitelist_5); assert.fail(message.fail_removeWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -3838,16 +3766,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - await arkaPaymaster.removeWhitelist([randomAddress.address, data.sender]); + await arkaPaymaster.removeWhitelist([ + randomAddress.address, + data.sender, + ]); - addContext(test, message.fail_removeWhitelist_5) + addContext(test, message.fail_removeWhitelist_5); assert.fail(message.fail_removeWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -3871,20 +3798,22 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); // make whitelisted addresses - await arkaPaymaster.addWhitelist([randomAddress1.address, randomAddress2.address]); + await arkaPaymaster.addWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); // remove whitelist addresses - let removewhitelist = await arkaPaymaster.removeWhitelist([randomAddress1.address, randomAddress2.address]); + let removewhitelist = await arkaPaymaster.removeWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); if (removewhitelist.includes(constant.remove_whitelist_2)) { addContext(test, message.vali_removeWhitelist_1); @@ -3915,17 +3844,16 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); - await arkaPaymaster.removeWhitelist([randomAddress1.address, randomAddress2.address]); + await arkaPaymaster.removeWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); - addContext(test, message.fail_removeWhitelist_6) + addContext(test, message.fail_removeWhitelist_6); assert.fail(message.fail_removeWhitelist_6); } catch (e) { let errorMessage = e.message; @@ -3949,15 +3877,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { await arkaPaymaster.addWhitelist([data.invalidSender]); - addContext(test, message.fail_addWhitelist_3) + addContext(test, message.fail_addWhitelist_3); assert.fail(message.fail_addWhitelist_3); } catch (e) { let errorMessage = e.message; @@ -3981,15 +3905,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { await arkaPaymaster.addWhitelist([data.incorrectSender]); - addContext(test, message.fail_addWhitelist_4) + addContext(test, message.fail_addWhitelist_4); assert.fail(message.fail_addWhitelist_4); } catch (e) { let errorMessage = e.message; @@ -4013,14 +3933,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - let addwhitelist = await arkaPaymaster.addWhitelist([randomAddress.address]); + let addwhitelist = await arkaPaymaster.addWhitelist([ + randomAddress.address, + ]); if (addwhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_5); @@ -4051,14 +3969,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - await arkaPaymaster.addWhitelist([randomAddress.address, data.sender]); + await arkaPaymaster.addWhitelist([ + randomAddress.address, + data.sender, + ]); if (addWhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_1); @@ -4089,17 +4006,16 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); // add whitelist addresses - let addwhitelist = await arkaPaymaster.addWhitelist([randomAddress1.address, randomAddress2.address]); + let addwhitelist = await arkaPaymaster.addWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); if (addwhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_1); @@ -4130,16 +4046,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(data.invalidSender); - addContext(test, message.fail_checkWhitelist_2) - assert.fail(message.fail_checkWhitelist_2) + addContext(test, message.fail_checkWhitelist_2); + assert.fail(message.fail_checkWhitelist_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_5)) { @@ -4162,16 +4074,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(data.invalidSender); - addContext(test, message.fail_checkWhitelist_3) - assert.fail(message.fail_checkWhitelist_3) + addContext(test, message.fail_checkWhitelist_3); + assert.fail(message.fail_checkWhitelist_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_5)) { @@ -4194,14 +4102,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { const randomAddress = ethers.Wallet.createRandom(); - let checkwhitelist = await arkaPaymaster.checkWhitelist(randomAddress.address); + let checkwhitelist = await arkaPaymaster.checkWhitelist( + randomAddress.address + ); if (checkwhitelist.includes(constant.check_whitelist_1)) { addContext(test, message.vali_addWhitelist_2); @@ -4226,15 +4132,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(); - addContext(test, message.fail_checkWhitelist_5) + addContext(test, message.fail_checkWhitelist_5); assert.fail(message.fail_checkWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -4258,16 +4160,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the deposit try { - await arkaPaymaster.deposit("one"); + await arkaPaymaster.deposit('one'); - addContext(test, message.fail_deposit_3) - assert.fail(message.fail_deposit_3) + addContext(test, message.fail_deposit_3); + assert.fail(message.fail_deposit_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { diff --git a/test/specs/mainnet/paymaster/matic.spec.js b/test/specs/mainnet/paymaster/matic.spec.js index cc201ee..3fbd09d 100644 --- a/test/specs/mainnet/paymaster/matic.spec.js +++ b/test/specs/mainnet/paymaster/matic.spec.js @@ -1,6 +1,11 @@ import * as dotenv from 'dotenv'; dotenv.config(); // init dotenv -import { PrimeSdk, DataUtils, EtherspotBundler, ArkaPaymaster } from '@etherspot/prime-sdk'; +import { + PrimeSdk, + DataUtils, + EtherspotBundler, + ArkaPaymaster, +} from '@etherspot/prime-sdk'; import { ethers, utils } from 'ethers'; import { assert } from 'chai'; import { ERC20_ABI } from '@etherspot/prime-sdk/dist/sdk/helpers/abi/ERC20_ABI.js'; @@ -24,7 +29,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -33,15 +37,19 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( maticMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -63,7 +71,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m assert.strictEqual( maticEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -73,16 +82,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m console.error(e.message); const eString = e.toString(); addContext(test, eString); - assert.fail( - message.fail_smart_address, - ); + assert.fail(message.fail_smart_address); } // initializating Data service... try { - maticDataService = new DataUtils( - process.env.DATA_API_KEY - ); + maticDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -92,7 +97,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m // initializating ArkaPaymaster... try { - arkaPaymaster = new ArkaPaymaster(Number(data.matic_chainid), process.env.API_KEY, data.paymaster_arka); + arkaPaymaster = new ArkaPaymaster( + Number(data.matic_chainid), + process.env.API_KEY, + data.paymaster_arka + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -143,7 +152,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -167,7 +175,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -177,7 +186,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -187,7 +197,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -206,9 +217,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m balance = await maticMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -226,16 +235,18 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { op = await maticMainNetSdk.estimate({ paymasterDetails: { - url: `https://arka.etherspot.io?apiKey=${process.env.API_KEY - }&chainId=${Number(data.matic_chainid)}`, + url: `https://arka.etherspot.io?apiKey=${ + process.env.API_KEY + }&chainId=${Number(data.matic_chainid)}`, context: { mode: 'sponsor' }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -243,9 +254,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -255,7 +264,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -265,7 +275,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -275,7 +286,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -285,7 +297,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -295,7 +308,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -305,7 +319,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -315,7 +330,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -325,7 +341,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -335,7 +352,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -354,9 +372,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m uoHash = await maticMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -365,9 +381,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -384,11 +400,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let balance; @@ -397,9 +412,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m balance = await maticMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -438,7 +451,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -448,7 +461,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( paymasterAddress, - message.vali_pimlico_paymasterAddress_1); + message.vali_pimlico_paymasterAddress_1 + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -467,11 +481,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { erc20Contract = new ethers.Contract( data.tokenAddress_maticUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); contract = await maticMainNetSdk.addUserOpsToBatch({ @@ -480,9 +494,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m }); try { - assert.isNotEmpty( - contract.to, - message.vali_erc20Contract_to); + assert.isNotEmpty(contract.to, message.vali_erc20Contract_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -490,9 +502,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } try { - assert.isNotEmpty( - contract.data, - message.vali_erc20Contract_data); + assert.isNotEmpty(contract.data, message.vali_erc20Contract_data); } catch (e) { console.error(e); const eString = e.toString(); @@ -512,7 +522,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( approveOp.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -522,7 +533,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( approveOp.nonce, - message.vali_estimateTransaction_nonce); + message.vali_estimateTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -532,7 +544,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( approveOp.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -542,7 +555,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( approveOp.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -552,7 +566,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( approveOp.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -562,7 +577,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( approveOp.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -572,7 +588,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( approveOp.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -582,7 +599,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( approveOp.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -592,7 +610,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( approveOp.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -602,7 +621,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( approveOp.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -612,7 +632,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( approveOp.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -630,9 +651,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m uoHash1 = await maticMainNetSdk.send(approveOp); try { - assert.isNotEmpty( - uoHash1, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash1, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -641,9 +660,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -671,7 +690,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -681,7 +701,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -699,9 +720,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m balance = await maticMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -720,13 +739,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m paymasterDetails: { url: `${arka_url}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -736,7 +756,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.nonce, - message.vali_estimateTransaction_nonce); + message.vali_estimateTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -746,7 +767,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -756,7 +778,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -766,7 +789,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -776,7 +800,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -786,7 +811,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -796,7 +822,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -806,7 +833,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -816,7 +844,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -826,7 +855,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -844,9 +874,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m uoHash = await maticMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -855,9 +883,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -878,11 +906,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let balance; @@ -895,9 +922,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m balance = await maticMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -930,7 +955,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -940,7 +966,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -958,9 +985,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m balance = await maticMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -989,13 +1014,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1003,9 +1029,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -1015,7 +1039,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1025,7 +1050,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1035,7 +1061,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1045,7 +1072,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1055,7 +1083,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1065,7 +1094,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1075,7 +1105,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1085,7 +1116,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1095,7 +1127,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1113,9 +1146,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m uoHash = await maticMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -1124,9 +1155,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1143,10 +1174,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // get the metadata try { let metadata = await arkaPaymaster.metadata(); @@ -1154,7 +1183,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( metadata.sponsorAddress, - message.vali_metadata_sponsorAddress); + message.vali_metadata_sponsorAddress + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1164,7 +1194,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( metadata.sponsorWalletBalance, - message.vali_metadata_sponsorWalletBalance); + message.vali_metadata_sponsorWalletBalance + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1174,7 +1205,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( metadata.chainsSupported, - message.vali_metadata_chainsSupported); + message.vali_metadata_chainsSupported + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1184,7 +1216,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { assert.isNotEmpty( metadata.tokenPaymasters, - message.vali_metadata_tokenPaymasters); + message.vali_metadata_tokenPaymasters + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1206,18 +1239,18 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the get token paymaster address try { - let getTokenPaymasterAddress = await arkaPaymaster.getTokenPaymasterAddress("USDC"); + let getTokenPaymasterAddress = + await arkaPaymaster.getTokenPaymasterAddress('USDC'); try { assert.isNotEmpty( getTokenPaymasterAddress, - message.vali_getTokenPaymasterAddress_tokenPaymasterAddress); + message.vali_getTokenPaymasterAddress_tokenPaymasterAddress + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1239,13 +1272,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the remove whitelist address try { - let removeWhitelist = await arkaPaymaster.removeWhitelist([data.sender]); + let removeWhitelist = await arkaPaymaster.removeWhitelist([ + data.sender, + ]); if (removeWhitelist.includes(constant.remove_whitelist_2)) { addContext(test, message.vali_removeWhitelist_1); @@ -1276,10 +1309,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the add whitelist address try { let addWhitelist = await arkaPaymaster.addWhitelist([data.sender]); @@ -1313,10 +1344,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the whilelist address try { let checkWhitelist = await arkaPaymaster.checkWhitelist(data.sender); @@ -1344,7 +1373,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // validate the deposit @@ -1352,11 +1380,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m let deposit = await arkaPaymaster.deposit(data.value); if (deposit.includes(constant.deposit_1)) { - addContext(test, message.vali_deposit_1) - console.log(message.vali_deposit_1) + addContext(test, message.vali_deposit_1); + console.log(message.vali_deposit_1); } else { - addContext(test, message.fail_deposit_1) - assert.fail(message.fail_deposit_1) + addContext(test, message.fail_deposit_1); + assert.fail(message.fail_deposit_1); } } catch (e) { console.error(e); @@ -1374,9 +1402,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1417,14 +1442,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m url: data.invalid_paymaster_arka, // invalid URL api_key: process.env.API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { if (e.message === constant.not_found) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -1443,9 +1468,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1486,14 +1508,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m url: data.paymaster_arka, api_key: process.env.INVALID_API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -1512,9 +1534,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1555,14 +1574,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m url: data.paymaster_arka, api_key: process.env.INCORRECT_API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_5) + addContext(test, message.fail_estimateTransaction_5); assert.fail(message.fail_estimateTransaction_5); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_4) + addContext(test, message.vali_estimateTransaction_4); console.log(message.vali_estimateTransaction_4); } else { console.error(e); @@ -1581,9 +1600,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1624,14 +1640,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m url: data.paymaster_arka, // without api_key context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_5) + addContext(test, message.vali_estimateTransaction_5); console.log(message.vali_estimateTransaction_5); } else { console.error(e); @@ -1650,13 +1666,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; const invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -1672,7 +1685,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1686,7 +1699,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } if (paymasterAddress.includes(constant.not_found)) { - addContext(test, message.vali_pimlico_paymasterAddress_2) + addContext(test, message.vali_pimlico_paymasterAddress_2); console.log(message.vali_pimlico_paymasterAddress_2); } else { addContext(test, message.fail_pimlico_paymasterAddress_2); @@ -1702,13 +1715,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.INVALID_API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1723,7 +1733,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1735,7 +1745,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } if (returnedValue.error === constant.invalid_apiKey) { - addContext(test, message.vali_pimlico_paymasterAddress_3) + addContext(test, message.vali_pimlico_paymasterAddress_3); console.log(message.vali_pimlico_paymasterAddress_3); } else { addContext(test, message.fail_pimlico_paymasterAddress_3); @@ -1753,9 +1763,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m let queryString = `?chainId=${Number(data.matic_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1770,7 +1777,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1782,7 +1789,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } if (returnedValue.error === constant.invalid_apiKey) { - addContext(test, message.vali_pimlico_paymasterAddress_4) + addContext(test, message.vali_pimlico_paymasterAddress_4); console.log(message.vali_pimlico_paymasterAddress_4); } else { addContext(test, message.fail_pimlico_paymasterAddress_4); @@ -1798,13 +1805,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_matic_chainid, + data.invalid_matic_chainid )}`; // invalid chainid in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1819,7 +1823,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1831,7 +1835,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } if (returnedValue.error === constant.invalid_network_3) { - addContext(test, message.vali_pimlico_paymasterAddress_5) + addContext(test, message.vali_pimlico_paymasterAddress_5); console.log(message.vali_pimlico_paymasterAddress_5); } else { addContext(test, message.fail_pimlico_paymasterAddress_5); @@ -1849,9 +1853,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m let queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { returnedValue = await fetch( @@ -1866,7 +1867,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1878,7 +1879,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } if (returnedValue.error === constant.invalid_data) { - addContext(test, message.vali_pimlico_paymasterAddress_6) + addContext(test, message.vali_pimlico_paymasterAddress_6); console.log(message.vali_pimlico_paymasterAddress_6); } else { addContext(test, message.fail_pimlico_paymasterAddress_6); @@ -1894,13 +1895,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1918,14 +1916,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m { token: data.usdc_token }, ], }), - }, + } ).then((res) => { return res.json(); }); } catch (e) { const errorMessage = returnedValue.error; if (errorMessage.includes(constant.invalid_address_4)) { - addContext(test, message.vali_pimlico_paymasterAddress_7) + addContext(test, message.vali_pimlico_paymasterAddress_7); console.log(message.vali_pimlico_paymasterAddress_7); } else { addContext(test, message.fail_pimlico_paymasterAddress_7); @@ -1942,13 +1940,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1966,7 +1961,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m { token: data.invalid_usdc_token }, // invalid token ], }), - }, + } ).then((res) => { return res.json(); }); @@ -1978,7 +1973,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } if (returnedValue.error === constant.invalid_network_1) { - addContext(test, message.vali_pimlico_paymasterAddress_8) + addContext(test, message.vali_pimlico_paymasterAddress_8); console.log(message.vali_pimlico_paymasterAddress_8); } else { addContext(test, message.fail_pimlico_paymasterAddress_8); @@ -1994,13 +1989,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -2015,7 +2007,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [], // without parametets }), - }, + } ).then((res) => { return res.json(); }); @@ -2027,7 +2019,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } if (returnedValue.error === constant.invalid_data) { - addContext(test, message.vali_pimlico_paymasterAddress_9) + addContext(test, message.vali_pimlico_paymasterAddress_9); console.log(message.vali_pimlico_paymasterAddress_9); } else { addContext(test, message.fail_pimlico_paymasterAddress_9); @@ -2043,13 +2035,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -2065,7 +2054,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2083,11 +2072,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { erc20Contract = new ethers.Contract( data.incorrectTokenAddress_maticUSDC, // incorrect token address - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await maticMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_maticUSDC, @@ -2096,7 +2085,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.contract_address_1)) { - addContext(test, message.vali_erc20Contract_1) + addContext(test, message.vali_erc20Contract_1); console.log(message.vali_erc20Contract_1); } else { console.error(e); @@ -2119,13 +2108,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -2141,7 +2127,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2159,11 +2145,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { erc20Contract = new ethers.Contract( data.invalidTokenAddress_maticUSDC, // invalid token address - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await maticMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_maticUSDC, @@ -2172,7 +2158,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.contract_address_1)) { - addContext(test, message.vali_erc20Contract_2) + addContext(test, message.vali_erc20Contract_2); console.log(message.vali_erc20Contract_2); } else { console.error(e); @@ -2195,13 +2181,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2218,7 +2201,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2236,11 +2219,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { erc20Contract = new ethers.Contract( data.tokenAddress_maticUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [data.invalid_paymasterAddress, ethers.constants.MaxUint256], // invalid paymaster address + [data.invalid_paymasterAddress, ethers.constants.MaxUint256] // invalid paymaster address ); await maticMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_maticUSDC, @@ -2249,7 +2232,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc20Contract_3) + addContext(test, message.vali_erc20Contract_3); console.log(message.vali_erc20Contract_3); } else { console.error(e); @@ -2272,13 +2255,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2295,7 +2275,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2313,11 +2293,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { erc20Contract = new ethers.Contract( data.tokenAddress_maticUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [data.incorrect_paymasterAddress, ethers.constants.MaxUint256], // incorrect paymaster address + [data.incorrect_paymasterAddress, ethers.constants.MaxUint256] // incorrect paymaster address ); await maticMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_maticUSDC, @@ -2326,7 +2306,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc20Contract_4) + addContext(test, message.vali_erc20Contract_4); console.log(message.vali_erc20Contract_4); } else { console.error(e); @@ -2349,13 +2329,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2374,7 +2351,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2392,11 +2369,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { erc20Contract = new ethers.Contract( data.tokenAddress_maticUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await maticMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_maticUSDC, @@ -2425,9 +2402,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2452,12 +2429,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m value: ethers.utils.parseEther(data.invalidValue), }); - addContext(test, message.fail_addTransaction_2) + addContext(test, message.fail_addTransaction_2); assert.fail(message.fail_addTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_value_1)) { - addContext(test, vali_addTransaction_1) + addContext(test, vali_addTransaction_1); console.log(vali_addTransaction_1); } else { console.error(e); @@ -2481,13 +2458,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m let arka_url = data.paymaster_arka; let invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2506,7 +2480,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2524,11 +2498,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { erc20Contract = new ethers.Contract( data.tokenAddress_maticUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await maticMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_maticUSDC, @@ -2557,9 +2531,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2596,15 +2570,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m paymasterDetails: { url: `${invalid_arka_url}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.not_found)) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -2627,15 +2601,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; - let invalid_queryString = `?apiKey=${process.env.INVALID_API_KEY - }&chainId=${Number(data.matic_chainid)}`; // invalid API Key in queryString + let invalid_queryString = `?apiKey=${ + process.env.INVALID_API_KEY + }&chainId=${Number(data.matic_chainid)}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2654,7 +2626,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2672,11 +2644,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { erc20Contract = new ethers.Contract( data.tokenAddress_maticUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await maticMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_maticUSDC, @@ -2705,9 +2677,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2744,15 +2716,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_apiKey)) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -2775,14 +2747,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; let invalid_queryString = `?chainId=${Number(data.matic_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2801,7 +2770,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2819,11 +2788,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { erc20Contract = new ethers.Contract( data.tokenAddress_maticUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await maticMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_maticUSDC, @@ -2852,9 +2821,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2891,15 +2860,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_apiKey)) { - addContext(test, message.vali_estimateTransaction_5) + addContext(test, message.vali_estimateTransaction_5); console.log(message.vali_estimateTransaction_5); } else { console.error(e); @@ -2922,16 +2891,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; let invalid_queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_matic_chainid, + data.invalid_matic_chainid )}`; // invalid chainid in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2950,7 +2916,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2968,11 +2934,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { erc20Contract = new ethers.Contract( data.tokenAddress_maticUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await maticMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_maticUSDC, @@ -3001,9 +2967,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3040,15 +3006,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_7) + addContext(test, message.fail_estimateTransaction_7); assert.fail(message.fail_estimateTransaction_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_3)) { - addContext(test, message.vali_estimateTransaction_6) + addContext(test, message.vali_estimateTransaction_6); console.log(message.vali_estimateTransaction_6); } else { console.error(e); @@ -3071,14 +3037,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; let invalid_queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -3097,7 +3060,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -3115,11 +3078,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m try { erc20Contract = new ethers.Contract( data.tokenAddress_maticUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await maticMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_maticUSDC, @@ -3148,9 +3111,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3187,15 +3150,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_8) + addContext(test, message.fail_estimateTransaction_8); assert.fail(message.fail_estimateTransaction_8); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { - addContext(test, message.vali_estimateTransaction_7) + addContext(test, message.vali_estimateTransaction_7); console.log(message.vali_estimateTransaction_7); } else { console.error(e); @@ -3218,13 +3181,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.matic_chainid, + data.matic_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await maticMainNetSdk.getNativeBalance(); @@ -3284,15 +3244,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.not_found)) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -3310,13 +3270,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m it('REGRESSION: Perform the transfer token on arka paymaster with validUntil and validAfter with invalid API Token on the matic network', async function () { var test = this; let arka_url = data.paymaster_arka; - let invalid_queryString = `?apiKey=${process.env.INVALID_API_KEY - }&chainId=${Number(data.matic_chainid)}`; // invalid API Key in queryString + let invalid_queryString = `?apiKey=${ + process.env.INVALID_API_KEY + }&chainId=${Number(data.matic_chainid)}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await maticMainNetSdk.getNativeBalance(); @@ -3376,14 +3334,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -3404,9 +3362,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m let invalid_queryString = `?chainId=${Number(data.matic_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await maticMainNetSdk.getNativeBalance(); @@ -3466,14 +3421,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -3492,13 +3447,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; let arka_url = data.paymaster_arka; let invalid_queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_matic_chainid, + data.invalid_matic_chainid )}`; // invalid ChainID in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await maticMainNetSdk.getNativeBalance(); @@ -3558,15 +3510,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_7) + addContext(test, message.fail_estimateTransaction_7); assert.fail(message.fail_estimateTransaction_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_3)) { - addContext(test, message.vali_estimateTransaction_6) + addContext(test, message.vali_estimateTransaction_6); console.log(message.vali_estimateTransaction_6); } else { console.error(e); @@ -3587,9 +3539,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m let invalid_queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await maticMainNetSdk.getNativeBalance(); @@ -3649,15 +3598,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_8) + addContext(test, message.fail_estimateTransaction_8); assert.fail(message.fail_estimateTransaction_8); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { - addContext(test, message.vali_estimateTransaction_7) + addContext(test, message.vali_estimateTransaction_7); console.log(message.vali_estimateTransaction_7); } else { console.error(e); @@ -3676,16 +3625,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the get token paymaster address try { await arkaPaymaster.getTokenPaymasterAddress(data.invalid_usdc_token); - addContext(test, message.fail_getTokenPaymasterAddress_2) - assert.fail(message.fail_getTokenPaymasterAddress_2) + addContext(test, message.fail_getTokenPaymasterAddress_2); + assert.fail(message.fail_getTokenPaymasterAddress_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_1)) { @@ -3708,16 +3653,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the get token paymaster address try { await arkaPaymaster.getTokenPaymasterAddress(); - addContext(test, message.fail_getTokenPaymasterAddress_3) - assert.fail(message.fail_getTokenPaymasterAddress_3) + addContext(test, message.fail_getTokenPaymasterAddress_3); + assert.fail(message.fail_getTokenPaymasterAddress_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { @@ -3740,15 +3681,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { await arkaPaymaster.removeWhitelist([data.invalidSender]); - addContext(test, message.fail_removeWhitelist_3) + addContext(test, message.fail_removeWhitelist_3); assert.fail(message.fail_removeWhitelist_3); } catch (e) { let errorMessage = e.message; @@ -3772,15 +3709,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { await arkaPaymaster.removeWhitelist([data.incorrectSender]); - addContext(test, message.fail_removeWhitelist_4) + addContext(test, message.fail_removeWhitelist_4); assert.fail(message.fail_removeWhitelist_4); } catch (e) { let errorMessage = e.message; @@ -3804,16 +3737,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress = ethers.Wallet.createRandom(); await arkaPaymaster.removeWhitelist([randomAddress.address]); - addContext(test, message.fail_removeWhitelist_5) + addContext(test, message.fail_removeWhitelist_5); assert.fail(message.fail_removeWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -3837,16 +3766,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - await arkaPaymaster.removeWhitelist([randomAddress.address, data.sender]); + await arkaPaymaster.removeWhitelist([ + randomAddress.address, + data.sender, + ]); - addContext(test, message.fail_removeWhitelist_5) + addContext(test, message.fail_removeWhitelist_5); assert.fail(message.fail_removeWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -3870,20 +3798,22 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); // make whitelisted addresses - await arkaPaymaster.addWhitelist([randomAddress1.address, randomAddress2.address]); + await arkaPaymaster.addWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); // remove whitelist addresses - let removewhitelist = await arkaPaymaster.removeWhitelist([randomAddress1.address, randomAddress2.address]); + let removewhitelist = await arkaPaymaster.removeWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); if (removewhitelist.includes(constant.remove_whitelist_2)) { addContext(test, message.vali_removeWhitelist_1); @@ -3914,17 +3844,16 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); - await arkaPaymaster.removeWhitelist([randomAddress1.address, randomAddress2.address]); + await arkaPaymaster.removeWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); - addContext(test, message.fail_removeWhitelist_6) + addContext(test, message.fail_removeWhitelist_6); assert.fail(message.fail_removeWhitelist_6); } catch (e) { let errorMessage = e.message; @@ -3948,15 +3877,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { await arkaPaymaster.addWhitelist([data.invalidSender]); - addContext(test, message.fail_addWhitelist_3) + addContext(test, message.fail_addWhitelist_3); assert.fail(message.fail_addWhitelist_3); } catch (e) { let errorMessage = e.message; @@ -3980,15 +3905,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { await arkaPaymaster.addWhitelist([data.incorrectSender]); - addContext(test, message.fail_addWhitelist_4) + addContext(test, message.fail_addWhitelist_4); assert.fail(message.fail_addWhitelist_4); } catch (e) { let errorMessage = e.message; @@ -4012,14 +3933,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - let addwhitelist = await arkaPaymaster.addWhitelist([randomAddress.address]); + let addwhitelist = await arkaPaymaster.addWhitelist([ + randomAddress.address, + ]); if (addwhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_5); @@ -4050,14 +3969,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - await arkaPaymaster.addWhitelist([randomAddress.address, data.sender]); + await arkaPaymaster.addWhitelist([ + randomAddress.address, + data.sender, + ]); if (addWhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_1); @@ -4088,17 +4006,16 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); // add whitelist addresses - let addwhitelist = await arkaPaymaster.addWhitelist([randomAddress1.address, randomAddress2.address]); + let addwhitelist = await arkaPaymaster.addWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); if (addwhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_1); @@ -4129,16 +4046,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(data.invalidSender); - addContext(test, message.fail_checkWhitelist_2) - assert.fail(message.fail_checkWhitelist_2) + addContext(test, message.fail_checkWhitelist_2); + assert.fail(message.fail_checkWhitelist_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_5)) { @@ -4161,16 +4074,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(data.invalidSender); - addContext(test, message.fail_checkWhitelist_3) - assert.fail(message.fail_checkWhitelist_3) + addContext(test, message.fail_checkWhitelist_3); + assert.fail(message.fail_checkWhitelist_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_5)) { @@ -4193,14 +4102,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { const randomAddress = ethers.Wallet.createRandom(); - let checkwhitelist = await arkaPaymaster.checkWhitelist(randomAddress.address); + let checkwhitelist = await arkaPaymaster.checkWhitelist( + randomAddress.address + ); if (checkwhitelist.includes(constant.check_whitelist_1)) { addContext(test, message.vali_addWhitelist_2); @@ -4225,15 +4132,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(); - addContext(test, message.fail_checkWhitelist_5) + addContext(test, message.fail_checkWhitelist_5); assert.fail(message.fail_checkWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -4257,16 +4160,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the deposit try { - await arkaPaymaster.deposit("one"); + await arkaPaymaster.deposit('one'); - addContext(test, message.fail_deposit_3) - assert.fail(message.fail_deposit_3) + addContext(test, message.fail_deposit_3); + assert.fail(message.fail_deposit_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { diff --git a/test/specs/mainnet/paymaster/optimism.spec.js b/test/specs/mainnet/paymaster/optimism.spec.js index fba3e0b..4e07b24 100644 --- a/test/specs/mainnet/paymaster/optimism.spec.js +++ b/test/specs/mainnet/paymaster/optimism.spec.js @@ -1,6 +1,11 @@ import * as dotenv from 'dotenv'; dotenv.config(); // init dotenv -import { PrimeSdk, DataUtils, EtherspotBundler, ArkaPaymaster } from '@etherspot/prime-sdk'; +import { + PrimeSdk, + DataUtils, + EtherspotBundler, + ArkaPaymaster, +} from '@etherspot/prime-sdk'; import { ethers, utils } from 'ethers'; import { assert } from 'chai'; import { ERC20_ABI } from '@etherspot/prime-sdk/dist/sdk/helpers/abi/ERC20_ABI.js'; @@ -24,7 +29,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -33,15 +37,19 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( optimismMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -63,7 +71,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o assert.strictEqual( optimismEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -73,16 +82,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o console.error(e.message); const eString = e.toString(); addContext(test, eString); - assert.fail( - message.fail_smart_address, - ); + assert.fail(message.fail_smart_address); } // initializating Data service... try { - optimismDataService = new DataUtils( - process.env.DATA_API_KEY - ); + optimismDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -92,7 +97,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o // initializating ArkaPaymaster... try { - arkaPaymaster = new ArkaPaymaster(Number(data.optimism_chainid), process.env.API_KEY, data.paymaster_arka); + arkaPaymaster = new ArkaPaymaster( + Number(data.optimism_chainid), + process.env.API_KEY, + data.paymaster_arka + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -143,7 +152,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -167,7 +175,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -177,7 +186,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -187,7 +197,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -206,9 +217,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o balance = await optimismMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -226,16 +235,18 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { op = await optimismMainNetSdk.estimate({ paymasterDetails: { - url: `https://arka.etherspot.io?apiKey=${process.env.API_KEY - }&chainId=${Number(data.optimism_chainid)}`, + url: `https://arka.etherspot.io?apiKey=${ + process.env.API_KEY + }&chainId=${Number(data.optimism_chainid)}`, context: { mode: 'sponsor' }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -243,9 +254,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -255,7 +264,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -265,7 +275,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -275,7 +286,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -285,7 +297,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -295,7 +308,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -305,7 +319,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -315,7 +330,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -325,7 +341,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -335,7 +352,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -354,9 +372,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o uoHash = await optimismMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -365,9 +381,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -384,11 +400,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let balance; @@ -397,9 +412,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o balance = await optimismMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -438,7 +451,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -448,7 +461,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( paymasterAddress, - message.vali_pimlico_paymasterAddress_1); + message.vali_pimlico_paymasterAddress_1 + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -467,11 +481,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { erc20Contract = new ethers.Contract( data.tokenAddress_optimismUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); contract = await optimismMainNetSdk.addUserOpsToBatch({ @@ -480,9 +494,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o }); try { - assert.isNotEmpty( - contract.to, - message.vali_erc20Contract_to); + assert.isNotEmpty(contract.to, message.vali_erc20Contract_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -490,9 +502,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } try { - assert.isNotEmpty( - contract.data, - message.vali_erc20Contract_data); + assert.isNotEmpty(contract.data, message.vali_erc20Contract_data); } catch (e) { console.error(e); const eString = e.toString(); @@ -512,7 +522,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( approveOp.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -522,7 +533,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( approveOp.nonce, - message.vali_estimateTransaction_nonce); + message.vali_estimateTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -532,7 +544,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( approveOp.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -542,7 +555,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( approveOp.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -552,7 +566,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( approveOp.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -562,7 +577,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( approveOp.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -572,7 +588,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( approveOp.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -582,7 +599,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( approveOp.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -592,7 +610,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( approveOp.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -602,7 +621,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( approveOp.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -612,7 +632,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( approveOp.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -630,9 +651,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o uoHash1 = await optimismMainNetSdk.send(approveOp); try { - assert.isNotEmpty( - uoHash1, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash1, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -641,9 +660,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -671,7 +690,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -681,7 +701,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -699,9 +720,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o balance = await optimismMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -720,13 +739,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o paymasterDetails: { url: `${arka_url}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -736,7 +756,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.nonce, - message.vali_estimateTransaction_nonce); + message.vali_estimateTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -746,7 +767,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -756,7 +778,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -766,7 +789,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -776,7 +800,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -786,7 +811,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -796,7 +822,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -806,7 +833,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -816,7 +844,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -826,7 +855,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -844,9 +874,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o uoHash = await optimismMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -855,9 +883,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -878,11 +906,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let balance; @@ -895,9 +922,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o balance = await optimismMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -930,7 +955,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -940,7 +966,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -958,9 +985,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o balance = await optimismMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -989,13 +1014,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1003,9 +1029,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -1015,7 +1039,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1025,7 +1050,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1035,7 +1061,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1045,7 +1072,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1055,7 +1083,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1065,7 +1094,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1075,7 +1105,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1085,7 +1116,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1095,7 +1127,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1113,9 +1146,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o uoHash = await optimismMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -1124,9 +1155,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1143,10 +1174,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // get the metadata try { let metadata = await arkaPaymaster.metadata(); @@ -1154,7 +1183,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( metadata.sponsorAddress, - message.vali_metadata_sponsorAddress); + message.vali_metadata_sponsorAddress + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1164,7 +1194,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( metadata.sponsorWalletBalance, - message.vali_metadata_sponsorWalletBalance); + message.vali_metadata_sponsorWalletBalance + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1174,7 +1205,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( metadata.chainsSupported, - message.vali_metadata_chainsSupported); + message.vali_metadata_chainsSupported + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1184,7 +1216,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { assert.isNotEmpty( metadata.tokenPaymasters, - message.vali_metadata_tokenPaymasters); + message.vali_metadata_tokenPaymasters + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1206,18 +1239,18 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the get token paymaster address try { - let getTokenPaymasterAddress = await arkaPaymaster.getTokenPaymasterAddress("USDC"); + let getTokenPaymasterAddress = + await arkaPaymaster.getTokenPaymasterAddress('USDC'); try { assert.isNotEmpty( getTokenPaymasterAddress, - message.vali_getTokenPaymasterAddress_tokenPaymasterAddress); + message.vali_getTokenPaymasterAddress_tokenPaymasterAddress + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1239,13 +1272,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the remove whitelist address try { - let removeWhitelist = await arkaPaymaster.removeWhitelist([data.sender]); + let removeWhitelist = await arkaPaymaster.removeWhitelist([ + data.sender, + ]); if (removeWhitelist.includes(constant.remove_whitelist_2)) { addContext(test, message.vali_removeWhitelist_1); @@ -1276,10 +1309,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the add whitelist address try { let addWhitelist = await arkaPaymaster.addWhitelist([data.sender]); @@ -1313,10 +1344,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the whilelist address try { let checkWhitelist = await arkaPaymaster.checkWhitelist(data.sender); @@ -1344,7 +1373,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // validate the deposit @@ -1352,11 +1380,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o let deposit = await arkaPaymaster.deposit(data.value); if (deposit.includes(constant.deposit_1)) { - addContext(test, message.vali_deposit_1) - console.log(message.vali_deposit_1) + addContext(test, message.vali_deposit_1); + console.log(message.vali_deposit_1); } else { - addContext(test, message.fail_deposit_1) - assert.fail(message.fail_deposit_1) + addContext(test, message.fail_deposit_1); + assert.fail(message.fail_deposit_1); } } catch (e) { console.error(e); @@ -1374,9 +1402,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1417,14 +1442,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o url: data.invalid_paymaster_arka, // invalid URL api_key: process.env.API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { if (e.message === constant.not_found) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -1443,9 +1468,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1486,14 +1508,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o url: data.paymaster_arka, api_key: process.env.INVALID_API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -1512,9 +1534,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1555,14 +1574,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o url: data.paymaster_arka, api_key: process.env.INCORRECT_API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_5) + addContext(test, message.fail_estimateTransaction_5); assert.fail(message.fail_estimateTransaction_5); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_4) + addContext(test, message.vali_estimateTransaction_4); console.log(message.vali_estimateTransaction_4); } else { console.error(e); @@ -1581,9 +1600,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1624,14 +1640,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o url: data.paymaster_arka, // without api_key context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_5) + addContext(test, message.vali_estimateTransaction_5); console.log(message.vali_estimateTransaction_5); } else { console.error(e); @@ -1650,13 +1666,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; const invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -1672,7 +1685,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1686,7 +1699,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } if (paymasterAddress.includes(constant.not_found)) { - addContext(test, message.vali_pimlico_paymasterAddress_2) + addContext(test, message.vali_pimlico_paymasterAddress_2); console.log(message.vali_pimlico_paymasterAddress_2); } else { addContext(test, message.fail_pimlico_paymasterAddress_2); @@ -1702,13 +1715,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.INVALID_API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1723,7 +1733,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1735,7 +1745,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } if (returnedValue.error === constant.invalid_apiKey) { - addContext(test, message.vali_pimlico_paymasterAddress_3) + addContext(test, message.vali_pimlico_paymasterAddress_3); console.log(message.vali_pimlico_paymasterAddress_3); } else { addContext(test, message.fail_pimlico_paymasterAddress_3); @@ -1753,9 +1763,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o let queryString = `?chainId=${Number(data.optimism_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1770,7 +1777,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1782,7 +1789,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } if (returnedValue.error === constant.invalid_apiKey) { - addContext(test, message.vali_pimlico_paymasterAddress_4) + addContext(test, message.vali_pimlico_paymasterAddress_4); console.log(message.vali_pimlico_paymasterAddress_4); } else { addContext(test, message.fail_pimlico_paymasterAddress_4); @@ -1798,13 +1805,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_optimism_chainid, + data.invalid_optimism_chainid )}`; // invalid chainid in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1819,7 +1823,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1831,7 +1835,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } if (returnedValue.error === constant.invalid_network_3) { - addContext(test, message.vali_pimlico_paymasterAddress_5) + addContext(test, message.vali_pimlico_paymasterAddress_5); console.log(message.vali_pimlico_paymasterAddress_5); } else { addContext(test, message.fail_pimlico_paymasterAddress_5); @@ -1849,9 +1853,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o let queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { returnedValue = await fetch( @@ -1866,7 +1867,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1878,7 +1879,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } if (returnedValue.error === constant.invalid_data) { - addContext(test, message.vali_pimlico_paymasterAddress_6) + addContext(test, message.vali_pimlico_paymasterAddress_6); console.log(message.vali_pimlico_paymasterAddress_6); } else { addContext(test, message.fail_pimlico_paymasterAddress_6); @@ -1894,13 +1895,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1918,14 +1916,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o { token: data.usdc_token }, ], }), - }, + } ).then((res) => { return res.json(); }); } catch (e) { const errorMessage = returnedValue.error; if (errorMessage.includes(constant.invalid_address_4)) { - addContext(test, message.vali_pimlico_paymasterAddress_7) + addContext(test, message.vali_pimlico_paymasterAddress_7); console.log(message.vali_pimlico_paymasterAddress_7); } else { addContext(test, message.fail_pimlico_paymasterAddress_7); @@ -1942,13 +1940,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1966,7 +1961,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o { token: data.invalid_usdc_token }, // invalid token ], }), - }, + } ).then((res) => { return res.json(); }); @@ -1978,7 +1973,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } if (returnedValue.error === constant.invalid_network_1) { - addContext(test, message.vali_pimlico_paymasterAddress_8) + addContext(test, message.vali_pimlico_paymasterAddress_8); console.log(message.vali_pimlico_paymasterAddress_8); } else { addContext(test, message.fail_pimlico_paymasterAddress_8); @@ -1994,13 +1989,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -2015,7 +2007,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [], // without parametets }), - }, + } ).then((res) => { return res.json(); }); @@ -2027,7 +2019,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } if (returnedValue.error === constant.invalid_data) { - addContext(test, message.vali_pimlico_paymasterAddress_9) + addContext(test, message.vali_pimlico_paymasterAddress_9); console.log(message.vali_pimlico_paymasterAddress_9); } else { addContext(test, message.fail_pimlico_paymasterAddress_9); @@ -2043,13 +2035,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -2065,7 +2054,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2083,11 +2072,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { erc20Contract = new ethers.Contract( data.incorrectTokenAddress_optimismUSDC, // incorrect token address - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await optimismMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_optimismUSDC, @@ -2096,7 +2085,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.contract_address_1)) { - addContext(test, message.vali_erc20Contract_1) + addContext(test, message.vali_erc20Contract_1); console.log(message.vali_erc20Contract_1); } else { console.error(e); @@ -2119,13 +2108,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -2141,7 +2127,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2159,11 +2145,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { erc20Contract = new ethers.Contract( data.invalidTokenAddress_optimismUSDC, // invalid token address - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await optimismMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_optimismUSDC, @@ -2172,7 +2158,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.contract_address_1)) { - addContext(test, message.vali_erc20Contract_2) + addContext(test, message.vali_erc20Contract_2); console.log(message.vali_erc20Contract_2); } else { console.error(e); @@ -2195,13 +2181,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2218,7 +2201,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2236,11 +2219,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { erc20Contract = new ethers.Contract( data.tokenAddress_optimismUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [data.invalid_paymasterAddress, ethers.constants.MaxUint256], // invalid paymaster address + [data.invalid_paymasterAddress, ethers.constants.MaxUint256] // invalid paymaster address ); await optimismMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_optimismUSDC, @@ -2249,7 +2232,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc20Contract_3) + addContext(test, message.vali_erc20Contract_3); console.log(message.vali_erc20Contract_3); } else { console.error(e); @@ -2272,13 +2255,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2295,7 +2275,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2313,11 +2293,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { erc20Contract = new ethers.Contract( data.tokenAddress_optimismUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [data.incorrect_paymasterAddress, ethers.constants.MaxUint256], // incorrect paymaster address + [data.incorrect_paymasterAddress, ethers.constants.MaxUint256] // incorrect paymaster address ); await optimismMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_optimismUSDC, @@ -2326,7 +2306,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc20Contract_4) + addContext(test, message.vali_erc20Contract_4); console.log(message.vali_erc20Contract_4); } else { console.error(e); @@ -2349,13 +2329,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2374,7 +2351,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2392,11 +2369,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { erc20Contract = new ethers.Contract( data.tokenAddress_optimismUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await optimismMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_optimismUSDC, @@ -2425,9 +2402,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2452,12 +2429,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o value: ethers.utils.parseEther(data.invalidValue), }); - addContext(test, message.fail_addTransaction_2) + addContext(test, message.fail_addTransaction_2); assert.fail(message.fail_addTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_value_1)) { - addContext(test, vali_addTransaction_1) + addContext(test, vali_addTransaction_1); console.log(vali_addTransaction_1); } else { console.error(e); @@ -2481,13 +2458,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o let arka_url = data.paymaster_arka; let invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2506,7 +2480,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2524,11 +2498,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { erc20Contract = new ethers.Contract( data.tokenAddress_optimismUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await optimismMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_optimismUSDC, @@ -2557,9 +2531,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2596,15 +2570,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o paymasterDetails: { url: `${invalid_arka_url}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.not_found)) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -2627,15 +2601,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; - let invalid_queryString = `?apiKey=${process.env.INVALID_API_KEY - }&chainId=${Number(data.optimism_chainid)}`; // invalid API Key in queryString + let invalid_queryString = `?apiKey=${ + process.env.INVALID_API_KEY + }&chainId=${Number(data.optimism_chainid)}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2654,7 +2626,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2672,11 +2644,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { erc20Contract = new ethers.Contract( data.tokenAddress_optimismUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await optimismMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_optimismUSDC, @@ -2705,9 +2677,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2744,15 +2716,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_apiKey)) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -2775,14 +2747,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; let invalid_queryString = `?chainId=${Number(data.optimism_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2801,7 +2770,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2819,11 +2788,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { erc20Contract = new ethers.Contract( data.tokenAddress_optimismUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await optimismMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_optimismUSDC, @@ -2852,9 +2821,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2891,15 +2860,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_apiKey)) { - addContext(test, message.vali_estimateTransaction_5) + addContext(test, message.vali_estimateTransaction_5); console.log(message.vali_estimateTransaction_5); } else { console.error(e); @@ -2922,16 +2891,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; let invalid_queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_optimism_chainid, + data.invalid_optimism_chainid )}`; // invalid chainid in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2950,7 +2916,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2968,11 +2934,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { erc20Contract = new ethers.Contract( data.tokenAddress_optimismUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await optimismMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_optimismUSDC, @@ -3001,9 +2967,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3040,15 +3006,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_7) + addContext(test, message.fail_estimateTransaction_7); assert.fail(message.fail_estimateTransaction_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_3)) { - addContext(test, message.vali_estimateTransaction_6) + addContext(test, message.vali_estimateTransaction_6); console.log(message.vali_estimateTransaction_6); } else { console.error(e); @@ -3071,14 +3037,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; let invalid_queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -3097,7 +3060,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -3115,11 +3078,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o try { erc20Contract = new ethers.Contract( data.tokenAddress_optimismUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await optimismMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_optimismUSDC, @@ -3148,9 +3111,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3187,15 +3150,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_8) + addContext(test, message.fail_estimateTransaction_8); assert.fail(message.fail_estimateTransaction_8); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { - addContext(test, message.vali_estimateTransaction_7) + addContext(test, message.vali_estimateTransaction_7); console.log(message.vali_estimateTransaction_7); } else { console.error(e); @@ -3218,13 +3181,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.optimism_chainid, + data.optimism_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await optimismMainNetSdk.getNativeBalance(); @@ -3284,15 +3244,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.not_found)) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -3310,13 +3270,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o it('REGRESSION: Perform the transfer token on arka paymaster with validUntil and validAfter with invalid API Token on the optimism network', async function () { var test = this; let arka_url = data.paymaster_arka; - let invalid_queryString = `?apiKey=${process.env.INVALID_API_KEY - }&chainId=${Number(data.optimism_chainid)}`; // invalid API Key in queryString + let invalid_queryString = `?apiKey=${ + process.env.INVALID_API_KEY + }&chainId=${Number(data.optimism_chainid)}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await optimismMainNetSdk.getNativeBalance(); @@ -3376,14 +3334,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -3404,9 +3362,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o let invalid_queryString = `?chainId=${Number(data.optimism_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await optimismMainNetSdk.getNativeBalance(); @@ -3466,14 +3421,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -3492,13 +3447,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; let arka_url = data.paymaster_arka; let invalid_queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_optimism_chainid, + data.invalid_optimism_chainid )}`; // invalid ChainID in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await optimismMainNetSdk.getNativeBalance(); @@ -3558,15 +3510,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_7) + addContext(test, message.fail_estimateTransaction_7); assert.fail(message.fail_estimateTransaction_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_3)) { - addContext(test, message.vali_estimateTransaction_6) + addContext(test, message.vali_estimateTransaction_6); console.log(message.vali_estimateTransaction_6); } else { console.error(e); @@ -3587,9 +3539,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o let invalid_queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await optimismMainNetSdk.getNativeBalance(); @@ -3649,15 +3598,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_8) + addContext(test, message.fail_estimateTransaction_8); assert.fail(message.fail_estimateTransaction_8); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { - addContext(test, message.vali_estimateTransaction_7) + addContext(test, message.vali_estimateTransaction_7); console.log(message.vali_estimateTransaction_7); } else { console.error(e); @@ -3676,16 +3625,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the get token paymaster address try { await arkaPaymaster.getTokenPaymasterAddress(data.invalid_usdc_token); - addContext(test, message.fail_getTokenPaymasterAddress_2) - assert.fail(message.fail_getTokenPaymasterAddress_2) + addContext(test, message.fail_getTokenPaymasterAddress_2); + assert.fail(message.fail_getTokenPaymasterAddress_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_1)) { @@ -3708,16 +3653,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the get token paymaster address try { await arkaPaymaster.getTokenPaymasterAddress(); - addContext(test, message.fail_getTokenPaymasterAddress_3) - assert.fail(message.fail_getTokenPaymasterAddress_3) + addContext(test, message.fail_getTokenPaymasterAddress_3); + assert.fail(message.fail_getTokenPaymasterAddress_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { @@ -3740,15 +3681,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { await arkaPaymaster.removeWhitelist([data.invalidSender]); - addContext(test, message.fail_removeWhitelist_3) + addContext(test, message.fail_removeWhitelist_3); assert.fail(message.fail_removeWhitelist_3); } catch (e) { let errorMessage = e.message; @@ -3772,15 +3709,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { await arkaPaymaster.removeWhitelist([data.incorrectSender]); - addContext(test, message.fail_removeWhitelist_4) + addContext(test, message.fail_removeWhitelist_4); assert.fail(message.fail_removeWhitelist_4); } catch (e) { let errorMessage = e.message; @@ -3804,16 +3737,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress = ethers.Wallet.createRandom(); await arkaPaymaster.removeWhitelist([randomAddress.address]); - addContext(test, message.fail_removeWhitelist_5) + addContext(test, message.fail_removeWhitelist_5); assert.fail(message.fail_removeWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -3837,16 +3766,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - await arkaPaymaster.removeWhitelist([randomAddress.address, data.sender]); + await arkaPaymaster.removeWhitelist([ + randomAddress.address, + data.sender, + ]); - addContext(test, message.fail_removeWhitelist_5) + addContext(test, message.fail_removeWhitelist_5); assert.fail(message.fail_removeWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -3870,20 +3798,22 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); // make whitelisted addresses - await arkaPaymaster.addWhitelist([randomAddress1.address, randomAddress2.address]); + await arkaPaymaster.addWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); // remove whitelist addresses - let removewhitelist = await arkaPaymaster.removeWhitelist([randomAddress1.address, randomAddress2.address]); + let removewhitelist = await arkaPaymaster.removeWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); if (removewhitelist.includes(constant.remove_whitelist_2)) { addContext(test, message.vali_removeWhitelist_1); @@ -3914,17 +3844,16 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); - await arkaPaymaster.removeWhitelist([randomAddress1.address, randomAddress2.address]); + await arkaPaymaster.removeWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); - addContext(test, message.fail_removeWhitelist_6) + addContext(test, message.fail_removeWhitelist_6); assert.fail(message.fail_removeWhitelist_6); } catch (e) { let errorMessage = e.message; @@ -3948,15 +3877,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { await arkaPaymaster.addWhitelist([data.invalidSender]); - addContext(test, message.fail_addWhitelist_3) + addContext(test, message.fail_addWhitelist_3); assert.fail(message.fail_addWhitelist_3); } catch (e) { let errorMessage = e.message; @@ -3980,15 +3905,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { await arkaPaymaster.addWhitelist([data.incorrectSender]); - addContext(test, message.fail_addWhitelist_4) + addContext(test, message.fail_addWhitelist_4); assert.fail(message.fail_addWhitelist_4); } catch (e) { let errorMessage = e.message; @@ -4012,14 +3933,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - let addwhitelist = await arkaPaymaster.addWhitelist([randomAddress.address]); + let addwhitelist = await arkaPaymaster.addWhitelist([ + randomAddress.address, + ]); if (addwhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_5); @@ -4050,14 +3969,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - await arkaPaymaster.addWhitelist([randomAddress.address, data.sender]); + await arkaPaymaster.addWhitelist([ + randomAddress.address, + data.sender, + ]); if (addWhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_1); @@ -4088,17 +4006,16 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); // add whitelist addresses - let addwhitelist = await arkaPaymaster.addWhitelist([randomAddress1.address, randomAddress2.address]); + let addwhitelist = await arkaPaymaster.addWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); if (addwhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_1); @@ -4129,16 +4046,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(data.invalidSender); - addContext(test, message.fail_checkWhitelist_2) - assert.fail(message.fail_checkWhitelist_2) + addContext(test, message.fail_checkWhitelist_2); + assert.fail(message.fail_checkWhitelist_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_5)) { @@ -4161,16 +4074,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(data.invalidSender); - addContext(test, message.fail_checkWhitelist_3) - assert.fail(message.fail_checkWhitelist_3) + addContext(test, message.fail_checkWhitelist_3); + assert.fail(message.fail_checkWhitelist_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_5)) { @@ -4193,14 +4102,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { const randomAddress = ethers.Wallet.createRandom(); - let checkwhitelist = await arkaPaymaster.checkWhitelist(randomAddress.address); + let checkwhitelist = await arkaPaymaster.checkWhitelist( + randomAddress.address + ); if (checkwhitelist.includes(constant.check_whitelist_1)) { addContext(test, message.vali_addWhitelist_2); @@ -4225,15 +4132,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(); - addContext(test, message.fail_checkWhitelist_5) + addContext(test, message.fail_checkWhitelist_5); assert.fail(message.fail_checkWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -4257,16 +4160,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the deposit try { - await arkaPaymaster.deposit("one"); + await arkaPaymaster.deposit('one'); - addContext(test, message.fail_deposit_3) - assert.fail(message.fail_deposit_3) + addContext(test, message.fail_deposit_3); + assert.fail(message.fail_deposit_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { diff --git a/test/specs/mainnet/paymaster/xdai.spec.js b/test/specs/mainnet/paymaster/xdai.spec.js index a36dbae..9ecdc0b 100644 --- a/test/specs/mainnet/paymaster/xdai.spec.js +++ b/test/specs/mainnet/paymaster/xdai.spec.js @@ -1,6 +1,11 @@ import * as dotenv from 'dotenv'; dotenv.config(); // init dotenv -import { PrimeSdk, DataUtils, EtherspotBundler, ArkaPaymaster } from '@etherspot/prime-sdk'; +import { + PrimeSdk, + DataUtils, + EtherspotBundler, + ArkaPaymaster, +} from '@etherspot/prime-sdk'; import { ethers, utils } from 'ethers'; import { assert } from 'chai'; import { ERC20_ABI } from '@etherspot/prime-sdk/dist/sdk/helpers/abi/ERC20_ABI.js'; @@ -24,7 +29,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -33,15 +37,19 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.xdai_chainid), - bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.xdai_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( xdaiMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -63,7 +71,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x assert.strictEqual( xdaiEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -73,16 +82,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x console.error(e.message); const eString = e.toString(); addContext(test, eString); - assert.fail( - message.fail_smart_address, - ); + assert.fail(message.fail_smart_address); } // initializating Data service... try { - xdaiDataService = new DataUtils( - process.env.DATA_API_KEY - ); + xdaiDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -92,7 +97,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x // initializating ArkaPaymaster... try { - arkaPaymaster = new ArkaPaymaster(Number(data.xdai_chainid), process.env.API_KEY, data.paymaster_arka); + arkaPaymaster = new ArkaPaymaster( + Number(data.xdai_chainid), + process.env.API_KEY, + data.paymaster_arka + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -143,7 +152,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -167,7 +175,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -177,7 +186,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -187,7 +197,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -206,9 +217,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x balance = await xdaiMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -226,16 +235,18 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { op = await xdaiMainNetSdk.estimate({ paymasterDetails: { - url: `https://arka.etherspot.io?apiKey=${process.env.API_KEY - }&chainId=${Number(data.xdai_chainid)}`, + url: `https://arka.etherspot.io?apiKey=${ + process.env.API_KEY + }&chainId=${Number(data.xdai_chainid)}`, context: { mode: 'sponsor' }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -243,9 +254,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -255,7 +264,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -265,7 +275,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -275,7 +286,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -285,7 +297,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -295,7 +308,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -305,7 +319,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -315,7 +330,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -325,7 +341,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -335,7 +352,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -354,9 +372,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x uoHash = await xdaiMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -365,9 +381,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -384,11 +400,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let balance; @@ -397,9 +412,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x balance = await xdaiMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -438,7 +451,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -448,7 +461,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( paymasterAddress, - message.vali_pimlico_paymasterAddress_1); + message.vali_pimlico_paymasterAddress_1 + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -467,11 +481,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { erc20Contract = new ethers.Contract( data.tokenAddress_xdaiUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); contract = await xdaiMainNetSdk.addUserOpsToBatch({ @@ -480,9 +494,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x }); try { - assert.isNotEmpty( - contract.to, - message.vali_erc20Contract_to); + assert.isNotEmpty(contract.to, message.vali_erc20Contract_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -490,9 +502,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } try { - assert.isNotEmpty( - contract.data, - message.vali_erc20Contract_data); + assert.isNotEmpty(contract.data, message.vali_erc20Contract_data); } catch (e) { console.error(e); const eString = e.toString(); @@ -512,7 +522,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( approveOp.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -522,7 +533,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( approveOp.nonce, - message.vali_estimateTransaction_nonce); + message.vali_estimateTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -532,7 +544,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( approveOp.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -542,7 +555,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( approveOp.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -552,7 +566,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( approveOp.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -562,7 +577,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( approveOp.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -572,7 +588,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( approveOp.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -582,7 +599,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( approveOp.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -592,7 +610,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( approveOp.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -602,7 +621,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( approveOp.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -612,7 +632,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( approveOp.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -630,9 +651,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x uoHash1 = await xdaiMainNetSdk.send(approveOp); try { - assert.isNotEmpty( - uoHash1, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash1, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -641,9 +660,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -671,7 +690,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -681,7 +701,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -699,9 +720,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x balance = await xdaiMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -720,13 +739,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x paymasterDetails: { url: `${arka_url}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -736,7 +756,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.nonce, - message.vali_estimateTransaction_nonce); + message.vali_estimateTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -746,7 +767,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -756,7 +778,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -766,7 +789,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -776,7 +800,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -786,7 +811,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -796,7 +822,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -806,7 +833,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -816,7 +844,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -826,7 +855,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -844,9 +874,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x uoHash = await xdaiMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -855,9 +883,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -878,12 +906,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; let balance; let transactionBatch; @@ -895,9 +922,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x balance = await xdaiMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -930,7 +955,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -940,7 +966,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -958,9 +985,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x balance = await xdaiMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -989,13 +1014,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1003,9 +1029,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -1015,7 +1039,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1025,7 +1050,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1035,7 +1061,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1045,7 +1072,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1055,7 +1083,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1065,7 +1094,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1075,7 +1105,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1085,7 +1116,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1095,7 +1127,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1113,9 +1146,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x uoHash = await xdaiMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -1124,9 +1155,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1143,7 +1174,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get the metadata @@ -1153,7 +1183,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( metadata.sponsorAddress, - message.vali_metadata_sponsorAddress); + message.vali_metadata_sponsorAddress + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1163,7 +1194,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( metadata.sponsorWalletBalance, - message.vali_metadata_sponsorWalletBalance); + message.vali_metadata_sponsorWalletBalance + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1173,7 +1205,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( metadata.chainsSupported, - message.vali_metadata_chainsSupported); + message.vali_metadata_chainsSupported + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1183,7 +1216,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { assert.isNotEmpty( metadata.tokenPaymasters, - message.vali_metadata_tokenPaymasters); + message.vali_metadata_tokenPaymasters + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1205,18 +1239,18 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the get token paymaster address try { - let getTokenPaymasterAddress = await arkaPaymaster.getTokenPaymasterAddress("USDC"); + let getTokenPaymasterAddress = + await arkaPaymaster.getTokenPaymasterAddress('USDC'); try { assert.isNotEmpty( getTokenPaymasterAddress, - message.vali_getTokenPaymasterAddress_tokenPaymasterAddress); + message.vali_getTokenPaymasterAddress_tokenPaymasterAddress + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1238,13 +1272,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the remove whitelist address try { - let removeWhitelist = await arkaPaymaster.removeWhitelist([data.sender]); + let removeWhitelist = await arkaPaymaster.removeWhitelist([ + data.sender, + ]); if (removeWhitelist.includes(constant.remove_whitelist_2)) { addContext(test, message.vali_removeWhitelist_1); @@ -1275,10 +1309,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the add whitelist address try { let addWhitelist = await arkaPaymaster.addWhitelist([data.sender]); @@ -1312,10 +1344,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the whilelist address try { let checkWhitelist = await arkaPaymaster.checkWhitelist(data.sender); @@ -1343,7 +1373,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // validate the deposit @@ -1351,11 +1380,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x let deposit = await arkaPaymaster.deposit(data.value); if (deposit.includes(constant.deposit_1)) { - addContext(test, message.vali_deposit_1) - console.log(message.vali_deposit_1) + addContext(test, message.vali_deposit_1); + console.log(message.vali_deposit_1); } else { - addContext(test, message.fail_deposit_1) - assert.fail(message.fail_deposit_1) + addContext(test, message.fail_deposit_1); + assert.fail(message.fail_deposit_1); } } catch (e) { console.error(e); @@ -1373,9 +1402,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1416,14 +1442,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x url: data.invalid_paymaster_arka, // invalid URL api_key: process.env.API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { if (e.message === constant.not_found) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -1442,9 +1468,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1485,14 +1508,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x url: data.paymaster_arka, api_key: process.env.INVALID_API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -1511,9 +1534,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1554,14 +1574,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x url: data.paymaster_arka, api_key: process.env.INCORRECT_API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_5) + addContext(test, message.fail_estimateTransaction_5); assert.fail(message.fail_estimateTransaction_5); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_4) + addContext(test, message.vali_estimateTransaction_4); console.log(message.vali_estimateTransaction_4); } else { console.error(e); @@ -1580,9 +1600,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1623,14 +1640,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x url: data.paymaster_arka, // without api_key context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_5) + addContext(test, message.vali_estimateTransaction_5); console.log(message.vali_estimateTransaction_5); } else { console.error(e); @@ -1649,13 +1666,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; const invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -1671,7 +1685,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1685,7 +1699,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } if (paymasterAddress.includes(constant.not_found)) { - addContext(test, message.vali_pimlico_paymasterAddress_2) + addContext(test, message.vali_pimlico_paymasterAddress_2); console.log(message.vali_pimlico_paymasterAddress_2); } else { addContext(test, message.fail_pimlico_paymasterAddress_2); @@ -1701,13 +1715,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.INVALID_API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1722,7 +1733,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1734,7 +1745,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } if (returnedValue.error === constant.invalid_apiKey) { - addContext(test, message.vali_pimlico_paymasterAddress_3) + addContext(test, message.vali_pimlico_paymasterAddress_3); console.log(message.vali_pimlico_paymasterAddress_3); } else { addContext(test, message.fail_pimlico_paymasterAddress_3); @@ -1752,9 +1763,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x let queryString = `?chainId=${Number(data.xdai_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1769,7 +1777,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1781,7 +1789,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } if (returnedValue.error === constant.invalid_apiKey) { - addContext(test, message.vali_pimlico_paymasterAddress_4) + addContext(test, message.vali_pimlico_paymasterAddress_4); console.log(message.vali_pimlico_paymasterAddress_4); } else { addContext(test, message.fail_pimlico_paymasterAddress_4); @@ -1797,13 +1805,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_xdai_chainid, + data.invalid_xdai_chainid )}`; // invalid chainid in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1818,7 +1823,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1830,7 +1835,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } if (returnedValue.error === constant.invalid_network_3) { - addContext(test, message.vali_pimlico_paymasterAddress_5) + addContext(test, message.vali_pimlico_paymasterAddress_5); console.log(message.vali_pimlico_paymasterAddress_5); } else { addContext(test, message.fail_pimlico_paymasterAddress_5); @@ -1848,9 +1853,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x let queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { returnedValue = await fetch( @@ -1865,7 +1867,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1877,7 +1879,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } if (returnedValue.error === constant.invalid_data) { - addContext(test, message.vali_pimlico_paymasterAddress_6) + addContext(test, message.vali_pimlico_paymasterAddress_6); console.log(message.vali_pimlico_paymasterAddress_6); } else { addContext(test, message.fail_pimlico_paymasterAddress_6); @@ -1893,13 +1895,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1917,14 +1916,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x { token: data.usdc_token }, ], }), - }, + } ).then((res) => { return res.json(); }); } catch (e) { const errorMessage = returnedValue.error; if (errorMessage.includes(constant.invalid_address_4)) { - addContext(test, message.vali_pimlico_paymasterAddress_7) + addContext(test, message.vali_pimlico_paymasterAddress_7); console.log(message.vali_pimlico_paymasterAddress_7); } else { addContext(test, message.fail_pimlico_paymasterAddress_7); @@ -1941,13 +1940,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1965,7 +1961,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x { token: data.invalid_usdc_token }, // invalid token ], }), - }, + } ).then((res) => { return res.json(); }); @@ -1977,7 +1973,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } if (returnedValue.error === constant.invalid_network_1) { - addContext(test, message.vali_pimlico_paymasterAddress_8) + addContext(test, message.vali_pimlico_paymasterAddress_8); console.log(message.vali_pimlico_paymasterAddress_8); } else { addContext(test, message.fail_pimlico_paymasterAddress_8); @@ -1993,13 +1989,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -2014,7 +2007,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [], // without parametets }), - }, + } ).then((res) => { return res.json(); }); @@ -2026,7 +2019,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } if (returnedValue.error === constant.invalid_data) { - addContext(test, message.vali_pimlico_paymasterAddress_9) + addContext(test, message.vali_pimlico_paymasterAddress_9); console.log(message.vali_pimlico_paymasterAddress_9); } else { addContext(test, message.fail_pimlico_paymasterAddress_9); @@ -2042,13 +2035,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -2064,7 +2054,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2082,11 +2072,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { erc20Contract = new ethers.Contract( data.incorrectTokenAddress_xdaiUSDC, // incorrect token address - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await xdaiMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_xdaiUSDC, @@ -2095,7 +2085,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.contract_address_1)) { - addContext(test, message.vali_erc20Contract_1) + addContext(test, message.vali_erc20Contract_1); console.log(message.vali_erc20Contract_1); } else { console.error(e); @@ -2118,13 +2108,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -2140,7 +2127,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2158,11 +2145,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { erc20Contract = new ethers.Contract( data.invalidTokenAddress_xdaiUSDC, // invalid token address - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await xdaiMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_xdaiUSDC, @@ -2171,7 +2158,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.contract_address_1)) { - addContext(test, message.vali_erc20Contract_2) + addContext(test, message.vali_erc20Contract_2); console.log(message.vali_erc20Contract_2); } else { console.error(e); @@ -2194,13 +2181,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2217,7 +2201,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2235,11 +2219,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { erc20Contract = new ethers.Contract( data.tokenAddress_xdaiUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [data.invalid_paymasterAddress, ethers.constants.MaxUint256], // invalid paymaster address + [data.invalid_paymasterAddress, ethers.constants.MaxUint256] // invalid paymaster address ); await xdaiMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_xdaiUSDC, @@ -2248,7 +2232,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc20Contract_3) + addContext(test, message.vali_erc20Contract_3); console.log(message.vali_erc20Contract_3); } else { console.error(e); @@ -2271,13 +2255,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2294,7 +2275,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2312,11 +2293,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { erc20Contract = new ethers.Contract( data.tokenAddress_xdaiUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [data.incorrect_paymasterAddress, ethers.constants.MaxUint256], // incorrect paymaster address + [data.incorrect_paymasterAddress, ethers.constants.MaxUint256] // incorrect paymaster address ); await xdaiMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_xdaiUSDC, @@ -2325,7 +2306,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc20Contract_4) + addContext(test, message.vali_erc20Contract_4); console.log(message.vali_erc20Contract_4); } else { console.error(e); @@ -2348,13 +2329,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2373,7 +2351,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2391,11 +2369,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { erc20Contract = new ethers.Contract( data.tokenAddress_xdaiUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await xdaiMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_xdaiUSDC, @@ -2424,9 +2402,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2451,12 +2429,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x value: ethers.utils.parseEther(data.invalidValue), }); - addContext(test, message.fail_addTransaction_2) + addContext(test, message.fail_addTransaction_2); assert.fail(message.fail_addTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_value_1)) { - addContext(test, vali_addTransaction_1) + addContext(test, vali_addTransaction_1); console.log(vali_addTransaction_1); } else { console.error(e); @@ -2480,13 +2458,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x let arka_url = data.paymaster_arka; let invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2505,7 +2480,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2523,11 +2498,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { erc20Contract = new ethers.Contract( data.tokenAddress_xdaiUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await xdaiMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_xdaiUSDC, @@ -2556,9 +2531,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2595,15 +2570,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x paymasterDetails: { url: `${invalid_arka_url}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.not_found)) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -2626,15 +2601,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; - let invalid_queryString = `?apiKey=${process.env.INVALID_API_KEY - }&chainId=${Number(data.xdai_chainid)}`; // invalid API Key in queryString + let invalid_queryString = `?apiKey=${ + process.env.INVALID_API_KEY + }&chainId=${Number(data.xdai_chainid)}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2653,7 +2626,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2671,11 +2644,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { erc20Contract = new ethers.Contract( data.tokenAddress_xdaiUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await xdaiMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_xdaiUSDC, @@ -2704,9 +2677,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2743,15 +2716,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_apiKey)) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -2774,14 +2747,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; let invalid_queryString = `?chainId=${Number(data.xdai_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2800,7 +2770,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2818,11 +2788,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { erc20Contract = new ethers.Contract( data.tokenAddress_xdaiUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await xdaiMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_xdaiUSDC, @@ -2851,9 +2821,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -2890,15 +2860,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_apiKey)) { - addContext(test, message.vali_estimateTransaction_5) + addContext(test, message.vali_estimateTransaction_5); console.log(message.vali_estimateTransaction_5); } else { console.error(e); @@ -2921,16 +2891,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; let invalid_queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_xdai_chainid, + data.invalid_xdai_chainid )}`; // invalid chainid in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2949,7 +2916,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2967,11 +2934,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { erc20Contract = new ethers.Contract( data.tokenAddress_xdaiUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await xdaiMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_xdaiUSDC, @@ -3000,9 +2967,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3039,15 +3006,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_7) + addContext(test, message.fail_estimateTransaction_7); assert.fail(message.fail_estimateTransaction_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_3)) { - addContext(test, message.vali_estimateTransaction_6) + addContext(test, message.vali_estimateTransaction_6); console.log(message.vali_estimateTransaction_6); } else { console.error(e); @@ -3070,14 +3037,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; let invalid_queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -3096,7 +3060,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -3114,11 +3078,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x try { erc20Contract = new ethers.Contract( data.tokenAddress_xdaiUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await xdaiMainNetSdk.addUserOpsToBatch({ to: data.tokenAddress_xdaiUSDC, @@ -3147,9 +3111,9 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3186,15 +3150,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_8) + addContext(test, message.fail_estimateTransaction_8); assert.fail(message.fail_estimateTransaction_8); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { - addContext(test, message.vali_estimateTransaction_7) + addContext(test, message.vali_estimateTransaction_7); console.log(message.vali_estimateTransaction_7); } else { console.error(e); @@ -3217,13 +3181,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.xdai_chainid, + data.xdai_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await xdaiMainNetSdk.getNativeBalance(); @@ -3283,15 +3244,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.not_found)) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -3309,13 +3270,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x it('REGRESSION: Perform the transfer token on arka paymaster with validUntil and validAfter with invalid API Token on the XDAI network', async function () { var test = this; let arka_url = data.paymaster_arka; - let invalid_queryString = `?apiKey=${process.env.INVALID_API_KEY - }&chainId=${Number(data.xdai_chainid)}`; // invalid API Key in queryString + let invalid_queryString = `?apiKey=${ + process.env.INVALID_API_KEY + }&chainId=${Number(data.xdai_chainid)}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await xdaiMainNetSdk.getNativeBalance(); @@ -3375,14 +3334,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -3403,9 +3362,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x let invalid_queryString = `?chainId=${Number(data.xdai_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await xdaiMainNetSdk.getNativeBalance(); @@ -3465,14 +3421,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -3491,13 +3447,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; let arka_url = data.paymaster_arka; let invalid_queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_xdai_chainid, + data.invalid_xdai_chainid )}`; // invalid ChainID in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await xdaiMainNetSdk.getNativeBalance(); @@ -3557,15 +3510,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_7) + addContext(test, message.fail_estimateTransaction_7); assert.fail(message.fail_estimateTransaction_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_3)) { - addContext(test, message.vali_estimateTransaction_6) + addContext(test, message.vali_estimateTransaction_6); console.log(message.vali_estimateTransaction_6); } else { console.error(e); @@ -3586,9 +3539,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x let invalid_queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await xdaiMainNetSdk.getNativeBalance(); @@ -3648,15 +3598,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_8) + addContext(test, message.fail_estimateTransaction_8); assert.fail(message.fail_estimateTransaction_8); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { - addContext(test, message.vali_estimateTransaction_7) + addContext(test, message.vali_estimateTransaction_7); console.log(message.vali_estimateTransaction_7); } else { console.error(e); @@ -3675,16 +3625,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the get token paymaster address try { await arkaPaymaster.getTokenPaymasterAddress(data.invalid_usdc_token); - addContext(test, message.fail_getTokenPaymasterAddress_2) - assert.fail(message.fail_getTokenPaymasterAddress_2) + addContext(test, message.fail_getTokenPaymasterAddress_2); + assert.fail(message.fail_getTokenPaymasterAddress_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_1)) { @@ -3707,16 +3653,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the get token paymaster address try { await arkaPaymaster.getTokenPaymasterAddress(); - addContext(test, message.fail_getTokenPaymasterAddress_3) - assert.fail(message.fail_getTokenPaymasterAddress_3) + addContext(test, message.fail_getTokenPaymasterAddress_3); + assert.fail(message.fail_getTokenPaymasterAddress_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { @@ -3739,15 +3681,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { await arkaPaymaster.removeWhitelist([data.invalidSender]); - addContext(test, message.fail_removeWhitelist_3) + addContext(test, message.fail_removeWhitelist_3); assert.fail(message.fail_removeWhitelist_3); } catch (e) { let errorMessage = e.message; @@ -3771,15 +3709,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { await arkaPaymaster.removeWhitelist([data.incorrectSender]); - addContext(test, message.fail_removeWhitelist_4) + addContext(test, message.fail_removeWhitelist_4); assert.fail(message.fail_removeWhitelist_4); } catch (e) { let errorMessage = e.message; @@ -3803,16 +3737,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress = ethers.Wallet.createRandom(); await arkaPaymaster.removeWhitelist([randomAddress.address]); - addContext(test, message.fail_removeWhitelist_5) + addContext(test, message.fail_removeWhitelist_5); assert.fail(message.fail_removeWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -3836,16 +3766,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - await arkaPaymaster.removeWhitelist([randomAddress.address, data.sender]); + await arkaPaymaster.removeWhitelist([ + randomAddress.address, + data.sender, + ]); - addContext(test, message.fail_removeWhitelist_5) + addContext(test, message.fail_removeWhitelist_5); assert.fail(message.fail_removeWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -3869,20 +3798,22 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); // make whitelisted addresses - await arkaPaymaster.addWhitelist([randomAddress1.address, randomAddress2.address]); + await arkaPaymaster.addWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); // remove whitelist addresses - let removewhitelist = await arkaPaymaster.removeWhitelist([randomAddress1.address, randomAddress2.address]); + let removewhitelist = await arkaPaymaster.removeWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); if (removewhitelist.includes(constant.remove_whitelist_2)) { addContext(test, message.vali_removeWhitelist_1); @@ -3913,17 +3844,16 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); - await arkaPaymaster.removeWhitelist([randomAddress1.address, randomAddress2.address]); + await arkaPaymaster.removeWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); - addContext(test, message.fail_removeWhitelist_6) + addContext(test, message.fail_removeWhitelist_6); assert.fail(message.fail_removeWhitelist_6); } catch (e) { let errorMessage = e.message; @@ -3947,15 +3877,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { await arkaPaymaster.addWhitelist([data.invalidSender]); - addContext(test, message.fail_addWhitelist_3) + addContext(test, message.fail_addWhitelist_3); assert.fail(message.fail_addWhitelist_3); } catch (e) { let errorMessage = e.message; @@ -3979,15 +3905,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { await arkaPaymaster.addWhitelist([data.incorrectSender]); - addContext(test, message.fail_addWhitelist_4) + addContext(test, message.fail_addWhitelist_4); assert.fail(message.fail_addWhitelist_4); } catch (e) { let errorMessage = e.message; @@ -4011,14 +3933,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - let addwhitelist = await arkaPaymaster.addWhitelist([randomAddress.address]); + let addwhitelist = await arkaPaymaster.addWhitelist([ + randomAddress.address, + ]); if (addwhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_5); @@ -4049,14 +3969,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - await arkaPaymaster.addWhitelist([randomAddress.address, data.sender]); + await arkaPaymaster.addWhitelist([ + randomAddress.address, + data.sender, + ]); if (addWhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_1); @@ -4087,17 +4006,16 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); // add whitelist addresses - let addwhitelist = await arkaPaymaster.addWhitelist([randomAddress1.address, randomAddress2.address]); + let addwhitelist = await arkaPaymaster.addWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); if (addwhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_1); @@ -4128,16 +4046,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(data.invalidSender); - addContext(test, message.fail_checkWhitelist_2) - assert.fail(message.fail_checkWhitelist_2) + addContext(test, message.fail_checkWhitelist_2); + assert.fail(message.fail_checkWhitelist_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_5)) { @@ -4160,16 +4074,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(data.invalidSender); - addContext(test, message.fail_checkWhitelist_3) - assert.fail(message.fail_checkWhitelist_3) + addContext(test, message.fail_checkWhitelist_3); + assert.fail(message.fail_checkWhitelist_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_5)) { @@ -4192,14 +4102,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { const randomAddress = ethers.Wallet.createRandom(); - let checkwhitelist = await arkaPaymaster.checkWhitelist(randomAddress.address); + let checkwhitelist = await arkaPaymaster.checkWhitelist( + randomAddress.address + ); if (checkwhitelist.includes(constant.check_whitelist_1)) { addContext(test, message.vali_addWhitelist_2); @@ -4224,15 +4132,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(); - addContext(test, message.fail_checkWhitelist_5) + addContext(test, message.fail_checkWhitelist_5); assert.fail(message.fail_checkWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -4256,16 +4160,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the deposit try { - await arkaPaymaster.deposit("one"); + await arkaPaymaster.deposit('one'); - addContext(test, message.fail_deposit_3) - assert.fail(message.fail_deposit_3) + addContext(test, message.fail_deposit_3); + assert.fail(message.fail_deposit_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { diff --git a/test/specs/mainnet/swap/arbitrum.spec.js b/test/specs/mainnet/swap/arbitrum.spec.js index de1363b..2e1a3f6 100644 --- a/test/specs/mainnet/swap/arbitrum.spec.js +++ b/test/specs/mainnet/swap/arbitrum.spec.js @@ -21,17 +21,17 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { arbitrumMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -61,7 +61,8 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi assert.strictEqual( arbitrumEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -76,9 +77,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi // initializating Data service... try { - arbitrumDataService = new DataUtils( - process.env.DATA_API_KEY - ); + arbitrumDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -130,9 +129,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await arbitrumDataService.getExchangeSupportedAssets({ page: 1, @@ -143,7 +139,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { @@ -253,7 +249,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( offers[i].receiveAmount, - message.vali_exchangeOffers_receiveAmount, + message.vali_exchangeOffers_receiveAmount ); } catch (e) { console.error(e); @@ -304,9 +300,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await arbitrumDataService.getExchangeSupportedAssets({ page: 1, @@ -317,13 +310,13 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { assert.isNotEmpty( exchangeSupportedAssets.items[0].address, - message.vali_exchangeOffers_address, + message.vali_exchangeOffers_address ); } catch (e) { console.error(e); @@ -334,7 +327,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNumber( exchangeSupportedAssets.items[0].chainId, - message.vali_exchangeOffers_chainId, + message.vali_exchangeOffers_chainId ); } catch (e) { console.error(e); @@ -345,7 +338,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( exchangeSupportedAssets.items[0].name, - message.vali_exchangeOffers_name, + message.vali_exchangeOffers_name ); } catch (e) { console.error(e); @@ -416,7 +409,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( offers[i].provider, - message.vali_exchangeOffers_provider, + message.vali_exchangeOffers_provider ); } catch (e) { console.error(e); @@ -477,9 +470,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; let quotes; try { @@ -499,7 +489,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].provider, - message.vali_crossChainQuotes_provider, + message.vali_crossChainQuotes_provider ); } catch (e) { console.error(e); @@ -510,7 +500,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].transaction.data, - message.vali_crossChainQuotes_data, + message.vali_crossChainQuotes_data ); } catch (e) { console.error(e); @@ -562,7 +552,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi addContext(test, eString); } } else { - addContext(test, message.vali_crossChainQuotes_1) + addContext(test, message.vali_crossChainQuotes_1); console.log(message.vali_crossChainQuotes_1); } } catch (e) { @@ -581,9 +571,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; let quotes; let stepTransaction; @@ -610,7 +597,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].id, - message.vali_advanceRoutesLiFi_id, + message.vali_advanceRoutesLiFi_id ); } catch (e) { console.error(e); @@ -621,7 +608,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNumber( quotes.items[0].fromChainId, - message.vali_advanceRoutesLiFi_fromChainId, + message.vali_advanceRoutesLiFi_fromChainId ); } catch (e) { console.error(e); @@ -654,7 +641,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].fromToken, - message.vali_advanceRoutesLiFi_fromToken, + message.vali_advanceRoutesLiFi_fromToken ); } catch (e) { console.error(e); @@ -753,7 +740,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( stepTransaction.items[0].data, - message.vali_stepTransaction_data, + message.vali_stepTransaction_data ); } catch (e) { console.error(e); @@ -764,7 +751,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( stepTransaction.items[0].value, - message.vali_stepTransaction_value, + message.vali_stepTransaction_value ); } catch (e) { console.error(e); @@ -902,9 +889,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await arbitrumDataService.getExchangeSupportedAssets({ page: 1, @@ -915,13 +899,13 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { assert.isNotEmpty( exchangeSupportedAssets.items[0].address, - message.vali_exchangeOffers_address, + message.vali_exchangeOffers_address ); } catch (e) { console.error(e); @@ -1008,12 +992,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_2) - assert.fail(message.fail_exchangeOffers_2) + addContext(test, message.fail_exchangeOffers_2); + assert.fail(message.fail_exchangeOffers_2); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_exchangeOffers_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_exchangeOffers_4); console.log(message.vali_exchangeOffers_4); } else { console.error(e); @@ -1033,9 +1020,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await arbitrumDataService.getExchangeSupportedAssets({ page: 1, @@ -1046,7 +1030,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1072,12 +1056,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_3) - assert.fail(message.fail_exchangeOffers_3) + addContext(test, message.fail_exchangeOffers_3); + assert.fail(message.fail_exchangeOffers_3); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_exchangeOffers_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_exchangeOffers_5); console.log(message.vali_exchangeOffers_5); } else { console.error(e); @@ -1097,9 +1084,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await arbitrumDataService.getExchangeSupportedAssets({ page: 1, @@ -1110,7 +1094,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1137,12 +1121,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_4) - assert.fail(message.fail_exchangeOffers_4) + addContext(test, message.fail_exchangeOffers_4); + assert.fail(message.fail_exchangeOffers_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_exchangeOffers_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_exchangeOffers_6); console.log(message.vali_exchangeOffers_6); } else { console.error(e); @@ -1162,9 +1149,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await arbitrumDataService.getExchangeSupportedAssets({ page: 1, @@ -1175,7 +1159,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1201,12 +1185,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_5) - assert.fail(message.fail_exchangeOffers_5) + addContext(test, message.fail_exchangeOffers_5); + assert.fail(message.fail_exchangeOffers_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_exchangeOffers_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_exchangeOffers_7); console.log(message.vali_exchangeOffers_7); } else { console.error(e); @@ -1226,9 +1213,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await arbitrumDataService.getExchangeSupportedAssets({ page: 1, @@ -1239,7 +1223,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1266,11 +1250,11 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_6) - assert.fail(message.fail_exchangeOffers_6) + addContext(test, message.fail_exchangeOffers_6); + assert.fail(message.fail_exchangeOffers_6); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_exchangeOffers_8) + addContext(test, message.vali_exchangeOffers_8); console.log(message.vali_exchangeOffers_8); } else { console.error(e); @@ -1290,9 +1274,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await arbitrumDataService.getExchangeSupportedAssets({ page: 1, @@ -1303,7 +1284,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1330,11 +1311,11 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_7) - assert.fail(message.fail_exchangeOffers_7) + addContext(test, message.fail_exchangeOffers_7); + assert.fail(message.fail_exchangeOffers_7); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_exchangeOffers_9) + addContext(test, message.vali_exchangeOffers_9); console.log(message.vali_exchangeOffers_9); } else { console.error(e); @@ -1354,9 +1335,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await arbitrumDataService.getExchangeSupportedAssets({ page: 1, @@ -1367,7 +1345,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1393,12 +1371,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi // without fromAmount }); - addContext(test, message.fail_exchangeOffers_9) - assert.fail(message.fail_exchangeOffers_9) + addContext(test, message.fail_exchangeOffers_9); + assert.fail(message.fail_exchangeOffers_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.IsBigNumberish === constant.invalid_bignumber_2) { - addContext(test, message.vali_exchangeOffers_11) + if ( + errorResponse[0].constraints.IsBigNumberish === + constant.invalid_bignumber_2 + ) { + addContext(test, message.vali_exchangeOffers_11); console.log(message.vali_exchangeOffers_11); } else { console.error(e); @@ -1417,9 +1398,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1432,12 +1410,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_2) + addContext(test, message.fail_crossChainQuotes_2); assert.fail(message.fail_crossChainQuotes_2); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_1) { - addContext(test, message.vali_crossChainQuotes_2) + addContext(test, message.vali_crossChainQuotes_2); console.log(message.vali_crossChainQuotes_2); } else { console.error(e); @@ -1456,9 +1434,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1471,12 +1446,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_3) - assert.fail(message.fail_crossChainQuotes_3) + addContext(test, message.fail_crossChainQuotes_3); + assert.fail(message.fail_crossChainQuotes_3); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_2) { - addContext(test, message.vali_crossChainQuotes_3) + addContext(test, message.vali_crossChainQuotes_3); console.log(message.vali_crossChainQuotes_3); } else { console.error(e); @@ -1495,9 +1470,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1511,12 +1483,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_4) - assert.fail(message.fail_crossChainQuotes_4) + addContext(test, message.fail_crossChainQuotes_4); + assert.fail(message.fail_crossChainQuotes_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_4); console.log(message.vali_crossChainQuotes_4); } else { console.error(e); @@ -1535,9 +1510,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1551,12 +1523,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_5) - assert.fail(message.fail_crossChainQuotes_5) + addContext(test, message.fail_crossChainQuotes_5); + assert.fail(message.fail_crossChainQuotes_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_5); console.log(message.vali_crossChainQuotes_5); } else { console.error(e); @@ -1575,9 +1550,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1590,12 +1562,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_6) - assert.fail(message.fail_crossChainQuotes_6) + addContext(test, message.fail_crossChainQuotes_6); + assert.fail(message.fail_crossChainQuotes_6); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_6); console.log(message.vali_crossChainQuotes_6); } else { console.error(e); @@ -1614,9 +1589,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1630,12 +1602,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_7) - assert.fail(message.fail_crossChainQuotes_7) + addContext(test, message.fail_crossChainQuotes_7); + assert.fail(message.fail_crossChainQuotes_7); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_7); console.log(message.vali_crossChainQuotes_7); } else { console.error(e); @@ -1654,9 +1629,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1670,12 +1642,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_8) - assert.fail(message.fail_crossChainQuotes_8) + addContext(test, message.fail_crossChainQuotes_8); + assert.fail(message.fail_crossChainQuotes_8); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_8) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_8); console.log(message.vali_crossChainQuotes_8); } else { console.error(e); @@ -1694,9 +1669,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1709,12 +1681,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_9) - assert.fail(message.fail_crossChainQuotes_9) + addContext(test, message.fail_crossChainQuotes_9); + assert.fail(message.fail_crossChainQuotes_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_9) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_9); console.log(message.vali_crossChainQuotes_9); } else { console.error(e); @@ -1733,9 +1708,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1749,12 +1721,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_10) + addContext(test, message.fail_crossChainQuotes_10); assert.fail(message.fail_crossChainQuotes_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_10) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_10); assert.fail(message.vali_crossChainQuotes_10); } else { console.error(e); @@ -1773,9 +1748,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1789,18 +1761,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_11) + addContext(test, message.fail_crossChainQuotes_11); assert.fail(message.fail_crossChainQuotes_11); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_11) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_11); assert.fail(message.vali_crossChainQuotes_11); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - addContext(test, message.fail_crossChainQuotes_12) + addContext(test, message.fail_crossChainQuotes_12); assert.fail(message.fail_crossChainQuotes_11); } } @@ -1814,9 +1789,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1829,12 +1801,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_12) + addContext(test, message.fail_crossChainQuotes_12); assert.fail(message.fail_crossChainQuotes_12); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_12) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_12); console.log(message.vali_crossChainQuotes_12); } else { console.error(e); @@ -1853,9 +1828,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1868,12 +1840,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_2) - assert.fail(fail_advanceRoutesLiFi_2) + addContext(test, fail_advanceRoutesLiFi_2); + assert.fail(fail_advanceRoutesLiFi_2); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_1) { - addContext(test, message.vali_advanceRoutesLiFi_2) + addContext(test, message.vali_advanceRoutesLiFi_2); console.log(message.vali_advanceRoutesLiFi_2); } else { console.error(e); @@ -1892,9 +1864,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1907,18 +1876,18 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_3) - assert.fail(fail_advanceRoutesLiFi_3) + addContext(test, fail_advanceRoutesLiFi_3); + assert.fail(fail_advanceRoutesLiFi_3); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_2) { - addContext(test, message.vali_advanceRoutesLifi_3) + addContext(test, message.vali_advanceRoutesLifi_3); console.log(message.vali_advanceRoutesLifi_3); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_3) + assert.fail(fail_advanceRoutesLiFi_3); } } }, data.retry); // Retry this async test up to 5 times @@ -1931,9 +1900,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1947,18 +1913,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_4) - assert.fail(fail_advanceRoutesLiFi_4) + addContext(test, fail_advanceRoutesLiFi_4); + assert.fail(fail_advanceRoutesLiFi_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_4); console.log(message.vali_advanceRoutesLifi_4); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_4) + assert.fail(fail_advanceRoutesLiFi_4); } } }, data.retry); // Retry this async test up to 5 times @@ -1971,9 +1940,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1987,18 +1953,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_5) - assert.fail(fail_advanceRoutesLiFi_5) + addContext(test, fail_advanceRoutesLiFi_5); + assert.fail(fail_advanceRoutesLiFi_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_5); console.log(message.vali_advanceRoutesLifi_5); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_5) + assert.fail(fail_advanceRoutesLiFi_5); } } }, data.retry); // Retry this async test up to 5 times @@ -2011,9 +1980,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2026,18 +1992,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_6) - assert.fail(fail_advanceRoutesLiFi_6) + addContext(test, fail_advanceRoutesLiFi_6); + assert.fail(fail_advanceRoutesLiFi_6); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_6); console.log(message.vali_advanceRoutesLifi_6); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_6) + assert.fail(fail_advanceRoutesLiFi_6); } } }, data.retry); // Retry this async test up to 5 times @@ -2050,9 +2019,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2066,18 +2032,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_7) - assert.fail(fail_advanceRoutesLiFi_7) + addContext(test, fail_advanceRoutesLiFi_7); + assert.fail(fail_advanceRoutesLiFi_7); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_7); console.log(message.vali_advanceRoutesLifi_7); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_7) + assert.fail(fail_advanceRoutesLiFi_7); } } }, data.retry); // Retry this async test up to 5 times @@ -2090,9 +2059,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2106,18 +2072,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_8) - assert.fail(fail_advanceRoutesLiFi_8) + addContext(test, fail_advanceRoutesLiFi_8); + assert.fail(fail_advanceRoutesLiFi_8); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_8) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_8); console.log(message.vali_advanceRoutesLifi_8); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_8) + assert.fail(fail_advanceRoutesLiFi_8); } } }, data.retry); // Retry this async test up to 5 times @@ -2130,9 +2099,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2145,18 +2111,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_9) - assert.fail(fail_advanceRoutesLiFi_9) + addContext(test, fail_advanceRoutesLiFi_9); + assert.fail(fail_advanceRoutesLiFi_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_9) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_9); console.log(message.vali_advanceRoutesLifi_9); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_9) + assert.fail(fail_advanceRoutesLiFi_9); } } }, data.retry); // Retry this async test up to 5 times @@ -2169,9 +2138,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2184,18 +2150,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await arbitrumDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_10) - assert.fail(fail_advanceRoutesLiFi_10) + addContext(test, fail_advanceRoutesLiFi_10); + assert.fail(fail_advanceRoutesLiFi_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.IsBigNumberish === constant.invalid_bignumber_3) { - addContext(test, message.vali_advanceRoutesLifi_10) + if ( + errorResponse[0].constraints.IsBigNumberish === + constant.invalid_bignumber_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_10); console.log(message.vali_advanceRoutesLifi_10); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_10) + assert.fail(fail_advanceRoutesLiFi_10); } } }, data.retry); // Retry this async test up to 5 times diff --git a/test/specs/mainnet/swap/matic.spec.js b/test/specs/mainnet/swap/matic.spec.js index 229ac57..4445301 100644 --- a/test/specs/mainnet/swap/matic.spec.js +++ b/test/specs/mainnet/swap/matic.spec.js @@ -21,17 +21,17 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { maticMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -61,7 +61,8 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi assert.strictEqual( maticEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -76,9 +77,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi // initializating Data service... try { - maticDataService = new DataUtils( - process.env.DATA_API_KEY - ); + maticDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -130,9 +129,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await maticDataService.getExchangeSupportedAssets({ page: 1, @@ -143,7 +139,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { @@ -253,7 +249,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( offers[i].receiveAmount, - message.vali_exchangeOffers_receiveAmount, + message.vali_exchangeOffers_receiveAmount ); } catch (e) { console.error(e); @@ -304,9 +300,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await maticDataService.getExchangeSupportedAssets({ page: 1, @@ -317,13 +310,13 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { assert.isNotEmpty( exchangeSupportedAssets.items[0].address, - message.vali_exchangeOffers_address, + message.vali_exchangeOffers_address ); } catch (e) { console.error(e); @@ -334,7 +327,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNumber( exchangeSupportedAssets.items[0].chainId, - message.vali_exchangeOffers_chainId, + message.vali_exchangeOffers_chainId ); } catch (e) { console.error(e); @@ -345,7 +338,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( exchangeSupportedAssets.items[0].name, - message.vali_exchangeOffers_name, + message.vali_exchangeOffers_name ); } catch (e) { console.error(e); @@ -416,7 +409,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( offers[i].provider, - message.vali_exchangeOffers_provider, + message.vali_exchangeOffers_provider ); } catch (e) { console.error(e); @@ -477,9 +470,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; let quotes; try { @@ -499,7 +489,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].provider, - message.vali_crossChainQuotes_provider, + message.vali_crossChainQuotes_provider ); } catch (e) { console.error(e); @@ -510,7 +500,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].transaction.data, - message.vali_crossChainQuotes_data, + message.vali_crossChainQuotes_data ); } catch (e) { console.error(e); @@ -562,7 +552,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi addContext(test, eString); } } else { - addContext(test, message.vali_crossChainQuotes_1) + addContext(test, message.vali_crossChainQuotes_1); console.log(message.vali_crossChainQuotes_1); } } catch (e) { @@ -581,9 +571,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; let quotes; let stepTransaction; @@ -610,7 +597,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].id, - message.vali_advanceRoutesLiFi_id, + message.vali_advanceRoutesLiFi_id ); } catch (e) { console.error(e); @@ -621,7 +608,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNumber( quotes.items[0].fromChainId, - message.vali_advanceRoutesLiFi_fromChainId, + message.vali_advanceRoutesLiFi_fromChainId ); } catch (e) { console.error(e); @@ -654,7 +641,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].fromToken, - message.vali_advanceRoutesLiFi_fromToken, + message.vali_advanceRoutesLiFi_fromToken ); } catch (e) { console.error(e); @@ -753,7 +740,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( stepTransaction.items[0].data, - message.vali_stepTransaction_data, + message.vali_stepTransaction_data ); } catch (e) { console.error(e); @@ -764,7 +751,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( stepTransaction.items[0].value, - message.vali_stepTransaction_value, + message.vali_stepTransaction_value ); } catch (e) { console.error(e); @@ -902,9 +889,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await maticDataService.getExchangeSupportedAssets({ page: 1, @@ -915,13 +899,13 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { assert.isNotEmpty( exchangeSupportedAssets.items[0].address, - message.vali_exchangeOffers_address, + message.vali_exchangeOffers_address ); } catch (e) { console.error(e); @@ -1008,12 +992,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_2) - assert.fail(message.fail_exchangeOffers_2) + addContext(test, message.fail_exchangeOffers_2); + assert.fail(message.fail_exchangeOffers_2); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_exchangeOffers_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_exchangeOffers_4); console.log(message.vali_exchangeOffers_4); } else { console.error(e); @@ -1033,9 +1020,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await maticDataService.getExchangeSupportedAssets({ page: 1, @@ -1046,7 +1030,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1072,12 +1056,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_3) - assert.fail(message.fail_exchangeOffers_3) + addContext(test, message.fail_exchangeOffers_3); + assert.fail(message.fail_exchangeOffers_3); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_exchangeOffers_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_exchangeOffers_5); console.log(message.vali_exchangeOffers_5); } else { console.error(e); @@ -1097,9 +1084,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await maticDataService.getExchangeSupportedAssets({ page: 1, @@ -1110,7 +1094,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1137,12 +1121,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_4) - assert.fail(message.fail_exchangeOffers_4) + addContext(test, message.fail_exchangeOffers_4); + assert.fail(message.fail_exchangeOffers_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_exchangeOffers_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_exchangeOffers_6); console.log(message.vali_exchangeOffers_6); } else { console.error(e); @@ -1162,9 +1149,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await maticDataService.getExchangeSupportedAssets({ page: 1, @@ -1175,7 +1159,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1201,12 +1185,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_5) - assert.fail(message.fail_exchangeOffers_5) + addContext(test, message.fail_exchangeOffers_5); + assert.fail(message.fail_exchangeOffers_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_exchangeOffers_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_exchangeOffers_7); console.log(message.vali_exchangeOffers_7); } else { console.error(e); @@ -1226,9 +1213,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await maticDataService.getExchangeSupportedAssets({ page: 1, @@ -1239,7 +1223,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1266,11 +1250,11 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_6) - assert.fail(message.fail_exchangeOffers_6) + addContext(test, message.fail_exchangeOffers_6); + assert.fail(message.fail_exchangeOffers_6); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_exchangeOffers_8) + addContext(test, message.vali_exchangeOffers_8); console.log(message.vali_exchangeOffers_8); } else { console.error(e); @@ -1290,9 +1274,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await maticDataService.getExchangeSupportedAssets({ page: 1, @@ -1303,7 +1284,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1330,11 +1311,11 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_7) - assert.fail(message.fail_exchangeOffers_7) + addContext(test, message.fail_exchangeOffers_7); + assert.fail(message.fail_exchangeOffers_7); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_exchangeOffers_9) + addContext(test, message.vali_exchangeOffers_9); console.log(message.vali_exchangeOffers_9); } else { console.error(e); @@ -1354,9 +1335,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await maticDataService.getExchangeSupportedAssets({ page: 1, @@ -1367,7 +1345,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1393,12 +1371,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi // without fromAmount }); - addContext(test, message.fail_exchangeOffers_9) - assert.fail(message.fail_exchangeOffers_9) + addContext(test, message.fail_exchangeOffers_9); + assert.fail(message.fail_exchangeOffers_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.IsBigNumberish === constant.invalid_bignumber_2) { - addContext(test, message.vali_exchangeOffers_11) + if ( + errorResponse[0].constraints.IsBigNumberish === + constant.invalid_bignumber_2 + ) { + addContext(test, message.vali_exchangeOffers_11); console.log(message.vali_exchangeOffers_11); } else { console.error(e); @@ -1417,9 +1398,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1432,12 +1410,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_2) + addContext(test, message.fail_crossChainQuotes_2); assert.fail(message.fail_crossChainQuotes_2); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_1) { - addContext(test, message.vali_crossChainQuotes_2) + addContext(test, message.vali_crossChainQuotes_2); console.log(message.vali_crossChainQuotes_2); } else { console.error(e); @@ -1456,9 +1434,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1471,12 +1446,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_3) - assert.fail(message.fail_crossChainQuotes_3) + addContext(test, message.fail_crossChainQuotes_3); + assert.fail(message.fail_crossChainQuotes_3); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_2) { - addContext(test, message.vali_crossChainQuotes_3) + addContext(test, message.vali_crossChainQuotes_3); console.log(message.vali_crossChainQuotes_3); } else { console.error(e); @@ -1495,9 +1470,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1511,12 +1483,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_4) - assert.fail(message.fail_crossChainQuotes_4) + addContext(test, message.fail_crossChainQuotes_4); + assert.fail(message.fail_crossChainQuotes_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_4); console.log(message.vali_crossChainQuotes_4); } else { console.error(e); @@ -1535,9 +1510,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1551,12 +1523,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_5) - assert.fail(message.fail_crossChainQuotes_5) + addContext(test, message.fail_crossChainQuotes_5); + assert.fail(message.fail_crossChainQuotes_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_5); console.log(message.vali_crossChainQuotes_5); } else { console.error(e); @@ -1575,9 +1550,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1590,12 +1562,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_6) - assert.fail(message.fail_crossChainQuotes_6) + addContext(test, message.fail_crossChainQuotes_6); + assert.fail(message.fail_crossChainQuotes_6); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_6); console.log(message.vali_crossChainQuotes_6); } else { console.error(e); @@ -1614,9 +1589,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1630,12 +1602,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_7) - assert.fail(message.fail_crossChainQuotes_7) + addContext(test, message.fail_crossChainQuotes_7); + assert.fail(message.fail_crossChainQuotes_7); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_7); console.log(message.vali_crossChainQuotes_7); } else { console.error(e); @@ -1654,9 +1629,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1670,12 +1642,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_8) - assert.fail(message.fail_crossChainQuotes_8) + addContext(test, message.fail_crossChainQuotes_8); + assert.fail(message.fail_crossChainQuotes_8); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_8) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_8); console.log(message.vali_crossChainQuotes_8); } else { console.error(e); @@ -1694,9 +1669,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1709,12 +1681,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_9) - assert.fail(message.fail_crossChainQuotes_9) + addContext(test, message.fail_crossChainQuotes_9); + assert.fail(message.fail_crossChainQuotes_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_9) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_9); console.log(message.vali_crossChainQuotes_9); } else { console.error(e); @@ -1733,9 +1708,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1749,12 +1721,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_10) + addContext(test, message.fail_crossChainQuotes_10); assert.fail(message.fail_crossChainQuotes_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_10) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_10); assert.fail(message.vali_crossChainQuotes_10); } else { console.error(e); @@ -1773,9 +1748,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1789,18 +1761,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_11) + addContext(test, message.fail_crossChainQuotes_11); assert.fail(message.fail_crossChainQuotes_11); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_11) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_11); assert.fail(message.vali_crossChainQuotes_11); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - addContext(test, message.fail_crossChainQuotes_12) + addContext(test, message.fail_crossChainQuotes_12); assert.fail(message.fail_crossChainQuotes_11); } } @@ -1814,9 +1789,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1829,12 +1801,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_12) + addContext(test, message.fail_crossChainQuotes_12); assert.fail(message.fail_crossChainQuotes_12); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_12) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_12); console.log(message.vali_crossChainQuotes_12); } else { console.error(e); @@ -1853,9 +1828,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1868,12 +1840,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_2) - assert.fail(fail_advanceRoutesLiFi_2) + addContext(test, fail_advanceRoutesLiFi_2); + assert.fail(fail_advanceRoutesLiFi_2); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_1) { - addContext(test, message.vali_advanceRoutesLiFi_2) + addContext(test, message.vali_advanceRoutesLiFi_2); console.log(message.vali_advanceRoutesLiFi_2); } else { console.error(e); @@ -1892,9 +1864,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1907,18 +1876,18 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_3) - assert.fail(fail_advanceRoutesLiFi_3) + addContext(test, fail_advanceRoutesLiFi_3); + assert.fail(fail_advanceRoutesLiFi_3); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_2) { - addContext(test, message.vali_advanceRoutesLifi_3) + addContext(test, message.vali_advanceRoutesLifi_3); console.log(message.vali_advanceRoutesLifi_3); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_3) + assert.fail(fail_advanceRoutesLiFi_3); } } }, data.retry); // Retry this async test up to 5 times @@ -1931,9 +1900,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1947,18 +1913,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_4) - assert.fail(fail_advanceRoutesLiFi_4) + addContext(test, fail_advanceRoutesLiFi_4); + assert.fail(fail_advanceRoutesLiFi_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_4); console.log(message.vali_advanceRoutesLifi_4); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_4) + assert.fail(fail_advanceRoutesLiFi_4); } } }, data.retry); // Retry this async test up to 5 times @@ -1971,9 +1940,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1987,18 +1953,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_5) - assert.fail(fail_advanceRoutesLiFi_5) + addContext(test, fail_advanceRoutesLiFi_5); + assert.fail(fail_advanceRoutesLiFi_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_5); console.log(message.vali_advanceRoutesLifi_5); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_5) + assert.fail(fail_advanceRoutesLiFi_5); } } }, data.retry); // Retry this async test up to 5 times @@ -2011,9 +1980,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2026,18 +1992,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_6) - assert.fail(fail_advanceRoutesLiFi_6) + addContext(test, fail_advanceRoutesLiFi_6); + assert.fail(fail_advanceRoutesLiFi_6); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_6); console.log(message.vali_advanceRoutesLifi_6); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_6) + assert.fail(fail_advanceRoutesLiFi_6); } } }, data.retry); // Retry this async test up to 5 times @@ -2050,9 +2019,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2066,18 +2032,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_7) - assert.fail(fail_advanceRoutesLiFi_7) + addContext(test, fail_advanceRoutesLiFi_7); + assert.fail(fail_advanceRoutesLiFi_7); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_7); console.log(message.vali_advanceRoutesLifi_7); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_7) + assert.fail(fail_advanceRoutesLiFi_7); } } }, data.retry); // Retry this async test up to 5 times @@ -2090,9 +2059,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2106,18 +2072,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_8) - assert.fail(fail_advanceRoutesLiFi_8) + addContext(test, fail_advanceRoutesLiFi_8); + assert.fail(fail_advanceRoutesLiFi_8); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_8) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_8); console.log(message.vali_advanceRoutesLifi_8); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_8) + assert.fail(fail_advanceRoutesLiFi_8); } } }, data.retry); // Retry this async test up to 5 times @@ -2130,9 +2099,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2145,18 +2111,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_9) - assert.fail(fail_advanceRoutesLiFi_9) + addContext(test, fail_advanceRoutesLiFi_9); + assert.fail(fail_advanceRoutesLiFi_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_9) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_9); console.log(message.vali_advanceRoutesLifi_9); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_9) + assert.fail(fail_advanceRoutesLiFi_9); } } }, data.retry); // Retry this async test up to 5 times @@ -2169,9 +2138,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2184,18 +2150,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await maticDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_10) - assert.fail(fail_advanceRoutesLiFi_10) + addContext(test, fail_advanceRoutesLiFi_10); + assert.fail(fail_advanceRoutesLiFi_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.IsBigNumberish === constant.invalid_bignumber_3) { - addContext(test, message.vali_advanceRoutesLifi_10) + if ( + errorResponse[0].constraints.IsBigNumberish === + constant.invalid_bignumber_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_10); console.log(message.vali_advanceRoutesLifi_10); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_10) + assert.fail(fail_advanceRoutesLiFi_10); } } }, data.retry); // Retry this async test up to 5 times diff --git a/test/specs/mainnet/swap/optimism.spec.js b/test/specs/mainnet/swap/optimism.spec.js index 66ec65a..a9f1b9e 100644 --- a/test/specs/mainnet/swap/optimism.spec.js +++ b/test/specs/mainnet/swap/optimism.spec.js @@ -21,17 +21,17 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { optimismMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -61,7 +61,8 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi assert.strictEqual( optimismEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -76,9 +77,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi // initializating Data service... try { - optimismDataService = new DataUtils( - process.env.DATA_API_KEY - ); + optimismDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -130,9 +129,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await optimismDataService.getExchangeSupportedAssets({ page: 1, @@ -143,7 +139,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { @@ -253,7 +249,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( offers[i].receiveAmount, - message.vali_exchangeOffers_receiveAmount, + message.vali_exchangeOffers_receiveAmount ); } catch (e) { console.error(e); @@ -304,9 +300,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await optimismDataService.getExchangeSupportedAssets({ page: 1, @@ -317,13 +310,13 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { assert.isNotEmpty( exchangeSupportedAssets.items[0].address, - message.vali_exchangeOffers_address, + message.vali_exchangeOffers_address ); } catch (e) { console.error(e); @@ -334,7 +327,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNumber( exchangeSupportedAssets.items[0].chainId, - message.vali_exchangeOffers_chainId, + message.vali_exchangeOffers_chainId ); } catch (e) { console.error(e); @@ -345,7 +338,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( exchangeSupportedAssets.items[0].name, - message.vali_exchangeOffers_name, + message.vali_exchangeOffers_name ); } catch (e) { console.error(e); @@ -416,7 +409,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( offers[i].provider, - message.vali_exchangeOffers_provider, + message.vali_exchangeOffers_provider ); } catch (e) { console.error(e); @@ -477,9 +470,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; let quotes; try { @@ -499,7 +489,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].provider, - message.vali_crossChainQuotes_provider, + message.vali_crossChainQuotes_provider ); } catch (e) { console.error(e); @@ -510,7 +500,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].transaction.data, - message.vali_crossChainQuotes_data, + message.vali_crossChainQuotes_data ); } catch (e) { console.error(e); @@ -562,7 +552,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi addContext(test, eString); } } else { - addContext(test, message.vali_crossChainQuotes_1) + addContext(test, message.vali_crossChainQuotes_1); console.log(message.vali_crossChainQuotes_1); } } catch (e) { @@ -581,9 +571,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; let quotes; let stepTransaction; @@ -610,7 +597,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].id, - message.vali_advanceRoutesLiFi_id, + message.vali_advanceRoutesLiFi_id ); } catch (e) { console.error(e); @@ -621,7 +608,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNumber( quotes.items[0].fromChainId, - message.vali_advanceRoutesLiFi_fromChainId, + message.vali_advanceRoutesLiFi_fromChainId ); } catch (e) { console.error(e); @@ -654,7 +641,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].fromToken, - message.vali_advanceRoutesLiFi_fromToken, + message.vali_advanceRoutesLiFi_fromToken ); } catch (e) { console.error(e); @@ -753,7 +740,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( stepTransaction.items[0].data, - message.vali_stepTransaction_data, + message.vali_stepTransaction_data ); } catch (e) { console.error(e); @@ -764,7 +751,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( stepTransaction.items[0].value, - message.vali_stepTransaction_value, + message.vali_stepTransaction_value ); } catch (e) { console.error(e); @@ -902,9 +889,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await optimismDataService.getExchangeSupportedAssets({ page: 1, @@ -915,13 +899,13 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { assert.isNotEmpty( exchangeSupportedAssets.items[0].address, - message.vali_exchangeOffers_address, + message.vali_exchangeOffers_address ); } catch (e) { console.error(e); @@ -1008,12 +992,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_2) - assert.fail(message.fail_exchangeOffers_2) + addContext(test, message.fail_exchangeOffers_2); + assert.fail(message.fail_exchangeOffers_2); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_exchangeOffers_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_exchangeOffers_4); console.log(message.vali_exchangeOffers_4); } else { console.error(e); @@ -1033,9 +1020,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await optimismDataService.getExchangeSupportedAssets({ page: 1, @@ -1046,7 +1030,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1072,12 +1056,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_3) - assert.fail(message.fail_exchangeOffers_3) + addContext(test, message.fail_exchangeOffers_3); + assert.fail(message.fail_exchangeOffers_3); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_exchangeOffers_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_exchangeOffers_5); console.log(message.vali_exchangeOffers_5); } else { console.error(e); @@ -1097,9 +1084,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await optimismDataService.getExchangeSupportedAssets({ page: 1, @@ -1110,7 +1094,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1137,12 +1121,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_4) - assert.fail(message.fail_exchangeOffers_4) + addContext(test, message.fail_exchangeOffers_4); + assert.fail(message.fail_exchangeOffers_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_exchangeOffers_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_exchangeOffers_6); console.log(message.vali_exchangeOffers_6); } else { console.error(e); @@ -1162,9 +1149,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await optimismDataService.getExchangeSupportedAssets({ page: 1, @@ -1175,7 +1159,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1201,12 +1185,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_5) - assert.fail(message.fail_exchangeOffers_5) + addContext(test, message.fail_exchangeOffers_5); + assert.fail(message.fail_exchangeOffers_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_exchangeOffers_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_exchangeOffers_7); console.log(message.vali_exchangeOffers_7); } else { console.error(e); @@ -1226,9 +1213,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await optimismDataService.getExchangeSupportedAssets({ page: 1, @@ -1239,7 +1223,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1266,11 +1250,11 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_6) - assert.fail(message.fail_exchangeOffers_6) + addContext(test, message.fail_exchangeOffers_6); + assert.fail(message.fail_exchangeOffers_6); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_exchangeOffers_8) + addContext(test, message.vali_exchangeOffers_8); console.log(message.vali_exchangeOffers_8); } else { console.error(e); @@ -1290,9 +1274,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await optimismDataService.getExchangeSupportedAssets({ page: 1, @@ -1303,7 +1284,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1330,11 +1311,11 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_7) - assert.fail(message.fail_exchangeOffers_7) + addContext(test, message.fail_exchangeOffers_7); + assert.fail(message.fail_exchangeOffers_7); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_exchangeOffers_9) + addContext(test, message.vali_exchangeOffers_9); console.log(message.vali_exchangeOffers_9); } else { console.error(e); @@ -1354,9 +1335,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await optimismDataService.getExchangeSupportedAssets({ page: 1, @@ -1367,7 +1345,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1393,12 +1371,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi // without fromAmount }); - addContext(test, message.fail_exchangeOffers_9) - assert.fail(message.fail_exchangeOffers_9) + addContext(test, message.fail_exchangeOffers_9); + assert.fail(message.fail_exchangeOffers_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.IsBigNumberish === constant.invalid_bignumber_2) { - addContext(test, message.vali_exchangeOffers_11) + if ( + errorResponse[0].constraints.IsBigNumberish === + constant.invalid_bignumber_2 + ) { + addContext(test, message.vali_exchangeOffers_11); console.log(message.vali_exchangeOffers_11); } else { console.error(e); @@ -1417,9 +1398,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1432,12 +1410,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_2) + addContext(test, message.fail_crossChainQuotes_2); assert.fail(message.fail_crossChainQuotes_2); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_1) { - addContext(test, message.vali_crossChainQuotes_2) + addContext(test, message.vali_crossChainQuotes_2); console.log(message.vali_crossChainQuotes_2); } else { console.error(e); @@ -1456,9 +1434,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1471,12 +1446,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_3) - assert.fail(message.fail_crossChainQuotes_3) + addContext(test, message.fail_crossChainQuotes_3); + assert.fail(message.fail_crossChainQuotes_3); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_2) { - addContext(test, message.vali_crossChainQuotes_3) + addContext(test, message.vali_crossChainQuotes_3); console.log(message.vali_crossChainQuotes_3); } else { console.error(e); @@ -1495,9 +1470,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1511,12 +1483,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_4) - assert.fail(message.fail_crossChainQuotes_4) + addContext(test, message.fail_crossChainQuotes_4); + assert.fail(message.fail_crossChainQuotes_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_4); console.log(message.vali_crossChainQuotes_4); } else { console.error(e); @@ -1535,9 +1510,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1551,12 +1523,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_5) - assert.fail(message.fail_crossChainQuotes_5) + addContext(test, message.fail_crossChainQuotes_5); + assert.fail(message.fail_crossChainQuotes_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_5); console.log(message.vali_crossChainQuotes_5); } else { console.error(e); @@ -1575,9 +1550,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1590,12 +1562,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_6) - assert.fail(message.fail_crossChainQuotes_6) + addContext(test, message.fail_crossChainQuotes_6); + assert.fail(message.fail_crossChainQuotes_6); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_6); console.log(message.vali_crossChainQuotes_6); } else { console.error(e); @@ -1614,9 +1589,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1630,12 +1602,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_7) - assert.fail(message.fail_crossChainQuotes_7) + addContext(test, message.fail_crossChainQuotes_7); + assert.fail(message.fail_crossChainQuotes_7); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_7); console.log(message.vali_crossChainQuotes_7); } else { console.error(e); @@ -1654,9 +1629,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1670,12 +1642,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_8) - assert.fail(message.fail_crossChainQuotes_8) + addContext(test, message.fail_crossChainQuotes_8); + assert.fail(message.fail_crossChainQuotes_8); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_8) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_8); console.log(message.vali_crossChainQuotes_8); } else { console.error(e); @@ -1694,9 +1669,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1709,12 +1681,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_9) - assert.fail(message.fail_crossChainQuotes_9) + addContext(test, message.fail_crossChainQuotes_9); + assert.fail(message.fail_crossChainQuotes_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_9) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_9); console.log(message.vali_crossChainQuotes_9); } else { console.error(e); @@ -1733,9 +1708,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1749,12 +1721,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_10) + addContext(test, message.fail_crossChainQuotes_10); assert.fail(message.fail_crossChainQuotes_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_10) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_10); assert.fail(message.vali_crossChainQuotes_10); } else { console.error(e); @@ -1773,9 +1748,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1789,18 +1761,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_11) + addContext(test, message.fail_crossChainQuotes_11); assert.fail(message.fail_crossChainQuotes_11); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_11) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_11); assert.fail(message.vali_crossChainQuotes_11); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - addContext(test, message.fail_crossChainQuotes_12) + addContext(test, message.fail_crossChainQuotes_12); assert.fail(message.fail_crossChainQuotes_11); } } @@ -1814,9 +1789,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1829,12 +1801,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_12) + addContext(test, message.fail_crossChainQuotes_12); assert.fail(message.fail_crossChainQuotes_12); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_12) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_12); console.log(message.vali_crossChainQuotes_12); } else { console.error(e); @@ -1853,9 +1828,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1868,12 +1840,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_2) - assert.fail(fail_advanceRoutesLiFi_2) + addContext(test, fail_advanceRoutesLiFi_2); + assert.fail(fail_advanceRoutesLiFi_2); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_1) { - addContext(test, message.vali_advanceRoutesLiFi_2) + addContext(test, message.vali_advanceRoutesLiFi_2); console.log(message.vali_advanceRoutesLiFi_2); } else { console.error(e); @@ -1892,9 +1864,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1907,18 +1876,18 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_3) - assert.fail(fail_advanceRoutesLiFi_3) + addContext(test, fail_advanceRoutesLiFi_3); + assert.fail(fail_advanceRoutesLiFi_3); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_2) { - addContext(test, message.vali_advanceRoutesLifi_3) + addContext(test, message.vali_advanceRoutesLifi_3); console.log(message.vali_advanceRoutesLifi_3); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_3) + assert.fail(fail_advanceRoutesLiFi_3); } } }, data.retry); // Retry this async test up to 5 times @@ -1931,9 +1900,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1947,18 +1913,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_4) - assert.fail(fail_advanceRoutesLiFi_4) + addContext(test, fail_advanceRoutesLiFi_4); + assert.fail(fail_advanceRoutesLiFi_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_4); console.log(message.vali_advanceRoutesLifi_4); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_4) + assert.fail(fail_advanceRoutesLiFi_4); } } }, data.retry); // Retry this async test up to 5 times @@ -1971,9 +1940,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1987,18 +1953,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_5) - assert.fail(fail_advanceRoutesLiFi_5) + addContext(test, fail_advanceRoutesLiFi_5); + assert.fail(fail_advanceRoutesLiFi_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_5); console.log(message.vali_advanceRoutesLifi_5); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_5) + assert.fail(fail_advanceRoutesLiFi_5); } } }, data.retry); // Retry this async test up to 5 times @@ -2011,9 +1980,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2026,18 +1992,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_6) - assert.fail(fail_advanceRoutesLiFi_6) + addContext(test, fail_advanceRoutesLiFi_6); + assert.fail(fail_advanceRoutesLiFi_6); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_6); console.log(message.vali_advanceRoutesLifi_6); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_6) + assert.fail(fail_advanceRoutesLiFi_6); } } }, data.retry); // Retry this async test up to 5 times @@ -2050,9 +2019,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2066,18 +2032,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_7) - assert.fail(fail_advanceRoutesLiFi_7) + addContext(test, fail_advanceRoutesLiFi_7); + assert.fail(fail_advanceRoutesLiFi_7); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_7); console.log(message.vali_advanceRoutesLifi_7); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_7) + assert.fail(fail_advanceRoutesLiFi_7); } } }, data.retry); // Retry this async test up to 5 times @@ -2090,9 +2059,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2106,18 +2072,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_8) - assert.fail(fail_advanceRoutesLiFi_8) + addContext(test, fail_advanceRoutesLiFi_8); + assert.fail(fail_advanceRoutesLiFi_8); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_8) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_8); console.log(message.vali_advanceRoutesLifi_8); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_8) + assert.fail(fail_advanceRoutesLiFi_8); } } }, data.retry); // Retry this async test up to 5 times @@ -2130,9 +2099,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2145,18 +2111,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_9) - assert.fail(fail_advanceRoutesLiFi_9) + addContext(test, fail_advanceRoutesLiFi_9); + assert.fail(fail_advanceRoutesLiFi_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_9) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_9); console.log(message.vali_advanceRoutesLifi_9); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_9) + assert.fail(fail_advanceRoutesLiFi_9); } } }, data.retry); // Retry this async test up to 5 times @@ -2169,9 +2138,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2184,18 +2150,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await optimismDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_10) - assert.fail(fail_advanceRoutesLiFi_10) + addContext(test, fail_advanceRoutesLiFi_10); + assert.fail(fail_advanceRoutesLiFi_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.IsBigNumberish === constant.invalid_bignumber_3) { - addContext(test, message.vali_advanceRoutesLifi_10) + if ( + errorResponse[0].constraints.IsBigNumberish === + constant.invalid_bignumber_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_10); console.log(message.vali_advanceRoutesLifi_10); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_10) + assert.fail(fail_advanceRoutesLiFi_10); } } }, data.retry); // Retry this async test up to 5 times diff --git a/test/specs/mainnet/swap/xdai.spec.js b/test/specs/mainnet/swap/xdai.spec.js index 19c01ac..6242f35 100644 --- a/test/specs/mainnet/swap/xdai.spec.js +++ b/test/specs/mainnet/swap/xdai.spec.js @@ -21,17 +21,17 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { xdaiMainNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.xdai_chainid), - bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.xdai_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { @@ -61,7 +61,8 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi assert.strictEqual( xdaiEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -76,9 +77,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi // initializating Data service... try { - xdaiDataService = new DataUtils( - process.env.DATA_API_KEY - ); + xdaiDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -130,9 +129,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await xdaiDataService.getExchangeSupportedAssets({ page: 1, @@ -143,7 +139,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { @@ -253,7 +249,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( offers[i].receiveAmount, - message.vali_exchangeOffers_receiveAmount, + message.vali_exchangeOffers_receiveAmount ); } catch (e) { console.error(e); @@ -304,9 +300,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await xdaiDataService.getExchangeSupportedAssets({ page: 1, @@ -317,13 +310,13 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { assert.isNotEmpty( exchangeSupportedAssets.items[0].address, - message.vali_exchangeOffers_address, + message.vali_exchangeOffers_address ); } catch (e) { console.error(e); @@ -334,7 +327,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNumber( exchangeSupportedAssets.items[0].chainId, - message.vali_exchangeOffers_chainId, + message.vali_exchangeOffers_chainId ); } catch (e) { console.error(e); @@ -345,7 +338,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( exchangeSupportedAssets.items[0].name, - message.vali_exchangeOffers_name, + message.vali_exchangeOffers_name ); } catch (e) { console.error(e); @@ -416,7 +409,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( offers[i].provider, - message.vali_exchangeOffers_provider, + message.vali_exchangeOffers_provider ); } catch (e) { console.error(e); @@ -477,9 +470,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; let quotes; try { @@ -499,7 +489,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].provider, - message.vali_crossChainQuotes_provider, + message.vali_crossChainQuotes_provider ); } catch (e) { console.error(e); @@ -510,7 +500,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].transaction.data, - message.vali_crossChainQuotes_data, + message.vali_crossChainQuotes_data ); } catch (e) { console.error(e); @@ -562,7 +552,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi addContext(test, eString); } } else { - addContext(test, message.vali_crossChainQuotes_1) + addContext(test, message.vali_crossChainQuotes_1); console.log(message.vali_crossChainQuotes_1); } } catch (e) { @@ -581,9 +571,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; let quotes; let stepTransaction; @@ -610,7 +597,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].id, - message.vali_advanceRoutesLiFi_id, + message.vali_advanceRoutesLiFi_id ); } catch (e) { console.error(e); @@ -621,7 +608,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNumber( quotes.items[0].fromChainId, - message.vali_advanceRoutesLiFi_fromChainId, + message.vali_advanceRoutesLiFi_fromChainId ); } catch (e) { console.error(e); @@ -654,7 +641,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( quotes.items[0].fromToken, - message.vali_advanceRoutesLiFi_fromToken, + message.vali_advanceRoutesLiFi_fromToken ); } catch (e) { console.error(e); @@ -753,7 +740,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( stepTransaction.items[0].data, - message.vali_stepTransaction_data, + message.vali_stepTransaction_data ); } catch (e) { console.error(e); @@ -764,7 +751,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { assert.isNotEmpty( stepTransaction.items[0].value, - message.vali_stepTransaction_value, + message.vali_stepTransaction_value ); } catch (e) { console.error(e); @@ -902,9 +889,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await xdaiDataService.getExchangeSupportedAssets({ page: 1, @@ -915,13 +899,13 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); try { assert.isNotEmpty( exchangeSupportedAssets.items[0].address, - message.vali_exchangeOffers_address, + message.vali_exchangeOffers_address ); } catch (e) { console.error(e); @@ -1008,12 +992,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_2) - assert.fail(message.fail_exchangeOffers_2) + addContext(test, message.fail_exchangeOffers_2); + assert.fail(message.fail_exchangeOffers_2); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_exchangeOffers_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_exchangeOffers_4); console.log(message.vali_exchangeOffers_4); } else { console.error(e); @@ -1033,9 +1020,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await xdaiDataService.getExchangeSupportedAssets({ page: 1, @@ -1046,7 +1030,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1072,12 +1056,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_3) - assert.fail(message.fail_exchangeOffers_3) + addContext(test, message.fail_exchangeOffers_3); + assert.fail(message.fail_exchangeOffers_3); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_exchangeOffers_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_exchangeOffers_5); console.log(message.vali_exchangeOffers_5); } else { console.error(e); @@ -1097,9 +1084,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await xdaiDataService.getExchangeSupportedAssets({ page: 1, @@ -1110,7 +1094,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1137,12 +1121,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_4) - assert.fail(message.fail_exchangeOffers_4) + addContext(test, message.fail_exchangeOffers_4); + assert.fail(message.fail_exchangeOffers_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_exchangeOffers_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_exchangeOffers_6); console.log(message.vali_exchangeOffers_6); } else { console.error(e); @@ -1162,9 +1149,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await xdaiDataService.getExchangeSupportedAssets({ page: 1, @@ -1175,7 +1159,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1201,12 +1185,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_5) - assert.fail(message.fail_exchangeOffers_5) + addContext(test, message.fail_exchangeOffers_5); + assert.fail(message.fail_exchangeOffers_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_exchangeOffers_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_exchangeOffers_7); console.log(message.vali_exchangeOffers_7); } else { console.error(e); @@ -1226,9 +1213,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await xdaiDataService.getExchangeSupportedAssets({ page: 1, @@ -1239,7 +1223,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1266,11 +1250,11 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_6) - assert.fail(message.fail_exchangeOffers_6) + addContext(test, message.fail_exchangeOffers_6); + assert.fail(message.fail_exchangeOffers_6); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_exchangeOffers_8) + addContext(test, message.vali_exchangeOffers_8); console.log(message.vali_exchangeOffers_8); } else { console.error(e); @@ -1290,9 +1274,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await xdaiDataService.getExchangeSupportedAssets({ page: 1, @@ -1303,7 +1284,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1330,11 +1311,11 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi fromAmount: BigNumber.from(fromAmount), }); - addContext(test, message.fail_exchangeOffers_7) - assert.fail(message.fail_exchangeOffers_7) + addContext(test, message.fail_exchangeOffers_7); + assert.fail(message.fail_exchangeOffers_7); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_exchangeOffers_9) + addContext(test, message.vali_exchangeOffers_9); console.log(message.vali_exchangeOffers_9); } else { console.error(e); @@ -1354,9 +1335,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi let exchangeSupportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - exchangeSupportedAssets = await xdaiDataService.getExchangeSupportedAssets({ page: 1, @@ -1367,7 +1345,7 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi try { if (exchangeSupportedAssets.items.length > 0) { - addContext(test, message.vali_exchangeOffers_1) + addContext(test, message.vali_exchangeOffers_1); console.log(message.vali_exchangeOffers_1); } else { addContext(test, message.vali_exchangeOffers_2); @@ -1393,12 +1371,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi // without fromAmount }); - addContext(test, message.fail_exchangeOffers_9) - assert.fail(message.fail_exchangeOffers_9) + addContext(test, message.fail_exchangeOffers_9); + assert.fail(message.fail_exchangeOffers_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.IsBigNumberish === constant.invalid_bignumber_2) { - addContext(test, message.vali_exchangeOffers_11) + if ( + errorResponse[0].constraints.IsBigNumberish === + constant.invalid_bignumber_2 + ) { + addContext(test, message.vali_exchangeOffers_11); console.log(message.vali_exchangeOffers_11); } else { console.error(e); @@ -1417,9 +1398,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1432,12 +1410,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_2) + addContext(test, message.fail_crossChainQuotes_2); assert.fail(message.fail_crossChainQuotes_2); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_1) { - addContext(test, message.vali_crossChainQuotes_2) + addContext(test, message.vali_crossChainQuotes_2); console.log(message.vali_crossChainQuotes_2); } else { console.error(e); @@ -1456,9 +1434,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1471,12 +1446,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_3) - assert.fail(message.fail_crossChainQuotes_3) + addContext(test, message.fail_crossChainQuotes_3); + assert.fail(message.fail_crossChainQuotes_3); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_2) { - addContext(test, message.vali_crossChainQuotes_3) + addContext(test, message.vali_crossChainQuotes_3); console.log(message.vali_crossChainQuotes_3); } else { console.error(e); @@ -1495,9 +1470,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1511,12 +1483,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_4) - assert.fail(message.fail_crossChainQuotes_4) + addContext(test, message.fail_crossChainQuotes_4); + assert.fail(message.fail_crossChainQuotes_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_4); console.log(message.vali_crossChainQuotes_4); } else { console.error(e); @@ -1535,9 +1510,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1551,12 +1523,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_5) - assert.fail(message.fail_crossChainQuotes_5) + addContext(test, message.fail_crossChainQuotes_5); + assert.fail(message.fail_crossChainQuotes_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_5); console.log(message.vali_crossChainQuotes_5); } else { console.error(e); @@ -1575,9 +1550,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1590,12 +1562,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_6) - assert.fail(message.fail_crossChainQuotes_6) + addContext(test, message.fail_crossChainQuotes_6); + assert.fail(message.fail_crossChainQuotes_6); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_crossChainQuotes_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_crossChainQuotes_6); console.log(message.vali_crossChainQuotes_6); } else { console.error(e); @@ -1614,9 +1589,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1630,12 +1602,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_7) - assert.fail(message.fail_crossChainQuotes_7) + addContext(test, message.fail_crossChainQuotes_7); + assert.fail(message.fail_crossChainQuotes_7); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_7); console.log(message.vali_crossChainQuotes_7); } else { console.error(e); @@ -1654,9 +1629,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1670,12 +1642,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_8) - assert.fail(message.fail_crossChainQuotes_8) + addContext(test, message.fail_crossChainQuotes_8); + assert.fail(message.fail_crossChainQuotes_8); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_8) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_8); console.log(message.vali_crossChainQuotes_8); } else { console.error(e); @@ -1694,9 +1669,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1709,12 +1681,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_9) - assert.fail(message.fail_crossChainQuotes_9) + addContext(test, message.fail_crossChainQuotes_9); + assert.fail(message.fail_crossChainQuotes_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_crossChainQuotes_9) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_crossChainQuotes_9); console.log(message.vali_crossChainQuotes_9); } else { console.error(e); @@ -1733,9 +1708,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1749,12 +1721,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_10) + addContext(test, message.fail_crossChainQuotes_10); assert.fail(message.fail_crossChainQuotes_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_10) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_10); assert.fail(message.vali_crossChainQuotes_10); } else { console.error(e); @@ -1773,9 +1748,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1789,18 +1761,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_11) + addContext(test, message.fail_crossChainQuotes_11); assert.fail(message.fail_crossChainQuotes_11); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_11) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_11); assert.fail(message.vali_crossChainQuotes_11); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - addContext(test, message.fail_crossChainQuotes_12) + addContext(test, message.fail_crossChainQuotes_12); assert.fail(message.fail_crossChainQuotes_11); } } @@ -1814,9 +1789,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1829,12 +1801,15 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getCrossChainQuotes(quoteRequestPayload); - addContext(test, message.fail_crossChainQuotes_12) + addContext(test, message.fail_crossChainQuotes_12); assert.fail(message.fail_crossChainQuotes_12); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_crossChainQuotes_12) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_crossChainQuotes_12); console.log(message.vali_crossChainQuotes_12); } else { console.error(e); @@ -1853,9 +1828,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1868,12 +1840,12 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_2) - assert.fail(fail_advanceRoutesLiFi_2) + addContext(test, fail_advanceRoutesLiFi_2); + assert.fail(fail_advanceRoutesLiFi_2); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_1) { - addContext(test, message.vali_advanceRoutesLiFi_2) + addContext(test, message.vali_advanceRoutesLiFi_2); console.log(message.vali_advanceRoutesLiFi_2); } else { console.error(e); @@ -1892,9 +1864,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1907,18 +1876,18 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_3) - assert.fail(fail_advanceRoutesLiFi_3) + addContext(test, fail_advanceRoutesLiFi_3); + assert.fail(fail_advanceRoutesLiFi_3); } catch (e) { const errorResponse = JSON.parse(e.message); if (errorResponse[0].property === constant.invalid_chainid_2) { - addContext(test, message.vali_advanceRoutesLifi_3) + addContext(test, message.vali_advanceRoutesLifi_3); console.log(message.vali_advanceRoutesLifi_3); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_3) + assert.fail(fail_advanceRoutesLiFi_3); } } }, data.retry); // Retry this async test up to 5 times @@ -1931,9 +1900,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1947,18 +1913,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_4) - assert.fail(fail_advanceRoutesLiFi_4) + addContext(test, fail_advanceRoutesLiFi_4); + assert.fail(fail_advanceRoutesLiFi_4); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_4); console.log(message.vali_advanceRoutesLifi_4); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_4) + assert.fail(fail_advanceRoutesLiFi_4); } } }, data.retry); // Retry this async test up to 5 times @@ -1971,9 +1940,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -1987,18 +1953,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_5) - assert.fail(fail_advanceRoutesLiFi_5) + addContext(test, fail_advanceRoutesLiFi_5); + assert.fail(fail_advanceRoutesLiFi_5); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_5) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_5); console.log(message.vali_advanceRoutesLifi_5); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_5) + assert.fail(fail_advanceRoutesLiFi_5); } } }, data.retry); // Retry this async test up to 5 times @@ -2011,9 +1980,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2026,18 +1992,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_6) - assert.fail(fail_advanceRoutesLiFi_6) + addContext(test, fail_advanceRoutesLiFi_6); + assert.fail(fail_advanceRoutesLiFi_6); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_2) { - addContext(test, message.vali_advanceRoutesLifi_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_2 + ) { + addContext(test, message.vali_advanceRoutesLifi_6); console.log(message.vali_advanceRoutesLifi_6); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_6) + assert.fail(fail_advanceRoutesLiFi_6); } } }, data.retry); // Retry this async test up to 5 times @@ -2050,9 +2019,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2066,18 +2032,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_7) - assert.fail(fail_advanceRoutesLiFi_7) + addContext(test, fail_advanceRoutesLiFi_7); + assert.fail(fail_advanceRoutesLiFi_7); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_7); console.log(message.vali_advanceRoutesLifi_7); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_7) + assert.fail(fail_advanceRoutesLiFi_7); } } }, data.retry); // Retry this async test up to 5 times @@ -2090,9 +2059,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2106,18 +2072,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_8) - assert.fail(fail_advanceRoutesLiFi_8) + addContext(test, fail_advanceRoutesLiFi_8); + assert.fail(fail_advanceRoutesLiFi_8); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_8) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_8); console.log(message.vali_advanceRoutesLifi_8); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_8) + assert.fail(fail_advanceRoutesLiFi_8); } } }, data.retry); // Retry this async test up to 5 times @@ -2130,9 +2099,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2145,18 +2111,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_9) - assert.fail(fail_advanceRoutesLiFi_9) + addContext(test, fail_advanceRoutesLiFi_9); + assert.fail(fail_advanceRoutesLiFi_9); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_3) { - addContext(test, message.vali_advanceRoutesLifi_9) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_9); console.log(message.vali_advanceRoutesLifi_9); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_9) + assert.fail(fail_advanceRoutesLiFi_9); } } }, data.retry); // Retry this async test up to 5 times @@ -2169,9 +2138,6 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let quoteRequestPayload; try { quoteRequestPayload = { @@ -2184,18 +2150,21 @@ describe('The PrimeSDK, when get cross chain quotes and get advance routes LiFi await xdaiDataService.getAdvanceRoutesLiFi(quoteRequestPayload); - addContext(test, fail_advanceRoutesLiFi_10) - assert.fail(fail_advanceRoutesLiFi_10) + addContext(test, fail_advanceRoutesLiFi_10); + assert.fail(fail_advanceRoutesLiFi_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.IsBigNumberish === constant.invalid_bignumber_3) { - addContext(test, message.vali_advanceRoutesLifi_10) + if ( + errorResponse[0].constraints.IsBigNumberish === + constant.invalid_bignumber_3 + ) { + addContext(test, message.vali_advanceRoutesLifi_10); console.log(message.vali_advanceRoutesLifi_10); } else { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(fail_advanceRoutesLiFi_10) + assert.fail(fail_advanceRoutesLiFi_10); } } }, data.retry); // Retry this async test up to 5 times diff --git a/test/specs/mainnet/transactionHistory/arbitrum.spec.js b/test/specs/mainnet/transactionHistory/arbitrum.spec.js index 3eeb80d..1183c91 100644 --- a/test/specs/mainnet/transactionHistory/arbitrum.spec.js +++ b/test/specs/mainnet/transactionHistory/arbitrum.spec.js @@ -22,7 +22,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -31,15 +30,19 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( arbitrumMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -61,7 +64,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction assert.strictEqual( arbitrumEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -71,16 +75,12 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction console.error(e.message); const eString = e.toString(); addContext(test, eString); - assert.fail( - message.fail_smart_address - ); + assert.fail(message.fail_smart_address); } // initializating Data service... try { - arbitrumDataService = new DataUtils( - process.env.DATA_API_KEY - ); + arbitrumDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -131,7 +131,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -185,9 +184,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -226,7 +225,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.chainId, - message.vali_getTransaction_chainId); + message.vali_getTransaction_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -236,7 +236,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.hash, - message.vali_getTransaction_hash); + message.vali_getTransaction_hash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -246,7 +247,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.nonce, - message.vali_getTransaction_nonce); + message.vali_getTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -256,7 +258,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.blockHash, - message.vali_getTransaction_blockHash); + message.vali_getTransaction_blockHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -266,7 +269,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.blockNumber, - message.vali_getTransaction_blockNumber); + message.vali_getTransaction_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -276,7 +280,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.from, - message.vali_getTransaction_from); + message.vali_getTransaction_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -286,7 +291,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.to, - message.vali_getTransaction_to); + message.vali_getTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -296,7 +302,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.value, - message.vali_getTransaction_value); + message.vali_getTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -306,7 +313,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.gasPrice, - message.vali_getTransaction_gasPrice); + message.vali_getTransaction_gasPrice + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -316,7 +324,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.gasLimit, - message.vali_getTransaction_gasLimit); + message.vali_getTransaction_gasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -326,7 +335,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.input, - message.vali_getTransaction_input); + message.vali_getTransaction_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -336,7 +346,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.status, - message.vali_getTransaction_status); + message.vali_getTransaction_status + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -346,7 +357,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.blockExplorerUrl, - message.vali_getTransaction_blockExplorerUrl); + message.vali_getTransaction_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -356,7 +368,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.transactionIndex, - message.vali_getTransaction_transactionIndex); + message.vali_getTransaction_transactionIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -366,7 +379,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.gasUsed, - message.vali_getTransaction_gasUsed); + message.vali_getTransaction_gasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -376,7 +390,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].transactionIndex, - message.vali_getTransaction_log_transactionIndex); + message.vali_getTransaction_log_transactionIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -386,7 +401,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].blockNumber, - message.vali_getTransaction_log_blockNumber); + message.vali_getTransaction_log_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -396,7 +412,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].transactionHash, - message.vali_getTransaction_log_transactionHash); + message.vali_getTransaction_log_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -406,7 +423,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].address, - message.vali_getTransaction_log_address); + message.vali_getTransaction_log_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -416,7 +434,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].topics, - message.vali_getTransaction_log_topics); + message.vali_getTransaction_log_topics + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -426,7 +445,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].data, - message.vali_getTransaction_log_data); + message.vali_getTransaction_log_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -436,7 +456,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].logIndex, - message.vali_getTransaction_log_logIndex); + message.vali_getTransaction_log_logIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -446,7 +467,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].blockHash, - message.vali_getTransaction_log_blockHash); + message.vali_getTransaction_log_blockHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -459,7 +481,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction assert.fail(message.fail_getTransaction_1); } } else { - addContext(test, message.vali_getTransaction_1) + addContext(test, message.vali_getTransaction_1); console.log(message.vali_getTransaction_1); } }, data.retry); // Retry this async test up to 5 times @@ -472,7 +494,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // Fetching historical transactions @@ -482,16 +503,18 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { transactions = await arbitrumDataService.getTransactions({ chainId: Number(data.arbitrum_chainid), - account: data.sender + account: data.sender, }); randomTransaction = - Math.floor(Math.random() * (transactions.transactions.length - 1)) + 1; + Math.floor(Math.random() * (transactions.transactions.length - 1)) + + 1; try { assert.isNumber( transactions.transactions[randomTransaction].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -501,7 +524,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -511,7 +535,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -521,7 +546,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -531,7 +557,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -541,7 +568,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -551,7 +579,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -561,7 +590,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -571,7 +601,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -581,7 +612,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -591,7 +623,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -601,7 +634,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -611,7 +645,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -621,7 +656,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -631,7 +667,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -641,7 +678,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -651,7 +689,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].preVerificationGas, - message.vali_getTransactions_preVerificationGas); + message.vali_getTransactions_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -661,7 +700,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -671,7 +711,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -693,7 +734,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -747,9 +787,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -774,7 +814,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } // wait for the 10 seconds - helper.wait(10000) + helper.wait(10000); // Fetching historical transactions let transactions; @@ -783,14 +823,15 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.arbitrum_chainid), account: data.sender, page: 1, - limit: 10 + limit: 10, }); if (userOpsReceipt != null) { try { assert.isNumber( transactions.transactions[0].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -800,7 +841,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].blockNumber, - message.vali_getTransactions_blockNumber); + message.vali_getTransactions_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -810,7 +852,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -820,7 +863,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].target, - message.vali_getTransactions_target); + message.vali_getTransactions_target + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -830,7 +874,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -840,7 +885,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -850,7 +896,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -860,7 +907,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -870,7 +918,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -880,7 +929,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -890,7 +940,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -900,7 +951,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -910,7 +962,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -920,7 +973,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -930,7 +984,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -940,7 +995,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -950,7 +1006,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -960,7 +1017,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -970,7 +1028,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].preVerificationGas, - 'The preVerificationGas value is empty in the get transactions response.'); + 'The preVerificationGas value is empty in the get transactions response.' + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -980,7 +1039,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -990,7 +1050,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1000,7 +1061,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1010,7 +1072,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].from, - message.vali_getTransactions_nativeTransfers_from); + message.vali_getTransactions_nativeTransfers_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1020,7 +1083,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].to, - message.vali_getTransactions_nativeTransfers_to); + message.vali_getTransactions_nativeTransfers_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1030,7 +1094,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].value, - message.vali_getTransactions_nativeTransfers_value); + message.vali_getTransactions_nativeTransfers_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1040,7 +1105,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].asset, - message.vali_getTransactions_nativeTransfers_asset); + message.vali_getTransactions_nativeTransfers_asset + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1050,7 +1116,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].address, - message.vali_getTransactions_nativeTransfers_address); + message.vali_getTransactions_nativeTransfers_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1060,7 +1127,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nativeTransfers[0].decimal, - message.vali_getTransactions_nativeTransfers_decimal); + message.vali_getTransactions_nativeTransfers_decimal + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1070,15 +1138,16 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].data, - message.vali_getTransactions_nativeTransfers_data); + message.vali_getTransactions_nativeTransfers_data + ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); } } else { - addContext(test, message.vali_getTransactions_1) - console.log(message.vali_getTransactions_1) + addContext(test, message.vali_getTransactions_1); + console.log(message.vali_getTransactions_1); } } catch (e) { console.error(e); @@ -1096,14 +1165,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1117,7 +1186,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1141,7 +1211,11 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1191,9 +1265,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1218,7 +1292,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } // wait for the 10 seconds - helper.wait(10000) + helper.wait(10000); // Fetching historical transactions let transactions; @@ -1227,14 +1301,15 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.arbitrum_chainid), account: data.sender, page: 1, - limit: 10 + limit: 10, }); if (userOpsReceipt != null) { try { assert.isNumber( transactions.transactions[0].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1244,7 +1319,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].blockNumber, - message.vali_getTransactions_blockNumber); + message.vali_getTransactions_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1254,7 +1330,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1264,7 +1341,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].target, - message.vali_getTransactions_target); + message.vali_getTransactions_target + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1274,7 +1352,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1284,7 +1363,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1294,7 +1374,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1304,7 +1385,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1314,7 +1396,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1324,7 +1407,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1334,7 +1418,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1344,7 +1429,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1354,7 +1440,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1364,7 +1451,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1374,7 +1462,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1384,7 +1473,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1394,7 +1484,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1404,7 +1495,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1414,7 +1506,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].preVerificationGas, - message.vali_getTransactions_preVerificationGas); + message.vali_getTransactions_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1424,7 +1517,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1434,7 +1528,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1444,7 +1539,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1454,7 +1550,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].from, - message.vali_getTransactions_erc20Transfers_from); + message.vali_getTransactions_erc20Transfers_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1464,7 +1561,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].to, - message.vali_getTransactions_erc20Transfers_to); + message.vali_getTransactions_erc20Transfers_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1474,7 +1572,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].value, - message.vali_getTransactions_erc20Transfers_value); + message.vali_getTransactions_erc20Transfers_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1484,7 +1583,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].asset, - message.vali_getTransactions_erc20Transfers_asset); + message.vali_getTransactions_erc20Transfers_asset + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1494,7 +1594,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].address, - message.vali_getTransactions_erc20Transfers_address); + message.vali_getTransactions_erc20Transfers_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1504,7 +1605,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].erc20Transfers[0].decimal, - message.vali_getTransactions_erc20Transfers_decimal); + message.vali_getTransactions_erc20Transfers_decimal + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1514,15 +1616,16 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].data, - message.vali_getTransactions_erc20Transfers_data); + message.vali_getTransactions_erc20Transfers_data + ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); } } else { - addContext(test, message.vali_getTransactions_1) - console.log(message.vali_getTransactions_1) + addContext(test, message.vali_getTransactions_1); + console.log(message.vali_getTransactions_1); } } catch (e) { console.error(e); @@ -1540,9 +1643,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // Fetching a single transaction let transaction; try { @@ -1552,7 +1652,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction }); if (transaction === null || Object.keys(transaction).length === 0) { - addContext(test, message.vali_getTransactions_2) + addContext(test, message.vali_getTransactions_2); console.log(message.vali_getTransactions_2); } else { addContext(test, message.fail_getTransactions_6); @@ -1574,9 +1674,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // Fetching a single transaction try { await arbitrumDataService.getTransaction({ @@ -1584,11 +1681,11 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.arbitrum_chainid), }); - addContext(test, message.fail_getTransactions_7) + addContext(test, message.fail_getTransactions_7); assert.fail(message.fail_getTransactions_7); } catch (e) { if (e.errors[0].constraints.isHex === constant.hash_32) { - addContext(test, message.vali_getTransactions_3) + addContext(test, message.vali_getTransactions_3); console.log(message.vali_getTransactions_3); } else { console.error(e); @@ -1607,9 +1704,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let transactions = await arbitrumDataService.getTransactions({ chainId: Number(data.invalid_arbitrum_chainid), @@ -1617,7 +1711,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction }); if (transactions.transactions.length === 0) { - addContext(test, message.vali_getTransactions_4) + addContext(test, message.vali_getTransactions_4); console.log(message.vali_getTransactions_4); } else { addContext(test, message.fail_getTransactions_8); @@ -1639,21 +1733,21 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let a = await arbitrumDataService.getTransactions({ chainId: Number(data.arbitrum_chainid), account: data.invalidSender, }); - addContext(test, message.fail_getTransactions_10) + addContext(test, message.fail_getTransactions_10); assert.fail(message.fail_getTransactions_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_getTransactions_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_getTransactions_6); console.log(message.vali_getTransactions_6); } else { console.error(e); @@ -1672,21 +1766,21 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await arbitrumDataService.getTransactions({ chainId: Number(data.arbitrum_chainid), account: data.incorrectSender, }); - addContext(test, message.fail_getTransactions_11) + addContext(test, message.fail_getTransactions_11); assert.fail(message.fail_getTransactions_11); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_getTransactions_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_getTransactions_7); console.log(message.vali_getTransactions_7); } else { console.error(e); diff --git a/test/specs/mainnet/transactionHistory/matic.spec.js b/test/specs/mainnet/transactionHistory/matic.spec.js index 1323471..70a200d 100644 --- a/test/specs/mainnet/transactionHistory/matic.spec.js +++ b/test/specs/mainnet/transactionHistory/matic.spec.js @@ -22,7 +22,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -31,15 +30,19 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( maticMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -61,7 +64,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction assert.strictEqual( maticEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -71,16 +75,12 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction console.error(e.message); const eString = e.toString(); addContext(test, eString); - assert.fail( - message.fail_smart_address - ); + assert.fail(message.fail_smart_address); } // initializating Data service... try { - maticDataService = new DataUtils( - process.env.DATA_API_KEY - ); + maticDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -131,7 +131,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -185,9 +184,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -226,7 +225,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.chainId, - message.vali_getTransaction_chainId); + message.vali_getTransaction_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -236,7 +236,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.hash, - message.vali_getTransaction_hash); + message.vali_getTransaction_hash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -246,7 +247,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.nonce, - message.vali_getTransaction_nonce); + message.vali_getTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -256,7 +258,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.blockHash, - message.vali_getTransaction_blockHash); + message.vali_getTransaction_blockHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -266,7 +269,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.blockNumber, - message.vali_getTransaction_blockNumber); + message.vali_getTransaction_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -276,7 +280,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.from, - message.vali_getTransaction_from); + message.vali_getTransaction_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -286,7 +291,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.to, - message.vali_getTransaction_to); + message.vali_getTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -296,7 +302,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.value, - message.vali_getTransaction_value); + message.vali_getTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -306,7 +313,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.gasPrice, - message.vali_getTransaction_gasPrice); + message.vali_getTransaction_gasPrice + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -316,7 +324,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.gasLimit, - message.vali_getTransaction_gasLimit); + message.vali_getTransaction_gasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -326,7 +335,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.input, - message.vali_getTransaction_input); + message.vali_getTransaction_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -336,7 +346,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.status, - message.vali_getTransaction_status); + message.vali_getTransaction_status + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -346,7 +357,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.blockExplorerUrl, - message.vali_getTransaction_blockExplorerUrl); + message.vali_getTransaction_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -356,7 +368,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.transactionIndex, - message.vali_getTransaction_transactionIndex); + message.vali_getTransaction_transactionIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -366,7 +379,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.gasUsed, - message.vali_getTransaction_gasUsed); + message.vali_getTransaction_gasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -376,7 +390,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].transactionIndex, - message.vali_getTransaction_log_transactionIndex); + message.vali_getTransaction_log_transactionIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -386,7 +401,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].blockNumber, - message.vali_getTransaction_log_blockNumber); + message.vali_getTransaction_log_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -396,7 +412,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].transactionHash, - message.vali_getTransaction_log_transactionHash); + message.vali_getTransaction_log_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -406,7 +423,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].address, - message.vali_getTransaction_log_address); + message.vali_getTransaction_log_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -416,7 +434,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].topics, - message.vali_getTransaction_log_topics); + message.vali_getTransaction_log_topics + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -426,7 +445,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].data, - message.vali_getTransaction_log_data); + message.vali_getTransaction_log_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -436,7 +456,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].logIndex, - message.vali_getTransaction_log_logIndex); + message.vali_getTransaction_log_logIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -446,7 +467,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].blockHash, - message.vali_getTransaction_log_blockHash); + message.vali_getTransaction_log_blockHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -459,7 +481,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction assert.fail(message.fail_getTransaction_1); } } else { - addContext(test, message.vali_getTransaction_1) + addContext(test, message.vali_getTransaction_1); console.log(message.vali_getTransaction_1); } }, data.retry); // Retry this async test up to 5 times @@ -472,7 +494,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // Fetching historical transactions @@ -482,16 +503,18 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { transactions = await maticDataService.getTransactions({ chainId: Number(data.matic_chainid), - account: data.sender + account: data.sender, }); randomTransaction = - Math.floor(Math.random() * (transactions.transactions.length - 1)) + 1; + Math.floor(Math.random() * (transactions.transactions.length - 1)) + + 1; try { assert.isNumber( transactions.transactions[randomTransaction].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -501,7 +524,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -511,7 +535,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -521,7 +546,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -531,7 +557,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -541,7 +568,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -551,7 +579,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -561,7 +590,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -571,7 +601,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -581,7 +612,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -591,7 +623,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -601,7 +634,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -611,7 +645,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -621,7 +656,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -631,7 +667,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -641,7 +678,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -651,7 +689,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].preVerificationGas, - message.vali_getTransactions_preVerificationGas); + message.vali_getTransactions_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -661,7 +700,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -671,7 +711,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -693,7 +734,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -747,9 +787,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -774,7 +814,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } // wait for the 10 seconds - helper.wait(10000) + helper.wait(10000); // Fetching historical transactions let transactions; @@ -783,14 +823,15 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.matic_chainid), account: data.sender, page: 1, - limit: 10 + limit: 10, }); if (userOpsReceipt != null) { try { assert.isNumber( transactions.transactions[0].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -800,7 +841,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].blockNumber, - message.vali_getTransactions_blockNumber); + message.vali_getTransactions_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -810,7 +852,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -820,7 +863,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].target, - message.vali_getTransactions_target); + message.vali_getTransactions_target + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -830,7 +874,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -840,7 +885,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -850,7 +896,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -860,7 +907,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -870,7 +918,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -880,7 +929,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -890,7 +940,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -900,7 +951,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -910,7 +962,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -920,7 +973,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -930,7 +984,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -940,7 +995,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -950,7 +1006,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -960,7 +1017,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -970,7 +1028,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].preVerificationGas, - 'The preVerificationGas value is empty in the get transactions response.'); + 'The preVerificationGas value is empty in the get transactions response.' + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -980,7 +1039,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -990,7 +1050,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1000,7 +1061,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1010,7 +1072,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].from, - message.vali_getTransactions_nativeTransfers_from); + message.vali_getTransactions_nativeTransfers_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1020,7 +1083,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].to, - message.vali_getTransactions_nativeTransfers_to); + message.vali_getTransactions_nativeTransfers_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1030,7 +1094,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].value, - message.vali_getTransactions_nativeTransfers_value); + message.vali_getTransactions_nativeTransfers_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1040,7 +1105,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].asset, - message.vali_getTransactions_nativeTransfers_asset); + message.vali_getTransactions_nativeTransfers_asset + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1050,7 +1116,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].address, - message.vali_getTransactions_nativeTransfers_address); + message.vali_getTransactions_nativeTransfers_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1060,7 +1127,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nativeTransfers[0].decimal, - message.vali_getTransactions_nativeTransfers_decimal); + message.vali_getTransactions_nativeTransfers_decimal + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1070,15 +1138,16 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].data, - message.vali_getTransactions_nativeTransfers_data); + message.vali_getTransactions_nativeTransfers_data + ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); } } else { - addContext(test, message.vali_getTransactions_1) - console.log(message.vali_getTransactions_1) + addContext(test, message.vali_getTransactions_1); + console.log(message.vali_getTransactions_1); } } catch (e) { console.error(e); @@ -1096,14 +1165,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1117,7 +1186,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1141,7 +1211,11 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1191,9 +1265,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1218,7 +1292,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } // wait for the 10 seconds - helper.wait(10000) + helper.wait(10000); // Fetching historical transactions let transactions; @@ -1227,14 +1301,15 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.matic_chainid), account: data.sender, page: 1, - limit: 10 + limit: 10, }); if (userOpsReceipt != null) { try { assert.isNumber( transactions.transactions[0].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1244,7 +1319,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].blockNumber, - message.vali_getTransactions_blockNumber); + message.vali_getTransactions_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1254,7 +1330,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1264,7 +1341,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].target, - message.vali_getTransactions_target); + message.vali_getTransactions_target + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1274,7 +1352,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1284,7 +1363,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1294,7 +1374,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1304,7 +1385,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1314,7 +1396,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1324,7 +1407,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1334,7 +1418,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1344,7 +1429,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1354,7 +1440,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1364,7 +1451,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1374,7 +1462,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1384,7 +1473,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1394,7 +1484,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1404,7 +1495,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1414,7 +1506,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].preVerificationGas, - message.vali_getTransactions_preVerificationGas); + message.vali_getTransactions_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1424,7 +1517,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1434,7 +1528,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1444,7 +1539,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1454,7 +1550,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].from, - message.vali_getTransactions_erc20Transfers_from); + message.vali_getTransactions_erc20Transfers_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1464,7 +1561,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].to, - message.vali_getTransactions_erc20Transfers_to); + message.vali_getTransactions_erc20Transfers_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1474,7 +1572,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].value, - message.vali_getTransactions_erc20Transfers_value); + message.vali_getTransactions_erc20Transfers_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1484,7 +1583,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].asset, - message.vali_getTransactions_erc20Transfers_asset); + message.vali_getTransactions_erc20Transfers_asset + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1494,7 +1594,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].address, - message.vali_getTransactions_erc20Transfers_address); + message.vali_getTransactions_erc20Transfers_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1504,7 +1605,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].erc20Transfers[0].decimal, - message.vali_getTransactions_erc20Transfers_decimal); + message.vali_getTransactions_erc20Transfers_decimal + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1514,15 +1616,16 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].data, - message.vali_getTransactions_erc20Transfers_data); + message.vali_getTransactions_erc20Transfers_data + ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); } } else { - addContext(test, message.vali_getTransactions_1) - console.log(message.vali_getTransactions_1) + addContext(test, message.vali_getTransactions_1); + console.log(message.vali_getTransactions_1); } } catch (e) { console.error(e); @@ -1540,9 +1643,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // Fetching a single transaction let transaction; try { @@ -1552,7 +1652,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction }); if (transaction === null || Object.keys(transaction).length === 0) { - addContext(test, message.vali_getTransactions_2) + addContext(test, message.vali_getTransactions_2); console.log(message.vali_getTransactions_2); } else { addContext(test, message.fail_getTransactions_6); @@ -1574,9 +1674,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // Fetching a single transaction try { await maticDataService.getTransaction({ @@ -1584,11 +1681,11 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.matic_chainid), }); - addContext(test, message.fail_getTransactions_7) + addContext(test, message.fail_getTransactions_7); assert.fail(message.fail_getTransactions_7); } catch (e) { if (e.errors[0].constraints.isHex === constant.hash_32) { - addContext(test, message.vali_getTransactions_3) + addContext(test, message.vali_getTransactions_3); console.log(message.vali_getTransactions_3); } else { console.error(e); @@ -1607,9 +1704,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let transactions = await maticDataService.getTransactions({ chainId: Number(data.invalid_matic_chainid), @@ -1617,7 +1711,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction }); if (transactions.transactions.length === 0) { - addContext(test, message.vali_getTransactions_4) + addContext(test, message.vali_getTransactions_4); console.log(message.vali_getTransactions_4); } else { addContext(test, message.fail_getTransactions_8); @@ -1639,21 +1733,21 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let a = await maticDataService.getTransactions({ chainId: Number(data.matic_chainid), account: data.invalidSender, }); - addContext(test, message.fail_getTransactions_10) + addContext(test, message.fail_getTransactions_10); assert.fail(message.fail_getTransactions_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_getTransactions_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_getTransactions_6); console.log(message.vali_getTransactions_6); } else { console.error(e); @@ -1672,21 +1766,21 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await maticDataService.getTransactions({ chainId: Number(data.matic_chainid), account: data.incorrectSender, }); - addContext(test, message.fail_getTransactions_11) + addContext(test, message.fail_getTransactions_11); assert.fail(message.fail_getTransactions_11); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_getTransactions_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_getTransactions_7); console.log(message.vali_getTransactions_7); } else { console.error(e); @@ -1700,4 +1794,4 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction console.warn(message.getTransaction_insufficientBalance); } }); -}); \ No newline at end of file +}); diff --git a/test/specs/mainnet/transactionHistory/optimism.spec.js b/test/specs/mainnet/transactionHistory/optimism.spec.js index db6742e..8f8ddc4 100644 --- a/test/specs/mainnet/transactionHistory/optimism.spec.js +++ b/test/specs/mainnet/transactionHistory/optimism.spec.js @@ -22,7 +22,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -31,15 +30,19 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( optimismMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -61,7 +64,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction assert.strictEqual( optimismEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -71,16 +75,12 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction console.error(e.message); const eString = e.toString(); addContext(test, eString); - assert.fail( - message.fail_smart_address - ); + assert.fail(message.fail_smart_address); } // initializating Data service... try { - optimismDataService = new DataUtils( - process.env.DATA_API_KEY - ); + optimismDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -131,7 +131,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -185,9 +184,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -226,7 +225,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.chainId, - message.vali_getTransaction_chainId); + message.vali_getTransaction_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -236,7 +236,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.hash, - message.vali_getTransaction_hash); + message.vali_getTransaction_hash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -246,7 +247,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.nonce, - message.vali_getTransaction_nonce); + message.vali_getTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -256,7 +258,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.blockHash, - message.vali_getTransaction_blockHash); + message.vali_getTransaction_blockHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -266,7 +269,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.blockNumber, - message.vali_getTransaction_blockNumber); + message.vali_getTransaction_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -276,7 +280,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.from, - message.vali_getTransaction_from); + message.vali_getTransaction_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -286,7 +291,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.to, - message.vali_getTransaction_to); + message.vali_getTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -296,7 +302,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.value, - message.vali_getTransaction_value); + message.vali_getTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -306,7 +313,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.gasPrice, - message.vali_getTransaction_gasPrice); + message.vali_getTransaction_gasPrice + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -316,7 +324,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.gasLimit, - message.vali_getTransaction_gasLimit); + message.vali_getTransaction_gasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -326,7 +335,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.input, - message.vali_getTransaction_input); + message.vali_getTransaction_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -336,7 +346,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.status, - message.vali_getTransaction_status); + message.vali_getTransaction_status + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -346,7 +357,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.blockExplorerUrl, - message.vali_getTransaction_blockExplorerUrl); + message.vali_getTransaction_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -356,7 +368,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.transactionIndex, - message.vali_getTransaction_transactionIndex); + message.vali_getTransaction_transactionIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -366,7 +379,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.gasUsed, - message.vali_getTransaction_gasUsed); + message.vali_getTransaction_gasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -376,7 +390,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].transactionIndex, - message.vali_getTransaction_log_transactionIndex); + message.vali_getTransaction_log_transactionIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -386,7 +401,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].blockNumber, - message.vali_getTransaction_log_blockNumber); + message.vali_getTransaction_log_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -396,7 +412,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].transactionHash, - message.vali_getTransaction_log_transactionHash); + message.vali_getTransaction_log_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -406,7 +423,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].address, - message.vali_getTransaction_log_address); + message.vali_getTransaction_log_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -416,7 +434,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].topics, - message.vali_getTransaction_log_topics); + message.vali_getTransaction_log_topics + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -426,7 +445,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].data, - message.vali_getTransaction_log_data); + message.vali_getTransaction_log_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -436,7 +456,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].logIndex, - message.vali_getTransaction_log_logIndex); + message.vali_getTransaction_log_logIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -446,7 +467,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].blockHash, - message.vali_getTransaction_log_blockHash); + message.vali_getTransaction_log_blockHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -459,7 +481,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction assert.fail(message.fail_getTransaction_1); } } else { - addContext(test, message.vali_getTransaction_1) + addContext(test, message.vali_getTransaction_1); console.log(message.vali_getTransaction_1); } }, data.retry); // Retry this async test up to 5 times @@ -472,7 +494,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // Fetching historical transactions @@ -482,16 +503,18 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { transactions = await optimismDataService.getTransactions({ chainId: Number(data.optimism_chainid), - account: data.sender + account: data.sender, }); randomTransaction = - Math.floor(Math.random() * (transactions.transactions.length - 1)) + 1; + Math.floor(Math.random() * (transactions.transactions.length - 1)) + + 1; try { assert.isNumber( transactions.transactions[randomTransaction].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -501,7 +524,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -511,7 +535,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -521,7 +546,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -531,7 +557,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -541,7 +568,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -551,7 +579,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -561,7 +590,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -571,7 +601,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -581,7 +612,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -591,7 +623,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -601,7 +634,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -611,7 +645,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -621,7 +656,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -631,7 +667,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -641,7 +678,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -651,7 +689,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].preVerificationGas, - message.vali_getTransactions_preVerificationGas); + message.vali_getTransactions_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -661,7 +700,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -671,7 +711,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -693,7 +734,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -747,9 +787,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -774,7 +814,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } // wait for the 10 seconds - helper.wait(10000) + helper.wait(10000); // Fetching historical transactions let transactions; @@ -783,14 +823,15 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.optimism_chainid), account: data.sender, page: 1, - limit: 10 + limit: 10, }); if (userOpsReceipt != null) { try { assert.isNumber( transactions.transactions[0].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -800,7 +841,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].blockNumber, - message.vali_getTransactions_blockNumber); + message.vali_getTransactions_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -810,7 +852,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -820,7 +863,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].target, - message.vali_getTransactions_target); + message.vali_getTransactions_target + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -830,7 +874,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -840,7 +885,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -850,7 +896,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -860,7 +907,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -870,7 +918,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -880,7 +929,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -890,7 +940,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -900,7 +951,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -910,7 +962,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -920,7 +973,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -930,7 +984,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -940,7 +995,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -950,7 +1006,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -960,7 +1017,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -970,7 +1028,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].preVerificationGas, - 'The preVerificationGas value is empty in the get transactions response.'); + 'The preVerificationGas value is empty in the get transactions response.' + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -980,7 +1039,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -990,7 +1050,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1000,7 +1061,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1010,7 +1072,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].from, - message.vali_getTransactions_nativeTransfers_from); + message.vali_getTransactions_nativeTransfers_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1020,7 +1083,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].to, - message.vali_getTransactions_nativeTransfers_to); + message.vali_getTransactions_nativeTransfers_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1030,7 +1094,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].value, - message.vali_getTransactions_nativeTransfers_value); + message.vali_getTransactions_nativeTransfers_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1040,7 +1105,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].asset, - message.vali_getTransactions_nativeTransfers_asset); + message.vali_getTransactions_nativeTransfers_asset + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1050,7 +1116,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].address, - message.vali_getTransactions_nativeTransfers_address); + message.vali_getTransactions_nativeTransfers_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1060,7 +1127,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nativeTransfers[0].decimal, - message.vali_getTransactions_nativeTransfers_decimal); + message.vali_getTransactions_nativeTransfers_decimal + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1070,15 +1138,16 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].data, - message.vali_getTransactions_nativeTransfers_data); + message.vali_getTransactions_nativeTransfers_data + ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); } } else { - addContext(test, message.vali_getTransactions_1) - console.log(message.vali_getTransactions_1) + addContext(test, message.vali_getTransactions_1); + console.log(message.vali_getTransactions_1); } } catch (e) { console.error(e); @@ -1096,14 +1165,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1117,7 +1186,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1141,7 +1211,11 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1191,9 +1265,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1218,7 +1292,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } // wait for the 10 seconds - helper.wait(10000) + helper.wait(10000); // Fetching historical transactions let transactions; @@ -1227,14 +1301,15 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.optimism_chainid), account: data.sender, page: 1, - limit: 10 + limit: 10, }); if (userOpsReceipt != null) { try { assert.isNumber( transactions.transactions[0].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1244,7 +1319,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].blockNumber, - message.vali_getTransactions_blockNumber); + message.vali_getTransactions_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1254,7 +1330,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1264,7 +1341,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].target, - message.vali_getTransactions_target); + message.vali_getTransactions_target + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1274,7 +1352,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1284,7 +1363,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1294,7 +1374,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1304,7 +1385,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1314,7 +1396,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1324,7 +1407,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1334,7 +1418,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1344,7 +1429,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1354,7 +1440,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1364,7 +1451,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1374,7 +1462,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1384,7 +1473,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1394,7 +1484,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1404,7 +1495,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1414,7 +1506,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].preVerificationGas, - message.vali_getTransactions_preVerificationGas); + message.vali_getTransactions_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1424,7 +1517,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1434,7 +1528,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1444,7 +1539,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1454,7 +1550,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].from, - message.vali_getTransactions_erc20Transfers_from); + message.vali_getTransactions_erc20Transfers_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1464,7 +1561,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].to, - message.vali_getTransactions_erc20Transfers_to); + message.vali_getTransactions_erc20Transfers_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1474,7 +1572,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].value, - message.vali_getTransactions_erc20Transfers_value); + message.vali_getTransactions_erc20Transfers_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1484,7 +1583,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].asset, - message.vali_getTransactions_erc20Transfers_asset); + message.vali_getTransactions_erc20Transfers_asset + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1494,7 +1594,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].address, - message.vali_getTransactions_erc20Transfers_address); + message.vali_getTransactions_erc20Transfers_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1504,7 +1605,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].erc20Transfers[0].decimal, - message.vali_getTransactions_erc20Transfers_decimal); + message.vali_getTransactions_erc20Transfers_decimal + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1514,15 +1616,16 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].data, - message.vali_getTransactions_erc20Transfers_data); + message.vali_getTransactions_erc20Transfers_data + ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); } } else { - addContext(test, message.vali_getTransactions_1) - console.log(message.vali_getTransactions_1) + addContext(test, message.vali_getTransactions_1); + console.log(message.vali_getTransactions_1); } } catch (e) { console.error(e); @@ -1540,9 +1643,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // Fetching a single transaction let transaction; try { @@ -1552,7 +1652,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction }); if (transaction === null || Object.keys(transaction).length === 0) { - addContext(test, message.vali_getTransactions_2) + addContext(test, message.vali_getTransactions_2); console.log(message.vali_getTransactions_2); } else { addContext(test, message.fail_getTransactions_6); @@ -1574,9 +1674,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // Fetching a single transaction try { await optimismDataService.getTransaction({ @@ -1584,11 +1681,11 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.optimism_chainid), }); - addContext(test, message.fail_getTransactions_7) + addContext(test, message.fail_getTransactions_7); assert.fail(message.fail_getTransactions_7); } catch (e) { if (e.errors[0].constraints.isHex === constant.hash_32) { - addContext(test, message.vali_getTransactions_3) + addContext(test, message.vali_getTransactions_3); console.log(message.vali_getTransactions_3); } else { console.error(e); @@ -1607,9 +1704,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let transactions = await optimismDataService.getTransactions({ chainId: Number(data.invalid_optimism_chainid), @@ -1617,7 +1711,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction }); if (transactions.transactions.length === 0) { - addContext(test, message.vali_getTransactions_4) + addContext(test, message.vali_getTransactions_4); console.log(message.vali_getTransactions_4); } else { addContext(test, message.fail_getTransactions_8); @@ -1639,21 +1733,21 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let a = await optimismDataService.getTransactions({ chainId: Number(data.optimism_chainid), account: data.invalidSender, }); - addContext(test, message.fail_getTransactions_10) + addContext(test, message.fail_getTransactions_10); assert.fail(message.fail_getTransactions_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_getTransactions_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_getTransactions_6); console.log(message.vali_getTransactions_6); } else { console.error(e); @@ -1672,21 +1766,21 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await optimismDataService.getTransactions({ chainId: Number(data.optimism_chainid), account: data.incorrectSender, }); - addContext(test, message.fail_getTransactions_11) + addContext(test, message.fail_getTransactions_11); assert.fail(message.fail_getTransactions_11); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_getTransactions_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_getTransactions_7); console.log(message.vali_getTransactions_7); } else { console.error(e); @@ -1700,4 +1794,4 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction console.warn(message.getTransaction_insufficientBalance); } }); -}); \ No newline at end of file +}); diff --git a/test/specs/mainnet/transactionHistory/xdai.spec.js b/test/specs/mainnet/transactionHistory/xdai.spec.js index 1ed85e7..81443db 100644 --- a/test/specs/mainnet/transactionHistory/xdai.spec.js +++ b/test/specs/mainnet/transactionHistory/xdai.spec.js @@ -22,7 +22,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -31,15 +30,19 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.xdai_chainid), - bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY) - }, + bundlerProvider: new EtherspotBundler( + Number(data.xdai_chainid), + process.env.BUNDLER_API_KEY + ), + } ); try { assert.strictEqual( xdaiMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -61,7 +64,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction assert.strictEqual( xdaiEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -71,16 +75,12 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction console.error(e.message); const eString = e.toString(); addContext(test, eString); - assert.fail( - message.fail_smart_address - ); + assert.fail(message.fail_smart_address); } // initializating Data service... try { - xdaiDataService = new DataUtils( - process.env.DATA_API_KEY - ); + xdaiDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -131,7 +131,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -185,9 +184,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -226,7 +225,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.chainId, - message.vali_getTransaction_chainId); + message.vali_getTransaction_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -236,7 +236,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.hash, - message.vali_getTransaction_hash); + message.vali_getTransaction_hash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -246,7 +247,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.nonce, - message.vali_getTransaction_nonce); + message.vali_getTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -256,7 +258,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.blockHash, - message.vali_getTransaction_blockHash); + message.vali_getTransaction_blockHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -266,7 +269,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.blockNumber, - message.vali_getTransaction_blockNumber); + message.vali_getTransaction_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -276,7 +280,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.from, - message.vali_getTransaction_from); + message.vali_getTransaction_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -286,7 +291,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.to, - message.vali_getTransaction_to); + message.vali_getTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -296,7 +302,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.value, - message.vali_getTransaction_value); + message.vali_getTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -306,7 +313,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.gasPrice, - message.vali_getTransaction_gasPrice); + message.vali_getTransaction_gasPrice + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -316,7 +324,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.gasLimit, - message.vali_getTransaction_gasLimit); + message.vali_getTransaction_gasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -326,7 +335,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.input, - message.vali_getTransaction_input); + message.vali_getTransaction_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -336,7 +346,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.status, - message.vali_getTransaction_status); + message.vali_getTransaction_status + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -346,7 +357,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.blockExplorerUrl, - message.vali_getTransaction_blockExplorerUrl); + message.vali_getTransaction_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -356,7 +368,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.transactionIndex, - message.vali_getTransaction_transactionIndex); + message.vali_getTransaction_transactionIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -366,7 +379,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.gasUsed, - message.vali_getTransaction_gasUsed); + message.vali_getTransaction_gasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -376,7 +390,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].transactionIndex, - message.vali_getTransaction_log_transactionIndex); + message.vali_getTransaction_log_transactionIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -386,7 +401,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].blockNumber, - message.vali_getTransaction_log_blockNumber); + message.vali_getTransaction_log_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -396,7 +412,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].transactionHash, - message.vali_getTransaction_log_transactionHash); + message.vali_getTransaction_log_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -406,7 +423,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].address, - message.vali_getTransaction_log_address); + message.vali_getTransaction_log_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -416,7 +434,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].topics, - message.vali_getTransaction_log_topics); + message.vali_getTransaction_log_topics + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -426,7 +445,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].data, - message.vali_getTransaction_log_data); + message.vali_getTransaction_log_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -436,7 +456,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].logIndex, - message.vali_getTransaction_log_logIndex); + message.vali_getTransaction_log_logIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -446,7 +467,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].blockHash, - message.vali_getTransaction_log_blockHash); + message.vali_getTransaction_log_blockHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -459,7 +481,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction assert.fail(message.fail_getTransaction_1); } } else { - addContext(test, message.vali_getTransaction_1) + addContext(test, message.vali_getTransaction_1); console.log(message.vali_getTransaction_1); } }, data.retry); // Retry this async test up to 5 times @@ -472,7 +494,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // Fetching historical transactions @@ -482,16 +503,18 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { transactions = await xdaiDataService.getTransactions({ chainId: Number(data.xdai_chainid), - account: data.sender + account: data.sender, }); randomTransaction = - Math.floor(Math.random() * (transactions.transactions.length - 1)) + 1; + Math.floor(Math.random() * (transactions.transactions.length - 1)) + + 1; try { assert.isNumber( transactions.transactions[randomTransaction].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -501,7 +524,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -511,7 +535,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -521,7 +546,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -531,7 +557,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -541,7 +568,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -551,7 +579,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -561,7 +590,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -571,7 +601,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -581,7 +612,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -591,7 +623,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -601,7 +634,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -611,7 +645,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -621,7 +656,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -631,7 +667,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -641,7 +678,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -651,7 +689,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].preVerificationGas, - message.vali_getTransactions_preVerificationGas); + message.vali_getTransactions_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -661,7 +700,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -671,7 +711,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -693,7 +734,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -747,9 +787,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -774,7 +814,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } // wait for the 10 seconds - helper.wait(10000) + helper.wait(10000); // Fetching historical transactions let transactions; @@ -783,14 +823,15 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.xdai_chainid), account: data.sender, page: 1, - limit: 10 + limit: 10, }); if (userOpsReceipt != null) { try { assert.isNumber( transactions.transactions[0].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -800,7 +841,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].blockNumber, - message.vali_getTransactions_blockNumber); + message.vali_getTransactions_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -810,7 +852,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -820,7 +863,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].target, - message.vali_getTransactions_target); + message.vali_getTransactions_target + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -830,7 +874,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -840,7 +885,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -850,7 +896,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -860,7 +907,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -870,7 +918,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -880,7 +929,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -890,7 +940,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -900,7 +951,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -910,7 +962,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -920,7 +973,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -930,7 +984,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -940,7 +995,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -950,7 +1006,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -960,7 +1017,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -970,7 +1028,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].preVerificationGas, - 'The preVerificationGas value is empty in the get transactions response.'); + 'The preVerificationGas value is empty in the get transactions response.' + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -980,7 +1039,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -990,7 +1050,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1000,7 +1061,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1010,7 +1072,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].from, - message.vali_getTransactions_nativeTransfers_from); + message.vali_getTransactions_nativeTransfers_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1020,7 +1083,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].to, - message.vali_getTransactions_nativeTransfers_to); + message.vali_getTransactions_nativeTransfers_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1030,7 +1094,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].value, - message.vali_getTransactions_nativeTransfers_value); + message.vali_getTransactions_nativeTransfers_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1040,7 +1105,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].asset, - message.vali_getTransactions_nativeTransfers_asset); + message.vali_getTransactions_nativeTransfers_asset + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1050,7 +1116,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].address, - message.vali_getTransactions_nativeTransfers_address); + message.vali_getTransactions_nativeTransfers_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1060,7 +1127,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nativeTransfers[0].decimal, - message.vali_getTransactions_nativeTransfers_decimal); + message.vali_getTransactions_nativeTransfers_decimal + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1070,15 +1138,16 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].data, - message.vali_getTransactions_nativeTransfers_data); + message.vali_getTransactions_nativeTransfers_data + ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); } } else { - addContext(test, message.vali_getTransactions_1) - console.log(message.vali_getTransactions_1) + addContext(test, message.vali_getTransactions_1); + console.log(message.vali_getTransactions_1); } } catch (e) { console.error(e); @@ -1096,14 +1165,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1117,7 +1186,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1141,7 +1211,11 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1191,9 +1265,9 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1218,7 +1292,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } // wait for the 10 seconds - helper.wait(10000) + helper.wait(10000); // Fetching historical transactions let transactions; @@ -1227,14 +1301,15 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.xdai_chainid), account: data.sender, page: 1, - limit: 10 + limit: 10, }); if (userOpsReceipt != null) { try { assert.isNumber( transactions.transactions[0].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1244,7 +1319,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].blockNumber, - message.vali_getTransactions_blockNumber); + message.vali_getTransactions_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1254,7 +1330,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1264,7 +1341,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].target, - message.vali_getTransactions_target); + message.vali_getTransactions_target + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1274,7 +1352,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1284,7 +1363,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1294,7 +1374,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1304,7 +1385,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1314,7 +1396,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1324,7 +1407,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1334,7 +1418,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1344,7 +1429,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1354,7 +1440,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1364,7 +1451,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1374,7 +1462,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1384,7 +1473,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1394,7 +1484,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1404,7 +1495,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1414,7 +1506,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].preVerificationGas, - message.vali_getTransactions_preVerificationGas); + message.vali_getTransactions_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1424,7 +1517,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1434,7 +1528,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1444,7 +1539,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1454,7 +1550,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].from, - message.vali_getTransactions_erc20Transfers_from); + message.vali_getTransactions_erc20Transfers_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1464,7 +1561,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].to, - message.vali_getTransactions_erc20Transfers_to); + message.vali_getTransactions_erc20Transfers_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1474,7 +1572,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].value, - message.vali_getTransactions_erc20Transfers_value); + message.vali_getTransactions_erc20Transfers_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1484,7 +1583,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].asset, - message.vali_getTransactions_erc20Transfers_asset); + message.vali_getTransactions_erc20Transfers_asset + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1494,7 +1594,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].address, - message.vali_getTransactions_erc20Transfers_address); + message.vali_getTransactions_erc20Transfers_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1504,7 +1605,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].erc20Transfers[0].decimal, - message.vali_getTransactions_erc20Transfers_decimal); + message.vali_getTransactions_erc20Transfers_decimal + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1514,15 +1616,16 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].data, - message.vali_getTransactions_erc20Transfers_data); + message.vali_getTransactions_erc20Transfers_data + ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); } } else { - addContext(test, message.vali_getTransactions_1) - console.log(message.vali_getTransactions_1) + addContext(test, message.vali_getTransactions_1); + console.log(message.vali_getTransactions_1); } } catch (e) { console.error(e); @@ -1540,9 +1643,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // Fetching a single transaction let transaction; try { @@ -1552,7 +1652,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction }); if (transaction === null || Object.keys(transaction).length === 0) { - addContext(test, message.vali_getTransactions_2) + addContext(test, message.vali_getTransactions_2); console.log(message.vali_getTransactions_2); } else { addContext(test, message.fail_getTransactions_6); @@ -1574,9 +1674,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // Fetching a single transaction try { await xdaiDataService.getTransaction({ @@ -1584,11 +1681,11 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.xdai_chainid), }); - addContext(test, message.fail_getTransactions_7) + addContext(test, message.fail_getTransactions_7); assert.fail(message.fail_getTransactions_7); } catch (e) { if (e.errors[0].constraints.isHex === constant.hash_32) { - addContext(test, message.vali_getTransactions_3) + addContext(test, message.vali_getTransactions_3); console.log(message.vali_getTransactions_3); } else { console.error(e); @@ -1607,9 +1704,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let transactions = await xdaiDataService.getTransactions({ chainId: Number(data.invalid_xdai_chainid), @@ -1617,7 +1711,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction }); if (transactions.transactions.length === 0) { - addContext(test, message.vali_getTransactions_4) + addContext(test, message.vali_getTransactions_4); console.log(message.vali_getTransactions_4); } else { addContext(test, message.fail_getTransactions_8); @@ -1639,21 +1733,21 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let a = await xdaiDataService.getTransactions({ chainId: Number(data.xdai_chainid), account: data.invalidSender, }); - addContext(test, message.fail_getTransactions_10) + addContext(test, message.fail_getTransactions_10); assert.fail(message.fail_getTransactions_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_getTransactions_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_getTransactions_6); console.log(message.vali_getTransactions_6); } else { console.error(e); @@ -1672,21 +1766,21 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await xdaiDataService.getTransactions({ chainId: Number(data.xdai_chainid), account: data.incorrectSender, }); - addContext(test, message.fail_getTransactions_11) + addContext(test, message.fail_getTransactions_11); assert.fail(message.fail_getTransactions_11); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_getTransactions_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_getTransactions_7); console.log(message.vali_getTransactions_7); } else { console.error(e); diff --git a/test/specs/mainnet/transferringFunds/arbitrum.spec.js b/test/specs/mainnet/transferringFunds/arbitrum.spec.js index d9c6253..69540a5 100644 --- a/test/specs/mainnet/transferringFunds/arbitrum.spec.js +++ b/test/specs/mainnet/transferringFunds/arbitrum.spec.js @@ -23,7 +23,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -32,14 +31,19 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.arbitrum_chainid), - bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY) - }); + bundlerProvider: new EtherspotBundler( + Number(data.arbitrum_chainid), + process.env.BUNDLER_API_KEY + ), + } + ); try { assert.strictEqual( arbitrumMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -61,7 +65,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN assert.strictEqual( arbitrumEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -76,8 +81,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN // initializating Data service... try { - arbitrumDataService = new DataUtils( - process.env.DATA_API_KEY); + arbitrumDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -128,7 +132,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -152,7 +155,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -162,7 +166,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -172,7 +177,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -191,9 +197,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN balance = await arbitrumMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -214,7 +218,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -222,9 +227,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -234,7 +237,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -244,7 +248,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -254,7 +259,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -264,7 +270,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -274,7 +281,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -284,7 +292,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -294,7 +303,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -304,7 +314,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -314,7 +325,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -333,9 +345,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN uoHash = await arbitrumMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -344,9 +354,9 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -363,19 +373,20 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); try { assert.isTrue( provider._isProvider, - message.vali_erc20Transfer_provider); + message.vali_erc20Transfer_provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -394,7 +405,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -408,9 +420,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN decimals = await erc20Instance.functions.decimals(); try { - assert.isNotEmpty( - decimals, - message.vali_erc20Contract_decimals); + assert.isNotEmpty(decimals, message.vali_erc20Contract_decimals); } catch (e) { console.error(e); const eString = e.toString(); @@ -428,12 +438,17 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); try { assert.isNotEmpty( transactionData, - message.vali_erc20Contract_transferFrom); + message.vali_erc20Contract_transferFrom + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -465,9 +480,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN }); try { - assert.isNotEmpty( - userOpsBatch.to, - message.vali_addTransaction_to); + assert.isNotEmpty(userOpsBatch.to, message.vali_addTransaction_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -477,7 +490,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( userOpsBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -487,7 +501,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( userOpsBatch.value[0], - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -508,7 +523,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -516,9 +532,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -528,7 +542,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -538,7 +553,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -548,7 +564,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -558,7 +575,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -568,7 +586,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -578,7 +597,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -588,7 +608,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -598,7 +619,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -608,7 +630,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -627,9 +650,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN uoHash = await arbitrumMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -638,9 +659,9 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -657,7 +678,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get erc721 Contract Interface @@ -675,7 +695,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( erc721Data, - message.vali_erc721Transfer_contractInterface); + message.vali_erc721Transfer_contractInterface + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -709,7 +730,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( userOpsBatch.to[0], - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -719,7 +741,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( userOpsBatch.data[0], - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -729,7 +752,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( userOpsBatch.value[0], - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -750,7 +774,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -758,9 +783,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -770,7 +793,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -780,7 +804,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -790,7 +815,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -800,7 +826,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -810,7 +837,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -820,7 +848,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -830,7 +859,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -840,7 +870,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -850,7 +881,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -869,9 +901,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN uoHash = await arbitrumMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -880,9 +910,9 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -899,7 +929,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -923,7 +952,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -933,7 +963,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -943,7 +974,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -962,9 +994,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN balance = await arbitrumMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -986,7 +1016,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -994,9 +1025,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -1006,7 +1035,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1016,7 +1046,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1026,7 +1057,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1036,7 +1068,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1046,7 +1079,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1056,7 +1090,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1066,7 +1101,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1076,7 +1112,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1086,7 +1123,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1105,9 +1143,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN uoHash = await arbitrumMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -1116,9 +1152,9 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1136,9 +1172,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { - await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); const provider = new providers.JsonRpcProvider(); @@ -1164,7 +1198,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1174,7 +1209,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1184,7 +1220,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1203,9 +1240,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN balance = await arbitrumMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -1226,11 +1261,13 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { while (--concurrentUseropsCount >= 0) { - const op = await arbitrumMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await arbitrumMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await arbitrumMainNetSdk.send(op); uoHashes.push(uoHash); @@ -1238,9 +1275,9 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1252,30 +1289,34 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await arbitrumMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await arbitrumMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -1287,9 +1328,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1326,12 +1364,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await arbitrumMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_9) + addContext(test, message.fail_estimateTransaction_9); assert.fail(message.fail_estimateTransaction_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1350,9 +1388,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1389,12 +1424,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await arbitrumMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_10) + addContext(test, message.fail_estimateTransaction_10); assert.fail(message.fail_estimateTransaction_10); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_9) + addContext(test, message.vali_estimateTransaction_9); console.log(message.vali_estimateTransaction_9); } else { console.error(e); @@ -1413,9 +1448,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1432,11 +1464,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN value: ethers.utils.parseUnits(data.invalidValue), // invalid value }); - addContext(test, message.fail_estimateTransaction_11) + addContext(test, message.fail_estimateTransaction_11); assert.fail(message.fail_estimateTransaction_11); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_estimateTransaction_10) + addContext(test, message.vali_estimateTransaction_10); console.log(message.vali_estimateTransaction_10); } else { console.error(e); @@ -1455,9 +1487,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1474,11 +1503,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN value: ethers.utils.parseUnits(data.smallValue), // very small value }); - addContext(test, message.fail_estimateTransaction_12) + addContext(test, message.fail_estimateTransaction_12); assert.fail(message.fail_estimateTransaction_12); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_estimateTransaction_11) + addContext(test, message.vali_estimateTransaction_11); console.log(message.vali_estimateTransaction_11); } else { console.error(e); @@ -1497,9 +1526,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1524,11 +1550,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await arbitrumMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -1547,9 +1573,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1587,12 +1610,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await arbitrumMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_9) + addContext(test, message.fail_estimateTransaction_9); assert.fail(message.fail_estimateTransaction_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1611,9 +1634,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1651,12 +1671,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await arbitrumMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_10) + addContext(test, message.fail_estimateTransaction_10); assert.fail(message.fail_estimateTransaction_10); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1675,9 +1695,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await arbitrumMainNetSdk.clearUserOpsFromBatch(); @@ -1703,11 +1720,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await arbitrumMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.empty_batch) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -1726,14 +1743,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.invalidProviderNetwork_arbitrum, // invalid provider + data.invalidProviderNetwork_arbitrum // invalid provider ); } catch (e) { console.error(e); @@ -1748,7 +1762,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1760,11 +1775,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_14) + addContext(test, message.fail_estimateTransaction_14); assert.fail(message.fail_estimateTransaction_14); } catch (e) { if (e.reason === constant.invalid_network_2) { - addContext(test, message.vali_estimateTransaction_13) + addContext(test, message.vali_estimateTransaction_13); console.log(message.vali_estimateTransaction_13); } else { console.error(e); @@ -1783,9 +1798,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { @@ -1803,7 +1815,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1815,11 +1828,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_14) + addContext(test, message.fail_estimateTransaction_14); assert.fail(message.fail_estimateTransaction_14); } catch (e) { if (e.reason === constant.invalid_network_2) { - addContext(test, message.vali_estimateTransaction_13) + addContext(test, message.vali_estimateTransaction_13); console.log(message.vali_estimateTransaction_13); } else { console.error(e); @@ -1838,14 +1851,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.otherProviderNetwork_arbitrum, // other provider + data.otherProviderNetwork_arbitrum // other provider ); } catch (e) { console.error(e); @@ -1860,7 +1870,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1872,12 +1883,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_15) + addContext(test, message.fail_estimateTransaction_15); assert.fail(message.fail_estimateTransaction_15); } catch (e) { let error = e.message; if (error.includes(constant.invalid_value_3)) { - addContext(test, message.vali_estimateTransaction_14) + addContext(test, message.vali_estimateTransaction_14); console.log(message.vali_estimateTransaction_14); } else { console.error(e); @@ -1896,14 +1907,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1917,7 +1926,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.incorrectTokenAddress_arbitrumUSDC, // incorrect token address ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1929,11 +1939,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await erc20Instance.functions.decimals(); - addContext(message.fail_erc20Transfer_1) + addContext(message.fail_erc20Transfer_1); assert.fail(message.fail_erc20Transfer_1); } catch (e) { if (e.reason === constant.invalid_address_6) { - addContext(test, message.vali_erc20Transfer_1) + addContext(test, message.vali_erc20Transfer_1); console.log(message.vali_erc20Transfer_1); } else { console.error(e); @@ -1952,14 +1962,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1973,7 +1981,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.invalidTokenAddress_arbitrumUSDC, // invalid token address ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1985,11 +1994,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_erc20Transfer_2) + addContext(test, message.fail_erc20Transfer_2); assert.fail(message.fail_erc20Transfer_2); } catch (e) { if (e.reason === constant.invalid_address_4) { - addContext(test, message.vali_erc20Transfer_2) + addContext(test, message.vali_erc20Transfer_2); console.log(message.vali_erc20Transfer_2); } else { console.error(e); @@ -2008,14 +2017,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2027,11 +2034,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { new ethers.Contract(null, ERC20_ABI, provider); // null token address - addContext(test, message.fail_erc20Transfer_3) + addContext(test, message.fail_erc20Transfer_3); assert.fail(message.fail_erc20Transfer_3); } catch (e) { if (e.reason === constant.contract_address_2) { - addContext(test, message.vali_erc20Transfer_3) + addContext(test, message.vali_erc20Transfer_3); console.log(message.vali_erc20Transfer_3); } else { console.error(e); @@ -2050,14 +2057,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2071,7 +2076,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2097,11 +2103,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_4) + addContext(test, message.fail_erc20Transfer_4); assert.fail(message.fail_erc20Transfer_4); } catch (e) { if (e.reason === constant.no_function) { - addContext(test, message.vali_erc20Transfer_4) + addContext(test, message.vali_erc20Transfer_4); console.log(message.vali_erc20Transfer_4); } else { console.error(e); @@ -2120,14 +2126,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2141,7 +2145,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2167,11 +2172,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN ethers.utils.parseUnits(data.invalidValue, decimals), // invalid value ]); - addContext(test, message.fail_erc20Transfer_5) + addContext(test, message.fail_erc20Transfer_5); assert.fail(message.fail_erc20Transfer_5); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_erc20Transfer_5) + addContext(test, message.vali_erc20Transfer_5); console.log(message.vali_erc20Transfer_5); } else { console.error(e); @@ -2190,14 +2195,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2211,7 +2214,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2237,11 +2241,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN ethers.utils.parseUnits(data.smallValue, decimals), // very small value ]); - addContext(test, message.fail_erc20Transfer_6) + addContext(test, message.fail_erc20Transfer_6); assert.fail(message.fail_erc20Transfer_6); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_erc20Transfer_6) + addContext(test, message.vali_erc20Transfer_6); console.log(message.vali_erc20Transfer_6); } else { console.error(e); @@ -2260,14 +2264,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2281,7 +2283,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2305,11 +2308,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN data.recipient, ]); - addContext(test, message.fail_erc20Transfer_7) + addContext(test, message.fail_erc20Transfer_7); assert.fail(message.fail_erc20Transfer_7); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc20Transfer_7) + addContext(test, message.vali_erc20Transfer_7); console.log(message.vali_erc20Transfer_7); } else { console.error(e); @@ -2328,14 +2331,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2349,7 +2350,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2375,12 +2377,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_8) + addContext(test, message.fail_erc20Transfer_8); assert.fail(message.fail_erc20Transfer_8); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc20Transfer_8) + addContext(test, message.vali_erc20Transfer_8); console.log(message.vali_erc20Transfer_8); } else { console.error(e); @@ -2399,14 +2401,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2420,7 +2420,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2446,12 +2447,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_9) + addContext(test, message.fail_erc20Transfer_9); assert.fail(message.fail_erc20Transfer_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc20Transfer_9) + addContext(test, message.vali_erc20Transfer_9); console.log(message.vali_erc20Transfer_9); } else { console.error(e); @@ -2470,14 +2471,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2491,7 +2490,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2516,11 +2516,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_10) + addContext(test, message.fail_erc20Transfer_10); assert.fail(message.fail_erc20Transfer_10); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc20Transfer_10) + addContext(test, message.vali_erc20Transfer_10); console.log(message.vali_erc20Transfer_10); } else { console.error(e); @@ -2539,14 +2539,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2560,7 +2558,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2584,7 +2583,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2619,12 +2622,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await arbitrumMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_16) + addContext(test, message.fail_estimateTransaction_16); assert.fail(message.fail_estimateTransaction_16); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_15) + addContext(test, message.vali_estimateTransaction_15); console.log(message.vali_estimateTransaction_15); } else { console.error(e); @@ -2643,14 +2646,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2664,7 +2665,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2688,7 +2690,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2723,12 +2729,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await arbitrumMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_17) + addContext(test, message.fail_estimateTransaction_17); assert.fail(message.fail_estimateTransaction_17); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_16) + addContext(test, message.vali_estimateTransaction_16); console.log(message.vali_estimateTransaction_16); } else { console.error(e); @@ -2747,14 +2753,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2768,7 +2772,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2792,7 +2797,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2827,11 +2836,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await arbitrumMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_18) + addContext(test, message.fail_estimateTransaction_18); assert.fail(message.fail_estimateTransaction_18); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_17) + addContext(test, message.vali_estimateTransaction_17); console.log(message.vali_estimateTransaction_17); } else { console.error(e); @@ -2850,14 +2859,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2871,7 +2878,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2895,7 +2903,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2929,11 +2941,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await arbitrumMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_19) + addContext(test, message.fail_estimateTransaction_19); assert.fail(message.fail_estimateTransaction_19); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_18) + addContext(test, message.vali_estimateTransaction_18); console.log(message.vali_estimateTransaction_18); } else { console.error(e); @@ -2952,14 +2964,12 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_arbitrum); + data.providerNetwork_arbitrum + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2973,7 +2983,8 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_arbitrumUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -3022,7 +3033,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -3041,9 +3052,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3055,11 +3063,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_1) + addContext(test, message.fail_erc721Transfer_1); assert.fail(message.fail_erc721Transfer_1); } catch (e) { if (e.reason.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc721Transfer_1) + addContext(test, message.vali_erc721Transfer_1); console.log(message.vali_erc721Transfer_1); } else { console.error(e); @@ -3078,9 +3086,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3092,11 +3097,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_2) + addContext(test, message.fail_erc721Transfer_2); assert.fail(message.fail_erc721Transfer_2); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc721Transfer_2) + addContext(test, message.vali_erc721Transfer_2); console.log(message.vali_erc721Transfer_2); } else { console.error(e); @@ -3115,9 +3120,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3128,11 +3130,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_3) + addContext(test, message.fail_erc721Transfer_3); assert.fail(message.fail_erc721Transfer_3); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_3) + addContext(test, message.vali_erc721Transfer_3); console.log(message.vali_erc721Transfer_3); } else { console.error(e); @@ -3151,9 +3153,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3165,11 +3164,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_4) + addContext(test, message.fail_erc721Transfer_4); assert.fail(message.fail_erc721Transfer_4); } catch (e) { if (e.reason.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc721Transfer_4) + addContext(test, message.vali_erc721Transfer_4); console.log(message.vali_erc721Transfer_4); } else { console.error(e); @@ -3188,9 +3187,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3202,11 +3198,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_5) + addContext(test, message.fail_erc721Transfer_5); assert.fail(message.fail_erc721Transfer_5); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc721Transfer_5) + addContext(test, message.vali_erc721Transfer_5); console.log(message.vali_erc721Transfer_5); } else { console.error(e); @@ -3225,9 +3221,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3238,11 +3231,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_6) + addContext(test, message.fail_erc721Transfer_6); assert.fail(message.fail_erc721Transfer_6); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_6) + addContext(test, message.vali_erc721Transfer_6); console.log(message.vali_erc721Transfer_6); } else { console.error(e); @@ -3261,9 +3254,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3275,11 +3265,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN data.incorrectTokenId, // incorrect tokenid ]); - addContext(message.fail_erc721Transfer_7) + addContext(message.fail_erc721Transfer_7); assert.fail(message.fail_erc721Transfer_7); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_erc721Transfer_7) + addContext(test, message.vali_erc721Transfer_7); console.log(message.vali_erc721Transfer_7); } else { console.error(e); @@ -3298,9 +3288,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3311,11 +3298,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN data.recipient, // not added tokenid ]); - addContext(test, message.fail_erc721Transfer_8) + addContext(test, message.fail_erc721Transfer_8); assert.fail(message.fail_erc721Transfer_8); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_8) + addContext(test, message.vali_erc721Transfer_8); console.log(message.vali_erc721Transfer_8); } else { console.error(e); @@ -3334,9 +3321,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3378,11 +3362,11 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { await arbitrumMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -3402,11 +3386,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); // clear the transaction batch @@ -3437,7 +3417,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN let balance; try { balance = await arbitrumMainNetSdk.getNativeBalance(); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3453,11 +3432,13 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { while (--concurrentUseropsCount >= 0) { - const op = await arbitrumMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await arbitrumMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await arbitrumMainNetSdk.send(op); uoHashes.push(uoHash); @@ -3465,9 +3446,9 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3479,30 +3460,34 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await arbitrumMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await arbitrumMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -3515,11 +3500,7 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); // clear the transaction batch @@ -3539,7 +3520,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN to: data.recipient, value: ethers.utils.parseEther(data.value), }); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3551,7 +3531,6 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN let balance; try { balance = await arbitrumMainNetSdk.getNativeBalance(); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3567,11 +3546,13 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN try { while (--concurrentUseropsCount >= 0) { - const op = await arbitrumMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await arbitrumMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await arbitrumMainNetSdk.send(op); uoHashes.push(uoHash); @@ -3579,9 +3560,9 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3593,30 +3574,34 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await arbitrumMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await arbitrumMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -3627,26 +3612,22 @@ describe('The PrimeSDK, when transfer a token with arbitrum network on the MainN it('REGRESSION: Perform the concurrent userops with non deployed address on the arbitrum network', async function () { var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); try { if ((await provider.getCode(data.eoaAddress)).length <= 2) { - addContext(test, message.vali_deployAddress_1) + addContext(test, message.vali_deployAddress_1); console.log(message.vali_deployAddress_1); return; } - addContext(test, message.fail_deployAddress_1) - assert.fail(message.fail_deployAddress_1) + addContext(test, message.fail_deployAddress_1); + assert.fail(message.fail_deployAddress_1); } catch (e) { const errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_2)) { - addContext(test, message.vali_deployAddress_2) + addContext(test, message.vali_deployAddress_2); console.log(message.vali_deployAddress_2); } else { console.error(e); diff --git a/test/specs/mainnet/transferringFunds/matic.spec.js b/test/specs/mainnet/transferringFunds/matic.spec.js index 2124896..a193e1a 100644 --- a/test/specs/mainnet/transferringFunds/matic.spec.js +++ b/test/specs/mainnet/transferringFunds/matic.spec.js @@ -23,7 +23,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -32,14 +31,19 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.matic_chainid), - bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY) - }); + bundlerProvider: new EtherspotBundler( + Number(data.matic_chainid), + process.env.BUNDLER_API_KEY + ), + } + ); try { assert.strictEqual( maticMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -61,7 +65,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' assert.strictEqual( maticEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -76,8 +81,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' // initializating Data service... try { - maticDataService = new DataUtils( - process.env.DATA_API_KEY); + maticDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -128,7 +132,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -152,7 +155,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -162,7 +166,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -172,7 +177,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -191,9 +197,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' balance = await maticMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -214,7 +218,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -222,9 +227,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -234,7 +237,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -244,7 +248,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -254,7 +259,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -264,7 +270,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -274,7 +281,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -284,7 +292,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -294,7 +303,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -304,7 +314,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -314,7 +325,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -333,9 +345,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' uoHash = await maticMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -344,9 +354,9 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -363,19 +373,20 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); try { assert.isTrue( provider._isProvider, - message.vali_erc20Transfer_provider); + message.vali_erc20Transfer_provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -394,7 +405,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -408,9 +420,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' decimals = await erc20Instance.functions.decimals(); try { - assert.isNotEmpty( - decimals, - message.vali_erc20Contract_decimals); + assert.isNotEmpty(decimals, message.vali_erc20Contract_decimals); } catch (e) { console.error(e); const eString = e.toString(); @@ -428,12 +438,17 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); try { assert.isNotEmpty( transactionData, - message.vali_erc20Contract_transferFrom); + message.vali_erc20Contract_transferFrom + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -465,9 +480,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' }); try { - assert.isNotEmpty( - userOpsBatch.to, - message.vali_addTransaction_to); + assert.isNotEmpty(userOpsBatch.to, message.vali_addTransaction_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -477,7 +490,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( userOpsBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -487,7 +501,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( userOpsBatch.value[0], - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -508,7 +523,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -516,9 +532,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -528,7 +542,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -538,7 +553,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -548,7 +564,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -558,7 +575,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -568,7 +586,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -578,7 +597,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -588,7 +608,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -598,7 +619,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -608,7 +630,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -627,9 +650,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' uoHash = await maticMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -638,9 +659,9 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -657,7 +678,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get erc721 Contract Interface @@ -675,7 +695,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( erc721Data, - message.vali_erc721Transfer_contractInterface); + message.vali_erc721Transfer_contractInterface + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -709,7 +730,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( userOpsBatch.to[0], - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -719,7 +741,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( userOpsBatch.data[0], - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -729,7 +752,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( userOpsBatch.value[0], - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -750,7 +774,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -758,9 +783,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -770,7 +793,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -780,7 +804,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -790,7 +815,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -800,7 +826,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -810,7 +837,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -820,7 +848,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -830,7 +859,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -840,7 +870,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -850,7 +881,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -869,9 +901,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' uoHash = await maticMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -880,9 +910,9 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -899,7 +929,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -923,7 +952,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -933,7 +963,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -943,7 +974,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -962,9 +994,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' balance = await maticMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -986,7 +1016,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -994,9 +1025,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -1006,7 +1035,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1016,7 +1046,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1026,7 +1057,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1036,7 +1068,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1046,7 +1079,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1056,7 +1090,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1066,7 +1101,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1076,7 +1112,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1086,7 +1123,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1105,9 +1143,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' uoHash = await maticMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -1116,9 +1152,9 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1136,9 +1172,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { - await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); const provider = new providers.JsonRpcProvider(); @@ -1164,7 +1198,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1174,7 +1209,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1184,7 +1220,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1203,9 +1240,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' balance = await maticMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -1226,11 +1261,13 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { while (--concurrentUseropsCount >= 0) { - const op = await maticMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await maticMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await maticMainNetSdk.send(op); uoHashes.push(uoHash); @@ -1238,9 +1275,9 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1252,30 +1289,34 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await maticMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await maticMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -1287,9 +1328,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1326,12 +1364,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await maticMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_9) + addContext(test, message.fail_estimateTransaction_9); assert.fail(message.fail_estimateTransaction_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1350,9 +1388,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1389,12 +1424,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await maticMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_10) + addContext(test, message.fail_estimateTransaction_10); assert.fail(message.fail_estimateTransaction_10); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_9) + addContext(test, message.vali_estimateTransaction_9); console.log(message.vali_estimateTransaction_9); } else { console.error(e); @@ -1413,9 +1448,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1432,11 +1464,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' value: ethers.utils.parseUnits(data.invalidValue), // invalid value }); - addContext(test, message.fail_estimateTransaction_11) + addContext(test, message.fail_estimateTransaction_11); assert.fail(message.fail_estimateTransaction_11); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_estimateTransaction_10) + addContext(test, message.vali_estimateTransaction_10); console.log(message.vali_estimateTransaction_10); } else { console.error(e); @@ -1455,9 +1487,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1474,11 +1503,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' value: ethers.utils.parseUnits(data.smallValue), // very small value }); - addContext(test, message.fail_estimateTransaction_12) + addContext(test, message.fail_estimateTransaction_12); assert.fail(message.fail_estimateTransaction_12); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_estimateTransaction_11) + addContext(test, message.vali_estimateTransaction_11); console.log(message.vali_estimateTransaction_11); } else { console.error(e); @@ -1497,9 +1526,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1524,11 +1550,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await maticMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -1547,9 +1573,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1587,12 +1610,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await maticMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_9) + addContext(test, message.fail_estimateTransaction_9); assert.fail(message.fail_estimateTransaction_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1611,9 +1634,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1651,12 +1671,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await maticMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_10) + addContext(test, message.fail_estimateTransaction_10); assert.fail(message.fail_estimateTransaction_10); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1675,9 +1695,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await maticMainNetSdk.clearUserOpsFromBatch(); @@ -1703,11 +1720,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await maticMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.empty_batch) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -1726,14 +1743,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.invalidProviderNetwork_matic, // invalid provider + data.invalidProviderNetwork_matic // invalid provider ); } catch (e) { console.error(e); @@ -1748,7 +1762,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1760,11 +1775,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_14) + addContext(test, message.fail_estimateTransaction_14); assert.fail(message.fail_estimateTransaction_14); } catch (e) { if (e.reason === constant.invalid_network_2) { - addContext(test, message.vali_estimateTransaction_13) + addContext(test, message.vali_estimateTransaction_13); console.log(message.vali_estimateTransaction_13); } else { console.error(e); @@ -1783,9 +1798,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { @@ -1803,7 +1815,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1815,11 +1828,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_14) + addContext(test, message.fail_estimateTransaction_14); assert.fail(message.fail_estimateTransaction_14); } catch (e) { if (e.reason === constant.invalid_network_2) { - addContext(test, message.vali_estimateTransaction_13) + addContext(test, message.vali_estimateTransaction_13); console.log(message.vali_estimateTransaction_13); } else { console.error(e); @@ -1838,14 +1851,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.otherProviderNetwork_matic, // other provider + data.otherProviderNetwork_matic // other provider ); } catch (e) { console.error(e); @@ -1860,7 +1870,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1872,12 +1883,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_15) + addContext(test, message.fail_estimateTransaction_15); assert.fail(message.fail_estimateTransaction_15); } catch (e) { let error = e.message; if (error.includes(constant.invalid_value_3)) { - addContext(test, message.vali_estimateTransaction_14) + addContext(test, message.vali_estimateTransaction_14); console.log(message.vali_estimateTransaction_14); } else { console.error(e); @@ -1896,14 +1907,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1917,7 +1926,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.incorrectTokenAddress_maticUSDC, // incorrect token address ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1929,11 +1939,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await erc20Instance.functions.decimals(); - addContext(message.fail_erc20Transfer_1) + addContext(message.fail_erc20Transfer_1); assert.fail(message.fail_erc20Transfer_1); } catch (e) { if (e.reason === constant.invalid_address_6) { - addContext(test, message.vali_erc20Transfer_1) + addContext(test, message.vali_erc20Transfer_1); console.log(message.vali_erc20Transfer_1); } else { console.error(e); @@ -1952,14 +1962,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1973,7 +1981,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.invalidTokenAddress_maticUSDC, // invalid token address ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1985,11 +1994,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_erc20Transfer_2) + addContext(test, message.fail_erc20Transfer_2); assert.fail(message.fail_erc20Transfer_2); } catch (e) { if (e.reason === constant.invalid_address_4) { - addContext(test, message.vali_erc20Transfer_2) + addContext(test, message.vali_erc20Transfer_2); console.log(message.vali_erc20Transfer_2); } else { console.error(e); @@ -2008,14 +2017,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2027,11 +2034,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { new ethers.Contract(null, ERC20_ABI, provider); // null token address - addContext(test, message.fail_erc20Transfer_3) + addContext(test, message.fail_erc20Transfer_3); assert.fail(message.fail_erc20Transfer_3); } catch (e) { if (e.reason === constant.contract_address_2) { - addContext(test, message.vali_erc20Transfer_3) + addContext(test, message.vali_erc20Transfer_3); console.log(message.vali_erc20Transfer_3); } else { console.error(e); @@ -2050,14 +2057,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2071,7 +2076,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2097,11 +2103,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_4) + addContext(test, message.fail_erc20Transfer_4); assert.fail(message.fail_erc20Transfer_4); } catch (e) { if (e.reason === constant.no_function) { - addContext(test, message.vali_erc20Transfer_4) + addContext(test, message.vali_erc20Transfer_4); console.log(message.vali_erc20Transfer_4); } else { console.error(e); @@ -2120,14 +2126,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2141,7 +2145,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2167,11 +2172,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' ethers.utils.parseUnits(data.invalidValue, decimals), // invalid value ]); - addContext(test, message.fail_erc20Transfer_5) + addContext(test, message.fail_erc20Transfer_5); assert.fail(message.fail_erc20Transfer_5); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_erc20Transfer_5) + addContext(test, message.vali_erc20Transfer_5); console.log(message.vali_erc20Transfer_5); } else { console.error(e); @@ -2190,14 +2195,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2211,7 +2214,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2237,11 +2241,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' ethers.utils.parseUnits(data.smallValue, decimals), // very small value ]); - addContext(test, message.fail_erc20Transfer_6) + addContext(test, message.fail_erc20Transfer_6); assert.fail(message.fail_erc20Transfer_6); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_erc20Transfer_6) + addContext(test, message.vali_erc20Transfer_6); console.log(message.vali_erc20Transfer_6); } else { console.error(e); @@ -2260,14 +2264,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2281,7 +2283,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2305,11 +2308,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' data.recipient, ]); - addContext(test, message.fail_erc20Transfer_7) + addContext(test, message.fail_erc20Transfer_7); assert.fail(message.fail_erc20Transfer_7); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc20Transfer_7) + addContext(test, message.vali_erc20Transfer_7); console.log(message.vali_erc20Transfer_7); } else { console.error(e); @@ -2328,14 +2331,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2349,7 +2350,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2375,12 +2377,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_8) + addContext(test, message.fail_erc20Transfer_8); assert.fail(message.fail_erc20Transfer_8); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc20Transfer_8) + addContext(test, message.vali_erc20Transfer_8); console.log(message.vali_erc20Transfer_8); } else { console.error(e); @@ -2399,14 +2401,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2420,7 +2420,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2446,12 +2447,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_9) + addContext(test, message.fail_erc20Transfer_9); assert.fail(message.fail_erc20Transfer_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc20Transfer_9) + addContext(test, message.vali_erc20Transfer_9); console.log(message.vali_erc20Transfer_9); } else { console.error(e); @@ -2470,14 +2471,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2491,7 +2490,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2516,11 +2516,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_10) + addContext(test, message.fail_erc20Transfer_10); assert.fail(message.fail_erc20Transfer_10); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc20Transfer_10) + addContext(test, message.vali_erc20Transfer_10); console.log(message.vali_erc20Transfer_10); } else { console.error(e); @@ -2539,14 +2539,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2560,7 +2558,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2584,7 +2583,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2619,12 +2622,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await maticMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_16) + addContext(test, message.fail_estimateTransaction_16); assert.fail(message.fail_estimateTransaction_16); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_15) + addContext(test, message.vali_estimateTransaction_15); console.log(message.vali_estimateTransaction_15); } else { console.error(e); @@ -2643,14 +2646,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2664,7 +2665,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2688,7 +2690,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2723,12 +2729,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await maticMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_17) + addContext(test, message.fail_estimateTransaction_17); assert.fail(message.fail_estimateTransaction_17); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_16) + addContext(test, message.vali_estimateTransaction_16); console.log(message.vali_estimateTransaction_16); } else { console.error(e); @@ -2747,14 +2753,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2768,7 +2772,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2792,7 +2797,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2827,11 +2836,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await maticMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_18) + addContext(test, message.fail_estimateTransaction_18); assert.fail(message.fail_estimateTransaction_18); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_17) + addContext(test, message.vali_estimateTransaction_17); console.log(message.vali_estimateTransaction_17); } else { console.error(e); @@ -2850,14 +2859,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2871,7 +2878,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2895,7 +2903,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2929,11 +2941,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await maticMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_19) + addContext(test, message.fail_estimateTransaction_19); assert.fail(message.fail_estimateTransaction_19); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_18) + addContext(test, message.vali_estimateTransaction_18); console.log(message.vali_estimateTransaction_18); } else { console.error(e); @@ -2952,14 +2964,12 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_matic); + data.providerNetwork_matic + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2973,7 +2983,8 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' erc20Instance = new ethers.Contract( data.tokenAddress_maticUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -3022,7 +3033,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -3041,9 +3052,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3055,11 +3063,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_1) + addContext(test, message.fail_erc721Transfer_1); assert.fail(message.fail_erc721Transfer_1); } catch (e) { if (e.reason.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc721Transfer_1) + addContext(test, message.vali_erc721Transfer_1); console.log(message.vali_erc721Transfer_1); } else { console.error(e); @@ -3078,9 +3086,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3092,11 +3097,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_2) + addContext(test, message.fail_erc721Transfer_2); assert.fail(message.fail_erc721Transfer_2); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc721Transfer_2) + addContext(test, message.vali_erc721Transfer_2); console.log(message.vali_erc721Transfer_2); } else { console.error(e); @@ -3115,9 +3120,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3128,11 +3130,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_3) + addContext(test, message.fail_erc721Transfer_3); assert.fail(message.fail_erc721Transfer_3); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_3) + addContext(test, message.vali_erc721Transfer_3); console.log(message.vali_erc721Transfer_3); } else { console.error(e); @@ -3151,9 +3153,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3165,11 +3164,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_4) + addContext(test, message.fail_erc721Transfer_4); assert.fail(message.fail_erc721Transfer_4); } catch (e) { if (e.reason.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc721Transfer_4) + addContext(test, message.vali_erc721Transfer_4); console.log(message.vali_erc721Transfer_4); } else { console.error(e); @@ -3188,9 +3187,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3202,11 +3198,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_5) + addContext(test, message.fail_erc721Transfer_5); assert.fail(message.fail_erc721Transfer_5); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc721Transfer_5) + addContext(test, message.vali_erc721Transfer_5); console.log(message.vali_erc721Transfer_5); } else { console.error(e); @@ -3225,9 +3221,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3238,11 +3231,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_6) + addContext(test, message.fail_erc721Transfer_6); assert.fail(message.fail_erc721Transfer_6); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_6) + addContext(test, message.vali_erc721Transfer_6); console.log(message.vali_erc721Transfer_6); } else { console.error(e); @@ -3261,9 +3254,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3275,11 +3265,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' data.incorrectTokenId, // incorrect tokenid ]); - addContext(message.fail_erc721Transfer_7) + addContext(message.fail_erc721Transfer_7); assert.fail(message.fail_erc721Transfer_7); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_erc721Transfer_7) + addContext(test, message.vali_erc721Transfer_7); console.log(message.vali_erc721Transfer_7); } else { console.error(e); @@ -3298,9 +3288,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3311,11 +3298,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' data.recipient, // not added tokenid ]); - addContext(test, message.fail_erc721Transfer_8) + addContext(test, message.fail_erc721Transfer_8); assert.fail(message.fail_erc721Transfer_8); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_8) + addContext(test, message.vali_erc721Transfer_8); console.log(message.vali_erc721Transfer_8); } else { console.error(e); @@ -3334,9 +3321,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3378,11 +3362,11 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { await maticMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -3402,11 +3386,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); // clear the transaction batch @@ -3437,7 +3417,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' let balance; try { balance = await maticMainNetSdk.getNativeBalance(); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3453,11 +3432,13 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { while (--concurrentUseropsCount >= 0) { - const op = await maticMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await maticMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await maticMainNetSdk.send(op); uoHashes.push(uoHash); @@ -3465,9 +3446,9 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3479,30 +3460,34 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await maticMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await maticMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -3515,11 +3500,7 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); // clear the transaction batch @@ -3539,7 +3520,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' to: data.recipient, value: ethers.utils.parseEther(data.value), }); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3551,7 +3531,6 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' let balance; try { balance = await maticMainNetSdk.getNativeBalance(); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3567,11 +3546,13 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' try { while (--concurrentUseropsCount >= 0) { - const op = await maticMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await maticMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await maticMainNetSdk.send(op); uoHashes.push(uoHash); @@ -3579,9 +3560,9 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3593,30 +3574,34 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await maticMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await maticMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -3627,26 +3612,22 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' it('REGRESSION: Perform the concurrent userops with non deployed address on the matic network', async function () { var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); try { if ((await provider.getCode(data.eoaAddress)).length <= 2) { - addContext(test, message.vali_deployAddress_1) + addContext(test, message.vali_deployAddress_1); console.log(message.vali_deployAddress_1); return; } - addContext(test, message.fail_deployAddress_1) - assert.fail(message.fail_deployAddress_1) + addContext(test, message.fail_deployAddress_1); + assert.fail(message.fail_deployAddress_1); } catch (e) { const errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_2)) { - addContext(test, message.vali_deployAddress_2) + addContext(test, message.vali_deployAddress_2); console.log(message.vali_deployAddress_2); } else { console.error(e); @@ -3660,4 +3641,4 @@ describe('The PrimeSDK, when transfer a token with matic network on the MainNet' console.warn(message.nativeTransaction_insufficientBalance); } }); -}); \ No newline at end of file +}); diff --git a/test/specs/mainnet/transferringFunds/optimism.spec.js b/test/specs/mainnet/transferringFunds/optimism.spec.js index 912804e..a634439 100644 --- a/test/specs/mainnet/transferringFunds/optimism.spec.js +++ b/test/specs/mainnet/transferringFunds/optimism.spec.js @@ -23,7 +23,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -32,14 +31,19 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.optimism_chainid), - bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY) - }); + bundlerProvider: new EtherspotBundler( + Number(data.optimism_chainid), + process.env.BUNDLER_API_KEY + ), + } + ); try { assert.strictEqual( optimismMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -61,7 +65,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN assert.strictEqual( optimismEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -76,8 +81,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN // initializating Data service... try { - optimismDataService = new DataUtils( - process.env.DATA_API_KEY); + optimismDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -128,7 +132,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -152,7 +155,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -162,7 +166,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -172,7 +177,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -191,9 +197,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN balance = await optimismMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -214,7 +218,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -222,9 +227,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -234,7 +237,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -244,7 +248,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -254,7 +259,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -264,7 +270,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -274,7 +281,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -284,7 +292,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -294,7 +303,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -304,7 +314,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -314,7 +325,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -333,9 +345,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN uoHash = await optimismMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -344,9 +354,9 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -363,19 +373,20 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); try { assert.isTrue( provider._isProvider, - message.vali_erc20Transfer_provider); + message.vali_erc20Transfer_provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -394,7 +405,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -408,9 +420,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN decimals = await erc20Instance.functions.decimals(); try { - assert.isNotEmpty( - decimals, - message.vali_erc20Contract_decimals); + assert.isNotEmpty(decimals, message.vali_erc20Contract_decimals); } catch (e) { console.error(e); const eString = e.toString(); @@ -428,12 +438,17 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); try { assert.isNotEmpty( transactionData, - message.vali_erc20Contract_transferFrom); + message.vali_erc20Contract_transferFrom + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -465,9 +480,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN }); try { - assert.isNotEmpty( - userOpsBatch.to, - message.vali_addTransaction_to); + assert.isNotEmpty(userOpsBatch.to, message.vali_addTransaction_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -477,7 +490,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( userOpsBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -487,7 +501,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( userOpsBatch.value[0], - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -508,7 +523,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -516,9 +532,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -528,7 +542,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -538,7 +553,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -548,7 +564,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -558,7 +575,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -568,7 +586,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -578,7 +597,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -588,7 +608,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -598,7 +619,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -608,7 +630,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -627,9 +650,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN uoHash = await optimismMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -638,9 +659,9 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -657,7 +678,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get erc721 Contract Interface @@ -675,7 +695,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( erc721Data, - message.vali_erc721Transfer_contractInterface); + message.vali_erc721Transfer_contractInterface + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -709,7 +730,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( userOpsBatch.to[0], - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -719,7 +741,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( userOpsBatch.data[0], - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -729,7 +752,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( userOpsBatch.value[0], - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -750,7 +774,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -758,9 +783,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -770,7 +793,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -780,7 +804,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -790,7 +815,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -800,7 +826,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -810,7 +837,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -820,7 +848,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -830,7 +859,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -840,7 +870,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -850,7 +881,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -869,9 +901,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN uoHash = await optimismMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -880,9 +910,9 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -899,7 +929,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -923,7 +952,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -933,7 +963,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -943,7 +974,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -962,9 +994,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN balance = await optimismMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -986,7 +1016,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -994,9 +1025,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -1006,7 +1035,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1016,7 +1046,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1026,7 +1057,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1036,7 +1068,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1046,7 +1079,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1056,7 +1090,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1066,7 +1101,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1076,7 +1112,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1086,7 +1123,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1105,9 +1143,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN uoHash = await optimismMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -1116,9 +1152,9 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1136,9 +1172,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { - await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); const provider = new providers.JsonRpcProvider(); @@ -1164,7 +1198,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1174,7 +1209,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1184,7 +1220,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1203,9 +1240,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN balance = await optimismMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -1226,11 +1261,13 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { while (--concurrentUseropsCount >= 0) { - const op = await optimismMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await optimismMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await optimismMainNetSdk.send(op); uoHashes.push(uoHash); @@ -1238,9 +1275,9 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1252,30 +1289,34 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await optimismMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await optimismMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -1287,9 +1328,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1326,12 +1364,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await optimismMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_9) + addContext(test, message.fail_estimateTransaction_9); assert.fail(message.fail_estimateTransaction_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1350,9 +1388,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1389,12 +1424,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await optimismMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_10) + addContext(test, message.fail_estimateTransaction_10); assert.fail(message.fail_estimateTransaction_10); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_9) + addContext(test, message.vali_estimateTransaction_9); console.log(message.vali_estimateTransaction_9); } else { console.error(e); @@ -1413,9 +1448,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1432,11 +1464,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN value: ethers.utils.parseUnits(data.invalidValue), // invalid value }); - addContext(test, message.fail_estimateTransaction_11) + addContext(test, message.fail_estimateTransaction_11); assert.fail(message.fail_estimateTransaction_11); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_estimateTransaction_10) + addContext(test, message.vali_estimateTransaction_10); console.log(message.vali_estimateTransaction_10); } else { console.error(e); @@ -1455,9 +1487,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1474,11 +1503,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN value: ethers.utils.parseUnits(data.smallValue), // very small value }); - addContext(test, message.fail_estimateTransaction_12) + addContext(test, message.fail_estimateTransaction_12); assert.fail(message.fail_estimateTransaction_12); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_estimateTransaction_11) + addContext(test, message.vali_estimateTransaction_11); console.log(message.vali_estimateTransaction_11); } else { console.error(e); @@ -1497,9 +1526,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1524,11 +1550,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await optimismMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -1547,9 +1573,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1587,12 +1610,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await optimismMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_9) + addContext(test, message.fail_estimateTransaction_9); assert.fail(message.fail_estimateTransaction_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1611,9 +1634,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1651,12 +1671,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await optimismMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_10) + addContext(test, message.fail_estimateTransaction_10); assert.fail(message.fail_estimateTransaction_10); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1675,9 +1695,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await optimismMainNetSdk.clearUserOpsFromBatch(); @@ -1703,11 +1720,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await optimismMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.empty_batch) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -1726,14 +1743,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.invalidProviderNetwork_optimism, // invalid provider + data.invalidProviderNetwork_optimism // invalid provider ); } catch (e) { console.error(e); @@ -1748,7 +1762,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1760,11 +1775,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_14) + addContext(test, message.fail_estimateTransaction_14); assert.fail(message.fail_estimateTransaction_14); } catch (e) { if (e.reason === constant.invalid_network_2) { - addContext(test, message.vali_estimateTransaction_13) + addContext(test, message.vali_estimateTransaction_13); console.log(message.vali_estimateTransaction_13); } else { console.error(e); @@ -1783,9 +1798,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { @@ -1803,7 +1815,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1815,11 +1828,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_14) + addContext(test, message.fail_estimateTransaction_14); assert.fail(message.fail_estimateTransaction_14); } catch (e) { if (e.reason === constant.invalid_network_2) { - addContext(test, message.vali_estimateTransaction_13) + addContext(test, message.vali_estimateTransaction_13); console.log(message.vali_estimateTransaction_13); } else { console.error(e); @@ -1838,14 +1851,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.otherProviderNetwork_optimism, // other provider + data.otherProviderNetwork_optimism // other provider ); } catch (e) { console.error(e); @@ -1860,7 +1870,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1872,12 +1883,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_15) + addContext(test, message.fail_estimateTransaction_15); assert.fail(message.fail_estimateTransaction_15); } catch (e) { let error = e.message; if (error.includes(constant.invalid_value_3)) { - addContext(test, message.vali_estimateTransaction_14) + addContext(test, message.vali_estimateTransaction_14); console.log(message.vali_estimateTransaction_14); } else { console.error(e); @@ -1896,14 +1907,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1917,7 +1926,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.incorrectTokenAddress_optimismUSDC, // incorrect token address ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1929,11 +1939,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await erc20Instance.functions.decimals(); - addContext(message.fail_erc20Transfer_1) + addContext(message.fail_erc20Transfer_1); assert.fail(message.fail_erc20Transfer_1); } catch (e) { if (e.reason === constant.invalid_address_6) { - addContext(test, message.vali_erc20Transfer_1) + addContext(test, message.vali_erc20Transfer_1); console.log(message.vali_erc20Transfer_1); } else { console.error(e); @@ -1952,14 +1962,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1973,7 +1981,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.invalidTokenAddress_optimismUSDC, // invalid token address ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1985,11 +1994,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_erc20Transfer_2) + addContext(test, message.fail_erc20Transfer_2); assert.fail(message.fail_erc20Transfer_2); } catch (e) { if (e.reason === constant.invalid_address_4) { - addContext(test, message.vali_erc20Transfer_2) + addContext(test, message.vali_erc20Transfer_2); console.log(message.vali_erc20Transfer_2); } else { console.error(e); @@ -2008,14 +2017,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2027,11 +2034,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { new ethers.Contract(null, ERC20_ABI, provider); // null token address - addContext(test, message.fail_erc20Transfer_3) + addContext(test, message.fail_erc20Transfer_3); assert.fail(message.fail_erc20Transfer_3); } catch (e) { if (e.reason === constant.contract_address_2) { - addContext(test, message.vali_erc20Transfer_3) + addContext(test, message.vali_erc20Transfer_3); console.log(message.vali_erc20Transfer_3); } else { console.error(e); @@ -2050,14 +2057,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2071,7 +2076,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2097,11 +2103,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_4) + addContext(test, message.fail_erc20Transfer_4); assert.fail(message.fail_erc20Transfer_4); } catch (e) { if (e.reason === constant.no_function) { - addContext(test, message.vali_erc20Transfer_4) + addContext(test, message.vali_erc20Transfer_4); console.log(message.vali_erc20Transfer_4); } else { console.error(e); @@ -2120,14 +2126,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2141,7 +2145,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2167,11 +2172,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN ethers.utils.parseUnits(data.invalidValue, decimals), // invalid value ]); - addContext(test, message.fail_erc20Transfer_5) + addContext(test, message.fail_erc20Transfer_5); assert.fail(message.fail_erc20Transfer_5); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_erc20Transfer_5) + addContext(test, message.vali_erc20Transfer_5); console.log(message.vali_erc20Transfer_5); } else { console.error(e); @@ -2190,14 +2195,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2211,7 +2214,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2237,11 +2241,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN ethers.utils.parseUnits(data.smallValue, decimals), // very small value ]); - addContext(test, message.fail_erc20Transfer_6) + addContext(test, message.fail_erc20Transfer_6); assert.fail(message.fail_erc20Transfer_6); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_erc20Transfer_6) + addContext(test, message.vali_erc20Transfer_6); console.log(message.vali_erc20Transfer_6); } else { console.error(e); @@ -2260,14 +2264,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2281,7 +2283,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2305,11 +2308,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN data.recipient, ]); - addContext(test, message.fail_erc20Transfer_7) + addContext(test, message.fail_erc20Transfer_7); assert.fail(message.fail_erc20Transfer_7); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc20Transfer_7) + addContext(test, message.vali_erc20Transfer_7); console.log(message.vali_erc20Transfer_7); } else { console.error(e); @@ -2328,14 +2331,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2349,7 +2350,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2375,12 +2377,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_8) + addContext(test, message.fail_erc20Transfer_8); assert.fail(message.fail_erc20Transfer_8); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc20Transfer_8) + addContext(test, message.vali_erc20Transfer_8); console.log(message.vali_erc20Transfer_8); } else { console.error(e); @@ -2399,14 +2401,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2420,7 +2420,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2446,12 +2447,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_9) + addContext(test, message.fail_erc20Transfer_9); assert.fail(message.fail_erc20Transfer_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc20Transfer_9) + addContext(test, message.vali_erc20Transfer_9); console.log(message.vali_erc20Transfer_9); } else { console.error(e); @@ -2470,14 +2471,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2491,7 +2490,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2516,11 +2516,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_10) + addContext(test, message.fail_erc20Transfer_10); assert.fail(message.fail_erc20Transfer_10); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc20Transfer_10) + addContext(test, message.vali_erc20Transfer_10); console.log(message.vali_erc20Transfer_10); } else { console.error(e); @@ -2539,14 +2539,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2560,7 +2558,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2584,7 +2583,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2619,12 +2622,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await optimismMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_16) + addContext(test, message.fail_estimateTransaction_16); assert.fail(message.fail_estimateTransaction_16); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_15) + addContext(test, message.vali_estimateTransaction_15); console.log(message.vali_estimateTransaction_15); } else { console.error(e); @@ -2643,14 +2646,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2664,7 +2665,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2688,7 +2690,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2723,12 +2729,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await optimismMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_17) + addContext(test, message.fail_estimateTransaction_17); assert.fail(message.fail_estimateTransaction_17); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_16) + addContext(test, message.vali_estimateTransaction_16); console.log(message.vali_estimateTransaction_16); } else { console.error(e); @@ -2747,14 +2753,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2768,7 +2772,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2792,7 +2797,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2827,11 +2836,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await optimismMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_18) + addContext(test, message.fail_estimateTransaction_18); assert.fail(message.fail_estimateTransaction_18); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_17) + addContext(test, message.vali_estimateTransaction_17); console.log(message.vali_estimateTransaction_17); } else { console.error(e); @@ -2850,14 +2859,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2871,7 +2878,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2895,7 +2903,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2929,11 +2941,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await optimismMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_19) + addContext(test, message.fail_estimateTransaction_19); assert.fail(message.fail_estimateTransaction_19); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_18) + addContext(test, message.vali_estimateTransaction_18); console.log(message.vali_estimateTransaction_18); } else { console.error(e); @@ -2952,14 +2964,12 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_optimism); + data.providerNetwork_optimism + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2973,7 +2983,8 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN erc20Instance = new ethers.Contract( data.tokenAddress_optimismUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -3022,7 +3033,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -3041,9 +3052,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3055,11 +3063,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_1) + addContext(test, message.fail_erc721Transfer_1); assert.fail(message.fail_erc721Transfer_1); } catch (e) { if (e.reason.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc721Transfer_1) + addContext(test, message.vali_erc721Transfer_1); console.log(message.vali_erc721Transfer_1); } else { console.error(e); @@ -3078,9 +3086,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3092,11 +3097,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_2) + addContext(test, message.fail_erc721Transfer_2); assert.fail(message.fail_erc721Transfer_2); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc721Transfer_2) + addContext(test, message.vali_erc721Transfer_2); console.log(message.vali_erc721Transfer_2); } else { console.error(e); @@ -3115,9 +3120,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3128,11 +3130,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_3) + addContext(test, message.fail_erc721Transfer_3); assert.fail(message.fail_erc721Transfer_3); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_3) + addContext(test, message.vali_erc721Transfer_3); console.log(message.vali_erc721Transfer_3); } else { console.error(e); @@ -3151,9 +3153,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3165,11 +3164,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_4) + addContext(test, message.fail_erc721Transfer_4); assert.fail(message.fail_erc721Transfer_4); } catch (e) { if (e.reason.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc721Transfer_4) + addContext(test, message.vali_erc721Transfer_4); console.log(message.vali_erc721Transfer_4); } else { console.error(e); @@ -3188,9 +3187,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3202,11 +3198,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_5) + addContext(test, message.fail_erc721Transfer_5); assert.fail(message.fail_erc721Transfer_5); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc721Transfer_5) + addContext(test, message.vali_erc721Transfer_5); console.log(message.vali_erc721Transfer_5); } else { console.error(e); @@ -3225,9 +3221,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3238,11 +3231,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_6) + addContext(test, message.fail_erc721Transfer_6); assert.fail(message.fail_erc721Transfer_6); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_6) + addContext(test, message.vali_erc721Transfer_6); console.log(message.vali_erc721Transfer_6); } else { console.error(e); @@ -3261,9 +3254,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3275,11 +3265,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN data.incorrectTokenId, // incorrect tokenid ]); - addContext(message.fail_erc721Transfer_7) + addContext(message.fail_erc721Transfer_7); assert.fail(message.fail_erc721Transfer_7); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_erc721Transfer_7) + addContext(test, message.vali_erc721Transfer_7); console.log(message.vali_erc721Transfer_7); } else { console.error(e); @@ -3298,9 +3288,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3311,11 +3298,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN data.recipient, // not added tokenid ]); - addContext(test, message.fail_erc721Transfer_8) + addContext(test, message.fail_erc721Transfer_8); assert.fail(message.fail_erc721Transfer_8); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_8) + addContext(test, message.vali_erc721Transfer_8); console.log(message.vali_erc721Transfer_8); } else { console.error(e); @@ -3334,9 +3321,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3378,11 +3362,11 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { await optimismMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -3402,11 +3386,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); // clear the transaction batch @@ -3437,7 +3417,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN let balance; try { balance = await optimismMainNetSdk.getNativeBalance(); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3453,11 +3432,13 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { while (--concurrentUseropsCount >= 0) { - const op = await optimismMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await optimismMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await optimismMainNetSdk.send(op); uoHashes.push(uoHash); @@ -3465,9 +3446,9 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3479,30 +3460,34 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await optimismMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await optimismMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -3515,11 +3500,7 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); // clear the transaction batch @@ -3539,7 +3520,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN to: data.recipient, value: ethers.utils.parseEther(data.value), }); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3551,7 +3531,6 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN let balance; try { balance = await optimismMainNetSdk.getNativeBalance(); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3567,11 +3546,13 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN try { while (--concurrentUseropsCount >= 0) { - const op = await optimismMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await optimismMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await optimismMainNetSdk.send(op); uoHashes.push(uoHash); @@ -3579,9 +3560,9 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -3593,30 +3574,34 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await optimismMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await optimismMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -3627,26 +3612,22 @@ describe('The PrimeSDK, when transfer a token with optimism network on the MainN it('REGRESSION: Perform the concurrent userops with non deployed address on the optimism network', async function () { var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); try { if ((await provider.getCode(data.eoaAddress)).length <= 2) { - addContext(test, message.vali_deployAddress_1) + addContext(test, message.vali_deployAddress_1); console.log(message.vali_deployAddress_1); return; } - addContext(test, message.fail_deployAddress_1) - assert.fail(message.fail_deployAddress_1) + addContext(test, message.fail_deployAddress_1); + assert.fail(message.fail_deployAddress_1); } catch (e) { const errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_2)) { - addContext(test, message.vali_deployAddress_2) + addContext(test, message.vali_deployAddress_2); console.log(message.vali_deployAddress_2); } else { console.error(e); diff --git a/test/specs/mainnet/transferringFunds/xdai.spec.js b/test/specs/mainnet/transferringFunds/xdai.spec.js index b99c749..89ec4a8 100644 --- a/test/specs/mainnet/transferringFunds/xdai.spec.js +++ b/test/specs/mainnet/transferringFunds/xdai.spec.js @@ -23,7 +23,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -32,14 +31,19 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.xdai_chainid), - bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY) - }); + bundlerProvider: new EtherspotBundler( + Number(data.xdai_chainid), + process.env.BUNDLER_API_KEY + ), + } + ); try { assert.strictEqual( xdaiMainNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -61,7 +65,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', assert.strictEqual( xdaiEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -76,8 +81,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', // initializating Data service... try { - xdaiDataService = new DataUtils( - process.env.DATA_API_KEY); + xdaiDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -128,7 +132,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -152,7 +155,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -162,7 +166,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -172,7 +177,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -191,9 +197,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', balance = await xdaiMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -214,7 +218,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -222,9 +227,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -234,7 +237,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -244,7 +248,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -254,7 +259,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -264,7 +270,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -274,7 +281,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -284,7 +292,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -294,7 +303,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -304,7 +314,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -314,7 +325,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -333,9 +345,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', uoHash = await xdaiMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -344,9 +354,9 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -363,19 +373,20 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); try { assert.isTrue( provider._isProvider, - message.vali_erc20Transfer_provider); + message.vali_erc20Transfer_provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -394,7 +405,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -408,9 +420,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', decimals = await erc20Instance.functions.decimals(); try { - assert.isNotEmpty( - decimals, - message.vali_erc20Contract_decimals); + assert.isNotEmpty(decimals, message.vali_erc20Contract_decimals); } catch (e) { console.error(e); const eString = e.toString(); @@ -428,12 +438,17 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); try { assert.isNotEmpty( transactionData, - message.vali_erc20Contract_transferFrom); + message.vali_erc20Contract_transferFrom + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -465,9 +480,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', }); try { - assert.isNotEmpty( - userOpsBatch.to, - message.vali_addTransaction_to); + assert.isNotEmpty(userOpsBatch.to, message.vali_addTransaction_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -477,7 +490,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( userOpsBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -487,7 +501,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( userOpsBatch.value[0], - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -508,7 +523,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -516,9 +532,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -528,7 +542,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -538,7 +553,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -548,7 +564,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -558,7 +575,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -568,7 +586,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -578,7 +597,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -588,7 +608,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -598,7 +619,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -608,7 +630,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -627,9 +650,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', uoHash = await xdaiMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -638,9 +659,9 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -657,7 +678,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get erc721 Contract Interface @@ -675,7 +695,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( erc721Data, - message.vali_erc721Transfer_contractInterface); + message.vali_erc721Transfer_contractInterface + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -709,7 +730,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( userOpsBatch.to[0], - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -719,7 +741,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( userOpsBatch.data[0], - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -729,7 +752,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( userOpsBatch.value[0], - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -750,7 +774,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -758,9 +783,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -770,7 +793,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -780,7 +804,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -790,7 +815,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -800,7 +826,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -810,7 +837,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -820,7 +848,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -830,7 +859,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -840,7 +870,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -850,7 +881,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -869,9 +901,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', uoHash = await xdaiMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -880,9 +910,9 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -899,7 +929,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -923,7 +952,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -933,7 +963,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -943,7 +974,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -962,9 +994,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', balance = await xdaiMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -986,7 +1016,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -994,9 +1025,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -1006,7 +1035,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1016,7 +1046,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1026,7 +1057,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1036,7 +1068,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1046,7 +1079,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1056,7 +1090,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1066,7 +1101,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1076,7 +1112,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1086,7 +1123,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1105,9 +1143,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', uoHash = await xdaiMainNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -1116,9 +1152,9 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); @@ -1136,9 +1172,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { - await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); const provider = new providers.JsonRpcProvider(); @@ -1164,7 +1198,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1174,7 +1209,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1184,7 +1220,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1203,9 +1240,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', balance = await xdaiMainNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -1226,11 +1261,13 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { while (--concurrentUseropsCount >= 0) { - const op = await xdaiMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await xdaiMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await xdaiMainNetSdk.send(op); uoHashes.push(uoHash); @@ -1238,13 +1275,13 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); - assert.fail(message.fail_submitTransaction_1) + assert.fail(message.fail_submitTransaction_1); } } @@ -1252,30 +1289,34 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await xdaiMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await xdaiMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -1287,9 +1328,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1326,12 +1364,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await xdaiMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_9) + addContext(test, message.fail_estimateTransaction_9); assert.fail(message.fail_estimateTransaction_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1350,9 +1388,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1389,12 +1424,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await xdaiMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_10) + addContext(test, message.fail_estimateTransaction_10); assert.fail(message.fail_estimateTransaction_10); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_9) + addContext(test, message.vali_estimateTransaction_9); console.log(message.vali_estimateTransaction_9); } else { console.error(e); @@ -1413,9 +1448,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1432,11 +1464,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', value: ethers.utils.parseUnits(data.invalidValue), // invalid value }); - addContext(test, message.fail_estimateTransaction_11) + addContext(test, message.fail_estimateTransaction_11); assert.fail(message.fail_estimateTransaction_11); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_estimateTransaction_10) + addContext(test, message.vali_estimateTransaction_10); console.log(message.vali_estimateTransaction_10); } else { console.error(e); @@ -1455,9 +1487,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1474,11 +1503,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', value: ethers.utils.parseUnits(data.smallValue), // very small value }); - addContext(test, message.fail_estimateTransaction_12) + addContext(test, message.fail_estimateTransaction_12); assert.fail(message.fail_estimateTransaction_12); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_estimateTransaction_11) + addContext(test, message.vali_estimateTransaction_11); console.log(message.vali_estimateTransaction_11); } else { console.error(e); @@ -1497,9 +1526,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1524,11 +1550,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await xdaiMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -1547,9 +1573,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1587,12 +1610,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await xdaiMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_9) + addContext(test, message.fail_estimateTransaction_9); assert.fail(message.fail_estimateTransaction_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1611,9 +1634,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1651,12 +1671,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await xdaiMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_10) + addContext(test, message.fail_estimateTransaction_10); assert.fail(message.fail_estimateTransaction_10); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1675,9 +1695,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await xdaiMainNetSdk.clearUserOpsFromBatch(); @@ -1703,11 +1720,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await xdaiMainNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.empty_batch) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -1726,14 +1743,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.invalidProviderNetwork_xdai, // invalid provider + data.invalidProviderNetwork_xdai // invalid provider ); } catch (e) { console.error(e); @@ -1748,7 +1762,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1760,11 +1775,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_14) + addContext(test, message.fail_estimateTransaction_14); assert.fail(message.fail_estimateTransaction_14); } catch (e) { if (e.reason === constant.invalid_network_2) { - addContext(test, message.vali_estimateTransaction_13) + addContext(test, message.vali_estimateTransaction_13); console.log(message.vali_estimateTransaction_13); } else { console.error(e); @@ -1783,9 +1798,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { @@ -1803,7 +1815,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1815,11 +1828,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_14) + addContext(test, message.fail_estimateTransaction_14); assert.fail(message.fail_estimateTransaction_14); } catch (e) { if (e.reason === constant.invalid_network_2) { - addContext(test, message.vali_estimateTransaction_13) + addContext(test, message.vali_estimateTransaction_13); console.log(message.vali_estimateTransaction_13); } else { console.error(e); @@ -1838,14 +1851,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.otherProviderNetwork_xdai, // other provider + data.otherProviderNetwork_xdai // other provider ); } catch (e) { console.error(e); @@ -1860,7 +1870,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1872,12 +1883,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_15) + addContext(test, message.fail_estimateTransaction_15); assert.fail(message.fail_estimateTransaction_15); } catch (e) { let error = e.message; if (error.includes(constant.invalid_value_3)) { - addContext(test, message.vali_estimateTransaction_14) + addContext(test, message.vali_estimateTransaction_14); console.log(message.vali_estimateTransaction_14); } else { console.error(e); @@ -1896,14 +1907,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1917,7 +1926,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.incorrectTokenAddress_xdaiUSDC, // incorrect token address ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1929,11 +1939,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await erc20Instance.functions.decimals(); - addContext(message.fail_erc20Transfer_1) + addContext(message.fail_erc20Transfer_1); assert.fail(message.fail_erc20Transfer_1); } catch (e) { if (e.reason === constant.invalid_address_6) { - addContext(test, message.vali_erc20Transfer_1) + addContext(test, message.vali_erc20Transfer_1); console.log(message.vali_erc20Transfer_1); } else { console.error(e); @@ -1952,14 +1962,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1973,7 +1981,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.invalidTokenAddress_xdaiUSDC, // invalid token address ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1985,11 +1994,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_erc20Transfer_2) + addContext(test, message.fail_erc20Transfer_2); assert.fail(message.fail_erc20Transfer_2); } catch (e) { if (e.reason === constant.invalid_address_4) { - addContext(test, message.vali_erc20Transfer_2) + addContext(test, message.vali_erc20Transfer_2); console.log(message.vali_erc20Transfer_2); } else { console.error(e); @@ -2008,14 +2017,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2027,11 +2034,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { new ethers.Contract(null, ERC20_ABI, provider); // null token address - addContext(test, message.fail_erc20Transfer_3) + addContext(test, message.fail_erc20Transfer_3); assert.fail(message.fail_erc20Transfer_3); } catch (e) { if (e.reason === constant.contract_address_2) { - addContext(test, message.vali_erc20Transfer_3) + addContext(test, message.vali_erc20Transfer_3); console.log(message.vali_erc20Transfer_3); } else { console.error(e); @@ -2050,14 +2057,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2071,7 +2076,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2097,11 +2103,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_4) + addContext(test, message.fail_erc20Transfer_4); assert.fail(message.fail_erc20Transfer_4); } catch (e) { if (e.reason === constant.no_function) { - addContext(test, message.vali_erc20Transfer_4) + addContext(test, message.vali_erc20Transfer_4); console.log(message.vali_erc20Transfer_4); } else { console.error(e); @@ -2120,14 +2126,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2141,7 +2145,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2167,11 +2172,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', ethers.utils.parseUnits(data.invalidValue, decimals), // invalid value ]); - addContext(test, message.fail_erc20Transfer_5) + addContext(test, message.fail_erc20Transfer_5); assert.fail(message.fail_erc20Transfer_5); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_erc20Transfer_5) + addContext(test, message.vali_erc20Transfer_5); console.log(message.vali_erc20Transfer_5); } else { console.error(e); @@ -2190,14 +2195,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2211,7 +2214,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2237,11 +2241,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', ethers.utils.parseUnits(data.smallValue, decimals), // very small value ]); - addContext(test, message.fail_erc20Transfer_6) + addContext(test, message.fail_erc20Transfer_6); assert.fail(message.fail_erc20Transfer_6); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_erc20Transfer_6) + addContext(test, message.vali_erc20Transfer_6); console.log(message.vali_erc20Transfer_6); } else { console.error(e); @@ -2260,14 +2264,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2281,7 +2283,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2305,11 +2308,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', data.recipient, ]); - addContext(test, message.fail_erc20Transfer_7) + addContext(test, message.fail_erc20Transfer_7); assert.fail(message.fail_erc20Transfer_7); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc20Transfer_7) + addContext(test, message.vali_erc20Transfer_7); console.log(message.vali_erc20Transfer_7); } else { console.error(e); @@ -2328,14 +2331,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2349,7 +2350,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2375,12 +2377,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_8) + addContext(test, message.fail_erc20Transfer_8); assert.fail(message.fail_erc20Transfer_8); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc20Transfer_8) + addContext(test, message.vali_erc20Transfer_8); console.log(message.vali_erc20Transfer_8); } else { console.error(e); @@ -2399,14 +2401,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2420,7 +2420,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2446,12 +2447,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_9) + addContext(test, message.fail_erc20Transfer_9); assert.fail(message.fail_erc20Transfer_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc20Transfer_9) + addContext(test, message.vali_erc20Transfer_9); console.log(message.vali_erc20Transfer_9); } else { console.error(e); @@ -2470,14 +2471,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2491,7 +2490,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2516,11 +2516,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_10) + addContext(test, message.fail_erc20Transfer_10); assert.fail(message.fail_erc20Transfer_10); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc20Transfer_10) + addContext(test, message.vali_erc20Transfer_10); console.log(message.vali_erc20Transfer_10); } else { console.error(e); @@ -2539,14 +2539,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2560,7 +2558,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2584,7 +2583,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2619,12 +2622,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await xdaiMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_16) + addContext(test, message.fail_estimateTransaction_16); assert.fail(message.fail_estimateTransaction_16); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_15) + addContext(test, message.vali_estimateTransaction_15); console.log(message.vali_estimateTransaction_15); } else { console.error(e); @@ -2643,14 +2646,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2664,7 +2665,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2688,7 +2690,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2723,12 +2729,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await xdaiMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_17) + addContext(test, message.fail_estimateTransaction_17); assert.fail(message.fail_estimateTransaction_17); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_16) + addContext(test, message.vali_estimateTransaction_16); console.log(message.vali_estimateTransaction_16); } else { console.error(e); @@ -2747,14 +2753,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2768,7 +2772,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2792,7 +2797,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2827,11 +2836,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await xdaiMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_18) + addContext(test, message.fail_estimateTransaction_18); assert.fail(message.fail_estimateTransaction_18); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_17) + addContext(test, message.vali_estimateTransaction_17); console.log(message.vali_estimateTransaction_17); } else { console.error(e); @@ -2850,14 +2859,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2871,7 +2878,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2895,7 +2903,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2929,11 +2941,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await xdaiMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_19) + addContext(test, message.fail_estimateTransaction_19); assert.fail(message.fail_estimateTransaction_19); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_18) + addContext(test, message.vali_estimateTransaction_18); console.log(message.vali_estimateTransaction_18); } else { console.error(e); @@ -2952,14 +2964,12 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_xdai); + data.providerNetwork_xdai + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2973,7 +2983,8 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', erc20Instance = new ethers.Contract( data.tokenAddress_xdaiUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -3022,7 +3033,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -3041,9 +3052,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3055,11 +3063,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_1) + addContext(test, message.fail_erc721Transfer_1); assert.fail(message.fail_erc721Transfer_1); } catch (e) { if (e.reason.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc721Transfer_1) + addContext(test, message.vali_erc721Transfer_1); console.log(message.vali_erc721Transfer_1); } else { console.error(e); @@ -3078,9 +3086,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3092,11 +3097,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_2) + addContext(test, message.fail_erc721Transfer_2); assert.fail(message.fail_erc721Transfer_2); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc721Transfer_2) + addContext(test, message.vali_erc721Transfer_2); console.log(message.vali_erc721Transfer_2); } else { console.error(e); @@ -3115,9 +3120,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3128,11 +3130,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_3) + addContext(test, message.fail_erc721Transfer_3); assert.fail(message.fail_erc721Transfer_3); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_3) + addContext(test, message.vali_erc721Transfer_3); console.log(message.vali_erc721Transfer_3); } else { console.error(e); @@ -3151,9 +3153,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3165,11 +3164,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_4) + addContext(test, message.fail_erc721Transfer_4); assert.fail(message.fail_erc721Transfer_4); } catch (e) { if (e.reason.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc721Transfer_4) + addContext(test, message.vali_erc721Transfer_4); console.log(message.vali_erc721Transfer_4); } else { console.error(e); @@ -3188,9 +3187,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3202,11 +3198,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_5) + addContext(test, message.fail_erc721Transfer_5); assert.fail(message.fail_erc721Transfer_5); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc721Transfer_5) + addContext(test, message.vali_erc721Transfer_5); console.log(message.vali_erc721Transfer_5); } else { console.error(e); @@ -3225,9 +3221,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3238,11 +3231,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_6) + addContext(test, message.fail_erc721Transfer_6); assert.fail(message.fail_erc721Transfer_6); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_6) + addContext(test, message.vali_erc721Transfer_6); console.log(message.vali_erc721Transfer_6); } else { console.error(e); @@ -3261,9 +3254,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3275,11 +3265,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', data.incorrectTokenId, // incorrect tokenid ]); - addContext(message.fail_erc721Transfer_7) + addContext(message.fail_erc721Transfer_7); assert.fail(message.fail_erc721Transfer_7); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_erc721Transfer_7) + addContext(test, message.vali_erc721Transfer_7); console.log(message.vali_erc721Transfer_7); } else { console.error(e); @@ -3298,9 +3288,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3311,11 +3298,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', data.recipient, // not added tokenid ]); - addContext(test, message.fail_erc721Transfer_8) + addContext(test, message.fail_erc721Transfer_8); assert.fail(message.fail_erc721Transfer_8); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_8) + addContext(test, message.vali_erc721Transfer_8); console.log(message.vali_erc721Transfer_8); } else { console.error(e); @@ -3334,9 +3321,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3378,11 +3362,11 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { await xdaiMainNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -3402,11 +3386,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); // clear the transaction batch @@ -3437,7 +3417,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', let balance; try { balance = await xdaiMainNetSdk.getNativeBalance(); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3453,11 +3432,13 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { while (--concurrentUseropsCount >= 0) { - const op = await xdaiMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await xdaiMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await xdaiMainNetSdk.send(op); uoHashes.push(uoHash); @@ -3465,13 +3446,13 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); - assert.fail(message.fail_submitTransaction_1) + assert.fail(message.fail_submitTransaction_1); } } @@ -3479,30 +3460,34 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await xdaiMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await xdaiMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -3515,11 +3500,7 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); // clear the transaction batch @@ -3539,7 +3520,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', to: data.recipient, value: ethers.utils.parseEther(data.value), }); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3551,7 +3531,6 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', let balance; try { balance = await xdaiMainNetSdk.getNativeBalance(); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3567,11 +3546,13 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', try { while (--concurrentUseropsCount >= 0) { - const op = await xdaiMainNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await xdaiMainNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await xdaiMainNetSdk.send(op); uoHashes.push(uoHash); @@ -3579,13 +3560,13 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', } catch (e) { console.error(e); const eString = e.toString(); - if (eString === "Error") { - console.warn(message.skip_transaction_error) - addContext(test, message.skip_transaction_error) + if (eString === 'Error') { + console.warn(message.skip_transaction_error); + addContext(test, message.skip_transaction_error); test.skip(); } else { addContext(test, eString); - assert.fail(message.fail_submitTransaction_1) + assert.fail(message.fail_submitTransaction_1); } } @@ -3593,30 +3574,34 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await xdaiMainNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await xdaiMainNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -3627,26 +3612,22 @@ describe('The PrimeSDK, when transfer a token with xdai network on the MainNet', it('REGRESSION: Perform the concurrent userops with non deployed address on the xdai network', async function () { var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); try { if ((await provider.getCode(data.eoaAddress)).length <= 2) { - addContext(test, message.vali_deployAddress_1) + addContext(test, message.vali_deployAddress_1); console.log(message.vali_deployAddress_1); return; } - addContext(test, message.fail_deployAddress_1) - assert.fail(message.fail_deployAddress_1) + addContext(test, message.fail_deployAddress_1); + assert.fail(message.fail_deployAddress_1); } catch (e) { const errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_2)) { - addContext(test, message.vali_deployAddress_2) + addContext(test, message.vali_deployAddress_2); console.log(message.vali_deployAddress_2); } else { console.error(e); diff --git a/test/specs/skandhaBenchmark/erc20Transaction/mumbai.spec.js b/test/specs/skandhaBenchmark/erc20Transaction/mumbai.spec.js index 0010067..4c3b976 100644 --- a/test/specs/skandhaBenchmark/erc20Transaction/mumbai.spec.js +++ b/test/specs/skandhaBenchmark/erc20Transaction/mumbai.spec.js @@ -11,128 +11,140 @@ import data from '../../../data/testData.json' assert { type: 'json' }; const txCount = data.txCount; describe('Determine benchmarks of skandha with erc20 token transaction on the mumbai network', function () { + it('Perform the transfer ERC20 token on the mumbai network for determine benchmarks of skandha', async function () { + var test = this; + await customRetryAsync(async function () { + let mumbaiTestNetSdk; + try { + mumbaiTestNetSdk = new PrimeSdk( + { privateKey: process.env.PRIVATE_KEY }, + { + chainId: Number(data.mumbai_chainid), + projectKey: process.env.PROJECT_KEY_TESTNET, + } + ); + } catch (e) { + console.error(e); + return; // Handle initialization error and skip test + } - it('Perform the transfer ERC20 token on the mumbai network for determine benchmarks of skandha', async function () { - var test = this; - await customRetryAsync(async function () { + // clear the transaction batch + try { + await mumbaiTestNetSdk.clearUserOpsFromBatch(); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail('The transaction of the batch is not clear correctly.'); + } - let mumbaiTestNetSdk; - try { - mumbaiTestNetSdk = new PrimeSdk( - { privateKey: process.env.PRIVATE_KEY }, - { chainId: Number(data.mumbai_chainid), projectKey: process.env.PROJECT_KEY_TESTNET }, - ); - } catch (e) { - console.error(e); - return; // Handle initialization error and skip test - } + let userOpsBatch = []; + for (let j = 0; j < txCount; j++) { + let transactionData; + // get the respective provider details + let provider; + try { + provider = new ethers.providers.JsonRpcProvider( + data.providerNetwork_mumbai + ); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail('The provider response is not displayed correctly.'); + } - // clear the transaction batch - try { - await mumbaiTestNetSdk.clearUserOpsFromBatch(); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('The transaction of the batch is not clear correctly.'); - } + // get erc20 Contract Interface + let erc20Instance; + try { + erc20Instance = new ethers.Contract( + data.tokenAddress_mumbaiUSDC, + ERC20_ABI, + provider + ); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail('The get erc20 Contract Interface is not performed.'); + } - let userOpsBatch = []; - for (let j = 0; j < txCount; j++) { + // get decimals from erc20 contract + let decimals; + try { + decimals = await erc20Instance.functions.decimals(); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail( + 'The decimals from erc20 contract is not displayed correctly.' + ); + } - let transactionData; - // get the respective provider details - let provider; - try { - provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_mumbai, - ); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('The provider response is not displayed correctly.'); - } + // get transferFrom encoded data + try { + transactionData = erc20Instance.interface.encodeFunctionData( + 'transfer', + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail( + 'The decimals from erc20 contract is not displayed correctly.' + ); + } - // get erc20 Contract Interface - let erc20Instance; - try { - erc20Instance = new ethers.Contract( - data.tokenAddress_mumbaiUSDC, - ERC20_ABI, - provider, - ); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('The get erc20 Contract Interface is not performed.'); - } + // Add transaction data to the batch + try { + userOpsBatch.push( + await mumbaiTestNetSdk.addUserOpsToBatch({ + to: data.tokenAddress_mumbaiUSDC, + data: transactionData, + }) + ); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail( + 'An error is displayed while Adding the transactions to the batch.' + ); + } + } - // get decimals from erc20 contract - let decimals; - try { - decimals = await erc20Instance.functions.decimals(); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail( - 'The decimals from erc20 contract is not displayed correctly.', - ); - } + // estimate the transaction for the UserOps batch + let op; + try { + op = await mumbaiTestNetSdk.estimate(); + console.log(`Estimated the ${txCount} transactions successfully.`); + addContext(test, `Estimated the ${txCount} transactions successfully.`); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail( + 'An error is displayed while performing the estimation of the transactions.' + ); + } - // get transferFrom encoded data - try { - transactionData = erc20Instance.interface.encodeFunctionData( - 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)], - ); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail( - 'The decimals from erc20 contract is not displayed correctly.', - ); - } - - // Add transaction data to the batch - try { - userOpsBatch.push(await mumbaiTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_mumbaiUSDC, data: transactionData })); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('An error is displayed while Adding the transactions to the batch.') - } - } - - // estimate the transaction for the UserOps batch - let op; - try { - op = await mumbaiTestNetSdk.estimate(); - console.log(`Estimated the ${txCount} transactions successfully.`); - addContext(test, `Estimated the ${txCount} transactions successfully.`); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('An error is displayed while performing the estimation of the transactions.') - } - - // submit the transaction - let uoHash; - try { - uoHash = await mumbaiTestNetSdk.send(op); - console.log(`UserOp Hash: ${uoHash}`); - addContext(test, `UserOp Hash: ${uoHash}`); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('An error is displayed while submit the transactions.') - } - }, data.retry); // Retry this async test up to 5 times - }); -}); \ No newline at end of file + // submit the transaction + let uoHash; + try { + uoHash = await mumbaiTestNetSdk.send(op); + console.log(`UserOp Hash: ${uoHash}`); + addContext(test, `UserOp Hash: ${uoHash}`); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail('An error is displayed while submit the transactions.'); + } + }, data.retry); // Retry this async test up to 5 times + }); +}); diff --git a/test/specs/skandhaBenchmark/erc20Transaction/sepolia.spec.js b/test/specs/skandhaBenchmark/erc20Transaction/sepolia.spec.js index 00f51df..99a2c08 100644 --- a/test/specs/skandhaBenchmark/erc20Transaction/sepolia.spec.js +++ b/test/specs/skandhaBenchmark/erc20Transaction/sepolia.spec.js @@ -11,128 +11,140 @@ import data from '../../../data/testData.json' assert { type: 'json' }; const txCount = data.txCount; describe('Determine benchmarks of skandha with erc20 token transaction on the sepolia network', function () { + it('Perform the transfer ERC20 token on the sepolia network for determine benchmarks of skandha', async function () { + var test = this; + await customRetryAsync(async function () { + let sepoliaTestNetSdk; + try { + sepoliaTestNetSdk = new PrimeSdk( + { privateKey: process.env.PRIVATE_KEY }, + { + chainId: Number(data.sepolia_chainid), + projectKey: process.env.PROJECT_KEY_TESTNET, + } + ); + } catch (e) { + console.error(e); + return; // Handle initialization error and skip test + } - it('Perform the transfer ERC20 token on the sepolia network for determine benchmarks of skandha', async function () { - var test = this; - await customRetryAsync(async function () { + // clear the transaction batch + try { + await sepoliaTestNetSdk.clearUserOpsFromBatch(); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail('The transaction of the batch is not clear correctly.'); + } - let sepoliaTestNetSdk; - try { - sepoliaTestNetSdk = new PrimeSdk( - { privateKey: process.env.PRIVATE_KEY }, - { chainId: Number(data.sepolia_chainid), projectKey: process.env.PROJECT_KEY_TESTNET }, - ); - } catch (e) { - console.error(e); - return; // Handle initialization error and skip test - } + let userOpsBatch = []; + for (let j = 0; j < txCount; j++) { + let transactionData; + // get the respective provider details + let provider; + try { + provider = new ethers.providers.JsonRpcProvider( + data.providerNetwork_sepolia + ); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail('The provider response is not displayed correctly.'); + } - // clear the transaction batch - try { - await sepoliaTestNetSdk.clearUserOpsFromBatch(); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('The transaction of the batch is not clear correctly.'); - } + // get erc20 Contract Interface + let erc20Instance; + try { + erc20Instance = new ethers.Contract( + data.tokenAddress_sepoliaUSDC, + ERC20_ABI, + provider + ); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail('The get erc20 Contract Interface is not performed.'); + } - let userOpsBatch = []; - for (let j = 0; j < txCount; j++) { + // get decimals from erc20 contract + let decimals; + try { + decimals = await erc20Instance.functions.decimals(); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail( + 'The decimals from erc20 contract is not displayed correctly.' + ); + } - let transactionData; - // get the respective provider details - let provider; - try { - provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia, - ); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('The provider response is not displayed correctly.'); - } + // get transferFrom encoded data + try { + transactionData = erc20Instance.interface.encodeFunctionData( + 'transfer', + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail( + 'The decimals from erc20 contract is not displayed correctly.' + ); + } - // get erc20 Contract Interface - let erc20Instance; - try { - erc20Instance = new ethers.Contract( - data.tokenAddress_sepoliaUSDC, - ERC20_ABI, - provider, - ); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('The get erc20 Contract Interface is not performed.'); - } + // Add transaction data to the batch + try { + userOpsBatch.push( + await sepoliaTestNetSdk.addUserOpsToBatch({ + to: data.tokenAddress_sepoliaUSDC, + data: transactionData, + }) + ); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail( + 'An error is displayed while Adding the transactions to the batch.' + ); + } + } - // get decimals from erc20 contract - let decimals; - try { - decimals = await erc20Instance.functions.decimals(); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail( - 'The decimals from erc20 contract is not displayed correctly.', - ); - } + // estimate the transaction for the UserOps batch + let op; + try { + op = await sepoliaTestNetSdk.estimate(); + console.log(`Estimated the ${txCount} transactions successfully.`); + addContext(test, `Estimated the ${txCount} transactions successfully.`); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail( + 'An error is displayed while performing the estimation of the transactions.' + ); + } - // get transferFrom encoded data - try { - transactionData = erc20Instance.interface.encodeFunctionData( - 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)], - ); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail( - 'The decimals from erc20 contract is not displayed correctly.', - ); - } - - // Add transaction data to the batch - try { - userOpsBatch.push(await sepoliaTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_sepoliaUSDC, data: transactionData })); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('An error is displayed while Adding the transactions to the batch.') - } - } - - // estimate the transaction for the UserOps batch - let op; - try { - op = await sepoliaTestNetSdk.estimate(); - console.log(`Estimated the ${txCount} transactions successfully.`); - addContext(test, `Estimated the ${txCount} transactions successfully.`); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('An error is displayed while performing the estimation of the transactions.') - } - - // submit the transaction - let uoHash; - try { - uoHash = await sepoliaTestNetSdk.send(op); - console.log(`UserOp Hash: ${uoHash}`); - addContext(test, `UserOp Hash: ${uoHash}`); - } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail('An error is displayed while submit the transactions.') - } - }, data.retry); // Retry this async test up to 5 times - }); -}); \ No newline at end of file + // submit the transaction + let uoHash; + try { + uoHash = await sepoliaTestNetSdk.send(op); + console.log(`UserOp Hash: ${uoHash}`); + addContext(test, `UserOp Hash: ${uoHash}`); + } catch (e) { + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail('An error is displayed while submit the transactions.'); + } + }, data.retry); // Retry this async test up to 5 times + }); +}); diff --git a/test/specs/testnet/connext/sepolia.spec.js b/test/specs/testnet/connext/sepolia.spec.js index 94c6626..1acf856 100644 --- a/test/specs/testnet/connext/sepolia.spec.js +++ b/test/specs/testnet/connext/sepolia.spec.js @@ -22,7 +22,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -31,7 +30,7 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.sepolia_chainid), - }, + } ); try { @@ -61,7 +60,8 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t assert.strictEqual( sepoliaEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -76,9 +76,7 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t // initializating Data service... try { - sepoliaDataService = new DataUtils( - process.env.DATA_API_KEY - ); + sepoliaDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -130,12 +128,10 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let allSupportedAssets; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { - allSupportedAssets = - await sepoliaDataService.getSupportedAssets({}); + allSupportedAssets = await sepoliaDataService.getSupportedAssets({}); try { assert.isNotEmpty( @@ -208,15 +204,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let supportedAssets; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { - supportedAssets = - await sepoliaDataService.getSupportedAssets({ - chainId: data.sepolia_chainid, - provider: BridgingProvider.Connext, - }); + supportedAssets = await sepoliaDataService.getSupportedAssets({ + chainId: data.sepolia_chainid, + provider: BridgingProvider.Connext, + }); try { assert.isNotEmpty( @@ -290,7 +284,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); try { @@ -317,10 +310,7 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t } try { - assert.isNotEmpty( - quotes[0].to, - message.vali_connext_getQuotes_to - ); + assert.isNotEmpty(quotes[0].to, message.vali_connext_getQuotes_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -353,7 +343,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -486,22 +475,18 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let supportedAssets; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { - supportedAssets = - await sepoliaDataService.getSupportedAssets({ - chainId: data.invalid_sepolia_chainid, - provider: BridgingProvider.Connext, - }); + supportedAssets = await sepoliaDataService.getSupportedAssets({ + chainId: data.invalid_sepolia_chainid, + provider: BridgingProvider.Connext, + }); if (supportedAssets.length === 0) { - addContext(test, message.vali_connext_1) - console.log(message.vali_connext_1) + addContext(test, message.vali_connext_1); + console.log(message.vali_connext_1); } else { - addContext(test, message.fail_connext_5) - assert.fail(message.fail_connext_5) + addContext(test, message.fail_connext_5); + assert.fail(message.fail_connext_5); } } catch (e) { console.error(e); @@ -520,9 +505,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.invalidSender, @@ -535,11 +517,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_7) + addContext(test, message.fail_connext_7); assert.fail(message.fail_connext_7); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_2) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_2); console.log(message.vali_connext_2); } else { console.error(e); @@ -559,9 +543,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ toAddress: data.recipient, @@ -573,11 +554,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_8) + addContext(test, message.fail_connext_8); assert.fail(message.fail_connext_8); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_3) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_3); console.log(message.vali_connext_3); } else { console.error(e); @@ -597,9 +580,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.incorrectSender, @@ -612,11 +592,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_9) + addContext(test, message.fail_connext_9); assert.fail(message.fail_connext_9); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_7) { - addContext(test, message.vali_connext_4) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_7 + ) { + addContext(test, message.vali_connext_4); console.log(message.vali_connext_4); } else { console.error(e); @@ -636,9 +618,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -651,11 +630,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_10) + addContext(test, message.fail_connext_10); assert.fail(message.fail_connext_10); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_5) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_5); console.log(message.vali_connext_5); } else { console.error(e); @@ -675,9 +656,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -689,11 +667,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_11) + addContext(test, message.fail_connext_11); assert.fail(message.fail_connext_11); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_6) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_6); console.log(message.vali_connext_6); } else { console.error(e); @@ -713,9 +693,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -728,11 +705,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_12) + addContext(test, message.fail_connext_12); assert.fail(message.fail_connext_12); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_8) { - addContext(test, message.vali_connext_7) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_8 + ) { + addContext(test, message.vali_connext_7); console.log(message.vali_connext_7); } else { console.error(e); @@ -752,9 +731,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -766,11 +742,11 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_13) + addContext(test, message.fail_connext_13); assert.fail(message.fail_connext_13); } catch (e) { if (e.message === constant.invalid_address_9) { - addContext(test, message.vali_connext_8) + addContext(test, message.vali_connext_8); console.log(message.vali_connext_8); } else { console.error(e); @@ -790,9 +766,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -804,11 +777,11 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_14) + addContext(test, message.fail_connext_14); assert.fail(message.fail_connext_14); } catch (e) { if (e.message === constant.invalid_address_10) { - addContext(test, message.vali_connext_9) + addContext(test, message.vali_connext_9); console.log(message.vali_connext_9); } else { console.error(e); @@ -828,9 +801,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -843,11 +813,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_15) + addContext(test, message.fail_connext_15); assert.fail(message.fail_connext_15); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_10) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_10); console.log(message.vali_connext_10); } else { console.error(e); @@ -867,9 +839,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -882,11 +851,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_16) + addContext(test, message.fail_connext_16); assert.fail(message.fail_connext_16); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_11) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_11); console.log(message.vali_connext_11); } else { console.error(e); @@ -906,9 +877,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -920,11 +888,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_17) + addContext(test, message.fail_connext_17); assert.fail(message.fail_connext_17); } catch (e) { - if (e.errors[0].constraints.isAddress === constant.invalid_address_11) { - addContext(test, message.vali_connext_12) + if ( + e.errors[0].constraints.isAddress === constant.invalid_address_11 + ) { + addContext(test, message.vali_connext_12); console.log(message.vali_connext_12); } else { console.error(e); @@ -944,9 +914,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -959,11 +926,11 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_18) + addContext(test, message.fail_connext_18); assert.fail(message.fail_connext_18); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_connext_13) + addContext(test, message.vali_connext_13); console.log(message.vali_connext_13); } else { console.error(e); @@ -983,9 +950,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -998,11 +962,11 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_19) + addContext(test, message.fail_connext_19); assert.fail(message.fail_connext_19); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_connext_14) + addContext(test, message.vali_connext_14); console.log(message.vali_connext_14); } else { console.error(e); @@ -1022,9 +986,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -1036,11 +997,14 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_20) + addContext(test, message.fail_connext_20); assert.fail(message.fail_connext_20); } catch (e) { - if (e.errors[0].constraints.IsBigNumberish === constant.invalid_bignumber_2) { - addContext(test, message.vali_connext_15) + if ( + e.errors[0].constraints.IsBigNumberish === + constant.invalid_bignumber_2 + ) { + addContext(test, message.vali_connext_15); console.log(message.vali_connext_15); } else { console.error(e); @@ -1060,9 +1024,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t let quotes; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { quotes = await sepoliaDataService.getQuotes({ fromAddress: data.sender, @@ -1074,11 +1035,11 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_21) + addContext(test, message.fail_connext_21); assert.fail(message.fail_connext_21); } catch (e) { if (e.message === constant.invalid_address_13) { - addContext(test, message.vali_connext_16) + addContext(test, message.vali_connext_16); console.log(message.vali_connext_16); } else { console.error(e); @@ -1097,9 +1058,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1109,11 +1067,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_22) + addContext(test, message.fail_connext_22); assert.fail(message.fail_connext_22); } catch (e) { - if (e.errors[0].constraints.isPositive === constant.invalid_chainid_4) { - addContext(test, message.vali_connext_17) + if ( + e.errors[0].constraints.isPositive === constant.invalid_chainid_4 + ) { + addContext(test, message.vali_connext_17); console.log(message.vali_connext_17); } else { console.error(e); @@ -1132,9 +1092,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1144,11 +1101,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_23) + addContext(test, message.fail_connext_23); assert.fail(message.fail_connext_23); } catch (e) { - if (e.errors[0].constraints.isPositive === constant.invalid_chainid_5) { - addContext(test, message.vali_connext_18) + if ( + e.errors[0].constraints.isPositive === constant.invalid_chainid_5 + ) { + addContext(test, message.vali_connext_18); console.log(message.vali_connext_18); } else { console.error(e); @@ -1167,9 +1126,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1180,11 +1136,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_24) + addContext(test, message.fail_connext_24); assert.fail(message.fail_connext_24); } catch (e) { - if (e.errors[0].constraints.isHex === constant.transactionHash_32hex) { - addContext(test, message.vali_connext_19) + if ( + e.errors[0].constraints.isHex === constant.transactionHash_32hex + ) { + addContext(test, message.vali_connext_19); console.log(message.vali_connext_19); } else { console.error(e); @@ -1203,9 +1161,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1217,17 +1172,17 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t }); if (transactionStatus.status === constant.invalid_chainid_6) { - addContext(test, message.vali_connext_20) + addContext(test, message.vali_connext_20); console.log(message.vali_connext_20); } else { addContext(test, eString); assert.fail(message.fail_connext_25); } } catch (e) { - console.error(e); - const eString = e.toString(); - addContext(test, eString); - assert.fail(message.fail_connext_25); + console.error(e); + const eString = e.toString(); + addContext(test, eString); + assert.fail(message.fail_connext_25); } }, data.retry); // Retry this async test up to 5 times } else { @@ -1239,9 +1194,6 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // validate the transaction status let transactionStatus; try { @@ -1251,11 +1203,13 @@ describe('The PrimeSDK, Validate the connext endpoints with sepolia network on t provider: BridgingProvider.Connext, }); - addContext(test, message.fail_connext_26) + addContext(test, message.fail_connext_26); assert.fail(message.fail_connext_26); } catch (e) { - if (e.errors[0].constraints.isHex === constant.transactionHash_32hex) { - addContext(test, message.vali_connext_21) + if ( + e.errors[0].constraints.isHex === constant.transactionHash_32hex + ) { + addContext(test, message.vali_connext_21); console.log(message.vali_connext_21); } else { console.error(e); diff --git a/test/specs/testnet/getAddresses/sepolia.spec.js b/test/specs/testnet/getAddresses/sepolia.spec.js index d77c6a7..0b9430d 100644 --- a/test/specs/testnet/getAddresses/sepolia.spec.js +++ b/test/specs/testnet/getAddresses/sepolia.spec.js @@ -19,17 +19,14 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { sepoliaTestNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.sepolia_chainid), - factoryWallet: Factory.ZERO_DEV - }, + factoryWallet: Factory.ZERO_DEV, + } ); try { @@ -79,17 +76,14 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { sepoliaTestNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.sepolia_chainid), - factoryWallet: Factory.SIMPLE_ACCOUNT - }, + factoryWallet: Factory.SIMPLE_ACCOUNT, + } ); try { @@ -119,7 +113,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( sepoliaSimpleAccountAddress, data.simpleaccount_address, - message.vali_simple_account, + message.vali_simple_account ); } catch (e) { console.error(e); @@ -139,16 +133,13 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d var test = this; await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // initializating sdk try { sepoliaTestNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { - chainId: Number(data.sepolia_chainid) - }, + chainId: Number(data.sepolia_chainid), + } ); try { @@ -178,7 +169,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( sepoliaAccountAddress, data.sender, - message.vali_account_address, + message.vali_account_address ); } catch (e) { console.error(e); @@ -198,8 +189,10 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.sepolia_chainid), - projectKey: process.env.PROJECT_KEY, index: 1 - }); + projectKey: process.env.PROJECT_KEY, + index: 1, + } + ); try { assert.strictEqual( @@ -228,7 +221,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d assert.strictEqual( sepoliaAccountAddress1, data.sender1, - message.vali_account_address, + message.vali_account_address ); } catch (e) { console.error(e); diff --git a/test/specs/testnet/listAndRates/sepolia.spec.js b/test/specs/testnet/listAndRates/sepolia.spec.js index c9ddd79..90a68bd 100644 --- a/test/specs/testnet/listAndRates/sepolia.spec.js +++ b/test/specs/testnet/listAndRates/sepolia.spec.js @@ -21,7 +21,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -29,15 +28,16 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det sepoliaTestNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { - chainId: Number(data.sepolia_chainid) - }, + chainId: Number(data.sepolia_chainid), + } ); try { assert.strictEqual( sepoliaTestNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -59,7 +59,8 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det assert.strictEqual( sepoliaEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -74,9 +75,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det // initializating Data service... try { - sepoliaDataService = new DataUtils( - process.env.DATA_API_KEY - ); + sepoliaDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -127,7 +126,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let nfts; @@ -138,13 +136,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det }); if (nfts.items.length > 0) { - addContext(test, message.pass_nft_list_1) + addContext(test, message.pass_nft_list_1); console.log(message.pass_nftList_1); try { assert.isNotEmpty( nfts.items[0].contractName, - message.vali_nftList_contractName, + message.vali_nftList_contractName ); } catch (e) { console.error(e); @@ -155,7 +153,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( nfts.items[0].contractAddress, - message.vali_nftList_contractAddress, + message.vali_nftList_contractAddress ); } catch (e) { console.error(e); @@ -199,7 +197,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( nfts.items[0].items[0].name, - message.vali_nftList_items_name, + message.vali_nftList_items_name ); } catch (e) { console.error(e); @@ -210,7 +208,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( nfts.items[0].items[0].amount, - message.vali_nftList_items_amount, + message.vali_nftList_items_amount ); } catch (e) { console.error(e); @@ -218,7 +216,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_nftList_2) + addContext(test, message.pass_nftList_2); console.log(message.pass_nftList_2); } } catch (e) { @@ -237,13 +235,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let tokenLists; let tokenListTokens; try { - tokenLists = await sepoliaDataService.getTokenLists({ chainId: data.sepolia_chainid }); + tokenLists = await sepoliaDataService.getTokenLists({ + chainId: data.sepolia_chainid, + }); if (tokenLists.length > 0) { console.log(message.pass_tokenList_1); @@ -252,7 +251,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenLists[0].name, - message.vali_tokenList_name, + message.vali_tokenList_name ); } catch (e) { console.error(e); @@ -263,7 +262,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenLists[0].endpoint, - message.vali_tokenList_endpoint, + message.vali_tokenList_endpoint ); } catch (e) { console.error(e); @@ -271,11 +270,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_2) + addContext(test, message.pass_tokenList_2); console.log(message.pass_tokenList_2); } - tokenListTokens = await sepoliaDataService.getTokenListTokens({ chainId: data.sepolia_chainid }); + tokenListTokens = await sepoliaDataService.getTokenListTokens({ + chainId: data.sepolia_chainid, + }); if (tokenListTokens.length > 0) { console.log(message.pass_tokenList_3); @@ -284,7 +285,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].address, - message.vali_tokenListTokens_address, + message.vali_tokenListTokens_address ); } catch (e) { console.error(e); @@ -295,7 +296,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].name, - message.vali_tokenListTokens_name, + message.vali_tokenListTokens_name ); } catch (e) { console.error(e); @@ -306,7 +307,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( tokenListTokens[0].symbol, - message.vali_tokenListTokens_symbol, + message.vali_tokenListTokens_symbol ); } catch (e) { console.error(e); @@ -317,7 +318,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( tokenListTokens[0].decimals, - message.vali_tokenListTokens_decimals, + message.vali_tokenListTokens_decimals ); } catch (e) { console.error(e); @@ -339,7 +340,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( tokenListTokens[0].chainId, - message.vali_tokenListTokens_chainId, + message.vali_tokenListTokens_chainId ); } catch (e) { console.error(e); @@ -347,12 +348,11 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_4) + addContext(test, message.pass_tokenList_4); console.log(message.pass_tokenList_4); } if (tokenLists.length > 0) { - const { name } = tokenLists[0]; tokenListTokens = await sepoliaDataService.getTokenListTokens({ @@ -361,13 +361,13 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det }); if (tokenListTokens.length > 0) { - addContext(test, message.pass_tokenList_5) + addContext(test, message.pass_tokenList_5); console.log(message.pass_tokenList_5); - + try { assert.isNotEmpty( tokenListTokens[0].address, - message.vali_selectedTokenListTokens_address, + message.vali_selectedTokenListTokens_address ); } catch (e) { console.error(e); @@ -430,11 +430,11 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det addContext(test, eString); } } else { - addContext(test, message.pass_tokenList_6) + addContext(test, message.pass_tokenList_6); console.log(message.pass_tokenList_6); } } else { - addContext(test, message.pass_tokenList_2) + addContext(test, message.pass_tokenList_2); console.log(message.pass_tokenList_2); } } catch (e) { @@ -453,14 +453,16 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let TOKEN_LIST; let rates; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_sepoliaUSDC, data.tokenAddress_sepoliaUSDT]; + TOKEN_LIST = [ + data.tokenAddress_sepoliaUSDC, + data.tokenAddress_sepoliaUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -473,7 +475,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNotEmpty( rates.items[i].address, - message.vali_exchangeRates_address, + message.vali_exchangeRates_address ); } catch (e) { console.error(e); @@ -484,7 +486,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].eth, - message.vali_exchangeRates_eth, + message.vali_exchangeRates_eth ); } catch (e) { console.error(e); @@ -495,7 +497,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].eur, - message.vali_exchangeRates_eur, + message.vali_exchangeRates_eur ); } catch (e) { console.error(e); @@ -506,7 +508,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].gbp, - message.vali_exchangeRates_gbp, + message.vali_exchangeRates_gbp ); } catch (e) { console.error(e); @@ -517,7 +519,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det try { assert.isNumber( rates.items[i].usd, - message.vali_exchangeRates_usd, + message.vali_exchangeRates_usd ); } catch (e) { console.error(e); @@ -541,21 +543,21 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await sepoliaDataService.getNftList({ chainId: Number(data.sepolia_chainid), account: data.invalidSender, }); - addContext(test, message.fail_nftList_2) + addContext(test, message.fail_nftList_2); assert.fail(message.fail_nftList_2); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.pass_nftList_3) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.pass_nftList_3); console.log(message.pass_nftList_3); } else { console.error(e); @@ -574,21 +576,21 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await sepoliaDataService.getNftList({ chainId: Number(data.sepolia_chainid), account: data.incorrectSender, }); - addContext(test, message.fail_nftList_3) + addContext(test, message.fail_nftList_3); assert.fail(message.fail_nftList_3); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.pass_nftList_4) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.pass_nftList_4); console.log(message.pass_nftList_4); } else { console.error(e); @@ -607,9 +609,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { @@ -641,9 +640,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { @@ -659,12 +655,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await sepoliaDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_3) + addContext(test, message.fail_exchangeRates_3); assert.fail(message.fail_exchangeRates_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_1) + addContext(test, message.pass_exchangeRates_1); console.log(message.pass_exchangeRates_1); } else { console.error(e); @@ -683,9 +679,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; @@ -702,12 +695,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await sepoliaDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_4) + addContext(test, message.fail_exchangeRates_4); assert.fail(message.fail_exchangeRates_4); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_2) + addContext(test, message.pass_exchangeRates_2); console.log(message.pass_exchangeRates_2); } else { console.error(e); @@ -726,9 +719,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let TOKEN_LIST = []; @@ -739,12 +729,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await sepoliaDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_5) + addContext(test, message.fail_exchangeRates_5); assert.fail(message.fail_exchangeRates_5); } catch (e) { let error = e.message; if (error.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_3) + addContext(test, message.pass_exchangeRates_3); console.log(message.pass_exchangeRates_3); } else { console.error(e); @@ -763,14 +753,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_sepoliaUSDC, data.tokenAddress_sepoliaUSDT]; + TOKEN_LIST = [ + data.tokenAddress_sepoliaUSDC, + data.tokenAddress_sepoliaUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -781,7 +771,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_4) + addContext(test, message.pass_exchangeRates_4); console.log(message.pass_exchangeRates_4); } else { console.error(e); @@ -800,14 +790,14 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let TOKEN_LIST; let requestPayload; try { - TOKEN_LIST = [data.tokenAddress_sepoliaUSDC, data.tokenAddress_sepoliaUSDT]; + TOKEN_LIST = [ + data.tokenAddress_sepoliaUSDC, + data.tokenAddress_sepoliaUSDT, + ]; requestPayload = { tokens: TOKEN_LIST, @@ -815,12 +805,12 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det await sepoliaDataService.fetchExchangeRates(requestPayload); - addContext(test, message.fail_exchangeRates_7) + addContext(test, message.fail_exchangeRates_7); assert.fail(message.fail_exchangeRates_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.property_undefined)) { - addContext(test, message.pass_exchangeRates_5) + addContext(test, message.pass_exchangeRates_5); console.log(message.pass_exchangeRates_5); } else { console.error(e); diff --git a/test/specs/testnet/paymaster/sepolia.spec.js b/test/specs/testnet/paymaster/sepolia.spec.js index ad3c047..e62bad3 100644 --- a/test/specs/testnet/paymaster/sepolia.spec.js +++ b/test/specs/testnet/paymaster/sepolia.spec.js @@ -23,7 +23,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -31,15 +30,16 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s sepoliaTestNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { - chainId: Number(data.sepolia_chainid) - }, + chainId: Number(data.sepolia_chainid), + } ); try { assert.strictEqual( sepoliaTestNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -61,7 +61,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s assert.strictEqual( sepoliaEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -71,16 +72,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s console.error(e.message); const eString = e.toString(); addContext(test, eString); - assert.fail( - message.fail_smart_address, - ); + assert.fail(message.fail_smart_address); } // initializating Data service... try { - sepoliaDataService = new DataUtils( - process.env.DATA_API_KEY - ); + sepoliaDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -90,7 +87,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s // initializating ArkaPaymaster... try { - arkaPaymaster = new ArkaPaymaster(Number(data.sepolia_chainid), process.env.API_KEY, data.paymaster_arka); + arkaPaymaster = new ArkaPaymaster( + Number(data.sepolia_chainid), + process.env.API_KEY, + data.paymaster_arka + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -141,7 +142,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -165,7 +165,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -175,7 +176,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -185,7 +187,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -204,9 +207,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s balance = await sepoliaTestNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -224,16 +225,18 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { op = await sepoliaTestNetSdk.estimate({ paymasterDetails: { - url: `https://arka.etherspot.io?apiKey=${process.env.API_KEY - }&chainId=${Number(data.sepolia_chainid)}`, + url: `https://arka.etherspot.io?apiKey=${ + process.env.API_KEY + }&chainId=${Number(data.sepolia_chainid)}`, context: { mode: 'sponsor' }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -241,9 +244,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -253,7 +254,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -263,7 +265,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -273,7 +276,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -283,7 +287,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -293,7 +298,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -303,7 +309,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -313,7 +320,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -323,7 +331,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -333,7 +342,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -352,9 +362,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s uoHash = await sepoliaTestNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -376,11 +384,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let balance; @@ -389,9 +396,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s balance = await sepoliaTestNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -430,7 +435,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -440,7 +445,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( paymasterAddress, - message.vali_pimlico_paymasterAddress_1); + message.vali_pimlico_paymasterAddress_1 + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -459,11 +465,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { erc20Contract = new ethers.Contract( data.tokenAddress_sepoliaUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); contract = await sepoliaTestNetSdk.addUserOpsToBatch({ @@ -472,9 +478,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s }); try { - assert.isNotEmpty( - contract.to, - message.vali_erc20Contract_to); + assert.isNotEmpty(contract.to, message.vali_erc20Contract_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -482,9 +486,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } try { - assert.isNotEmpty( - contract.data, - message.vali_erc20Contract_data); + assert.isNotEmpty(contract.data, message.vali_erc20Contract_data); } catch (e) { console.error(e); const eString = e.toString(); @@ -504,7 +506,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( approveOp.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -514,7 +517,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( approveOp.nonce, - message.vali_estimateTransaction_nonce); + message.vali_estimateTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -524,7 +528,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( approveOp.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -534,7 +539,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( approveOp.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -544,7 +550,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( approveOp.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -554,7 +561,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( approveOp.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -564,7 +572,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( approveOp.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -574,7 +583,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( approveOp.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -584,7 +594,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( approveOp.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -594,7 +605,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( approveOp.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -604,7 +616,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( approveOp.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -622,9 +635,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s uoHash1 = await sepoliaTestNetSdk.send(approveOp); try { - assert.isNotEmpty( - uoHash1, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash1, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -657,7 +668,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -667,7 +679,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -685,9 +698,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s balance = await sepoliaTestNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -706,13 +717,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s paymasterDetails: { url: `${arka_url}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -722,7 +734,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.nonce, - message.vali_estimateTransaction_nonce); + message.vali_estimateTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -732,7 +745,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -742,7 +756,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -752,7 +767,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -762,7 +778,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -772,7 +789,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -782,7 +800,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -792,7 +811,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -802,7 +822,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -812,7 +833,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -830,9 +852,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s uoHash = await sepoliaTestNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -858,11 +878,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); let balance; @@ -875,9 +894,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s balance = await sepoliaTestNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -910,7 +927,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -920,7 +938,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -938,9 +957,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s balance = await sepoliaTestNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -969,13 +986,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -983,9 +1001,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -995,7 +1011,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1005,7 +1022,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1015,7 +1033,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1025,7 +1044,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1035,7 +1055,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1045,7 +1066,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1055,7 +1077,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1065,7 +1088,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1075,7 +1099,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1093,9 +1118,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s uoHash = await sepoliaTestNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -1117,10 +1140,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // get the metadata try { let metadata = await arkaPaymaster.metadata(); @@ -1128,7 +1149,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( metadata.sponsorAddress, - message.vali_metadata_sponsorAddress); + message.vali_metadata_sponsorAddress + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1138,7 +1160,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( metadata.sponsorWalletBalance, - message.vali_metadata_sponsorWalletBalance); + message.vali_metadata_sponsorWalletBalance + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1148,7 +1171,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( metadata.chainsSupported, - message.vali_metadata_chainsSupported); + message.vali_metadata_chainsSupported + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1158,7 +1182,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { assert.isNotEmpty( metadata.tokenPaymasters, - message.vali_metadata_tokenPaymasters); + message.vali_metadata_tokenPaymasters + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1180,18 +1205,18 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the get token paymaster address try { - let getTokenPaymasterAddress = await arkaPaymaster.getTokenPaymasterAddress("USDC"); + let getTokenPaymasterAddress = + await arkaPaymaster.getTokenPaymasterAddress('USDC'); try { assert.isNotEmpty( getTokenPaymasterAddress, - message.vali_getTokenPaymasterAddress_tokenPaymasterAddress); + message.vali_getTokenPaymasterAddress_tokenPaymasterAddress + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1213,13 +1238,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the remove whitelist address try { - let removeWhitelist = await arkaPaymaster.removeWhitelist([data.sender]); + let removeWhitelist = await arkaPaymaster.removeWhitelist([ + data.sender, + ]); if (removeWhitelist.includes(constant.remove_whitelist_2)) { addContext(test, message.vali_removeWhitelist_1); @@ -1250,10 +1275,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the add whitelist address try { let addWhitelist = await arkaPaymaster.addWhitelist([data.sender]); @@ -1287,10 +1310,8 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); - // validate the whilelist address try { let checkWhitelist = await arkaPaymaster.checkWhitelist(data.sender); @@ -1318,7 +1339,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // validate the deposit @@ -1326,11 +1346,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s let deposit = await arkaPaymaster.deposit(data.value); if (deposit.includes(constant.deposit_1)) { - addContext(test, message.vali_deposit_1) - console.log(message.vali_deposit_1) + addContext(test, message.vali_deposit_1); + console.log(message.vali_deposit_1); } else { - addContext(test, message.fail_deposit_1) - assert.fail(message.fail_deposit_1) + addContext(test, message.fail_deposit_1); + assert.fail(message.fail_deposit_1); } } catch (e) { console.error(e); @@ -1348,9 +1368,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1391,14 +1408,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s url: data.invalid_paymaster_arka, // invalid URL api_key: process.env.API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { if (e.message === constant.not_found) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -1417,9 +1434,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1460,14 +1474,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s url: data.paymaster_arka, api_key: process.env.INVALID_API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -1486,9 +1500,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1529,14 +1540,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s url: data.paymaster_arka, api_key: process.env.INCORRECT_API_KEY, context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_5) + addContext(test, message.fail_estimateTransaction_5); assert.fail(message.fail_estimateTransaction_5); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_4) + addContext(test, message.vali_estimateTransaction_4); console.log(message.vali_estimateTransaction_4); } else { console.error(e); @@ -1555,9 +1566,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1598,14 +1606,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s url: data.paymaster_arka, // without api_key context: { mode: 'sponsor' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_5) + addContext(test, message.vali_estimateTransaction_5); console.log(message.vali_estimateTransaction_5); } else { console.error(e); @@ -1624,13 +1632,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; const invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -1646,7 +1651,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1660,7 +1665,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } if (paymasterAddress.includes(constant.not_found)) { - addContext(test, message.vali_pimlico_paymasterAddress_2) + addContext(test, message.vali_pimlico_paymasterAddress_2); console.log(message.vali_pimlico_paymasterAddress_2); } else { addContext(test, message.fail_pimlico_paymasterAddress_2); @@ -1676,13 +1681,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.INVALID_API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1697,7 +1699,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1709,7 +1711,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } if (returnedValue.error === constant.invalid_apiKey) { - addContext(test, message.vali_pimlico_paymasterAddress_3) + addContext(test, message.vali_pimlico_paymasterAddress_3); console.log(message.vali_pimlico_paymasterAddress_3); } else { addContext(test, message.fail_pimlico_paymasterAddress_3); @@ -1727,9 +1729,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s let queryString = `?chainId=${Number(data.sepolia_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1744,7 +1743,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1756,7 +1755,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } if (returnedValue.error === constant.invalid_apiKey) { - addContext(test, message.vali_pimlico_paymasterAddress_4) + addContext(test, message.vali_pimlico_paymasterAddress_4); console.log(message.vali_pimlico_paymasterAddress_4); } else { addContext(test, message.fail_pimlico_paymasterAddress_4); @@ -1772,13 +1771,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_sepolia_chainid, + data.invalid_sepolia_chainid )}`; // invalid chainid in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1793,7 +1789,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1805,7 +1801,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } if (returnedValue.error === constant.invalid_network_3) { - addContext(test, message.vali_pimlico_paymasterAddress_5) + addContext(test, message.vali_pimlico_paymasterAddress_5); console.log(message.vali_pimlico_paymasterAddress_5); } else { addContext(test, message.fail_pimlico_paymasterAddress_5); @@ -1823,9 +1819,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s let queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { returnedValue = await fetch( @@ -1840,7 +1833,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -1852,7 +1845,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } if (returnedValue.error === constant.invalid_data) { - addContext(test, message.vali_pimlico_paymasterAddress_6) + addContext(test, message.vali_pimlico_paymasterAddress_6); console.log(message.vali_pimlico_paymasterAddress_6); } else { addContext(test, message.fail_pimlico_paymasterAddress_6); @@ -1868,13 +1861,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1892,14 +1882,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s { token: data.usdc_token }, ], }), - }, + } ).then((res) => { return res.json(); }); } catch (e) { const errorMessage = returnedValue.error; if (errorMessage.includes(constant.invalid_address_4)) { - addContext(test, message.vali_pimlico_paymasterAddress_7) + addContext(test, message.vali_pimlico_paymasterAddress_7); console.log(message.vali_pimlico_paymasterAddress_7); } else { addContext(test, message.fail_pimlico_paymasterAddress_7); @@ -1916,13 +1906,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1940,7 +1927,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s { token: data.invalid_usdc_token }, // invalid token ], }), - }, + } ).then((res) => { return res.json(); }); @@ -1952,7 +1939,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } if (returnedValue.error === constant.invalid_network_1) { - addContext(test, message.vali_pimlico_paymasterAddress_8) + addContext(test, message.vali_pimlico_paymasterAddress_8); console.log(message.vali_pimlico_paymasterAddress_8); } else { addContext(test, message.fail_pimlico_paymasterAddress_8); @@ -1968,13 +1955,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; try { @@ -1989,7 +1973,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [], // without parametets }), - }, + } ).then((res) => { return res.json(); }); @@ -2001,7 +1985,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } if (returnedValue.error === constant.invalid_data) { - addContext(test, message.vali_pimlico_paymasterAddress_9) + addContext(test, message.vali_pimlico_paymasterAddress_9); console.log(message.vali_pimlico_paymasterAddress_9); } else { addContext(test, message.fail_pimlico_paymasterAddress_9); @@ -2017,13 +2001,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -2039,7 +2020,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2057,11 +2038,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { erc20Contract = new ethers.Contract( data.incorrectTokenAddress_sepoliaUSDC, // incorrect token address - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await sepoliaTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_sepoliaUSDC, @@ -2070,7 +2051,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.contract_address_1)) { - addContext(test, message.vali_erc20Contract_1) + addContext(test, message.vali_erc20Contract_1); console.log(message.vali_erc20Contract_1); } else { console.error(e); @@ -2093,13 +2074,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; @@ -2115,7 +2093,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2133,11 +2111,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { erc20Contract = new ethers.Contract( data.invalidTokenAddress_sepoliaUSDC, // invalid token address - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await sepoliaTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_sepoliaUSDC, @@ -2146,7 +2124,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.contract_address_1)) { - addContext(test, message.vali_erc20Contract_2) + addContext(test, message.vali_erc20Contract_2); console.log(message.vali_erc20Contract_2); } else { console.error(e); @@ -2169,13 +2147,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2192,7 +2167,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2210,11 +2185,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { erc20Contract = new ethers.Contract( data.tokenAddress_sepoliaUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [data.invalid_paymasterAddress, ethers.constants.MaxUint256], // invalid paymaster address + [data.invalid_paymasterAddress, ethers.constants.MaxUint256] // invalid paymaster address ); await sepoliaTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_sepoliaUSDC, @@ -2223,7 +2198,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc20Contract_3) + addContext(test, message.vali_erc20Contract_3); console.log(message.vali_erc20Contract_3); } else { console.error(e); @@ -2246,13 +2221,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2269,7 +2241,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2287,11 +2259,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { erc20Contract = new ethers.Contract( data.tokenAddress_sepoliaUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [data.incorrect_paymasterAddress, ethers.constants.MaxUint256], // incorrect paymaster address + [data.incorrect_paymasterAddress, ethers.constants.MaxUint256] // incorrect paymaster address ); await sepoliaTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_sepoliaUSDC, @@ -2300,7 +2272,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc20Contract_4) + addContext(test, message.vali_erc20Contract_4); console.log(message.vali_erc20Contract_4); } else { console.error(e); @@ -2323,13 +2295,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2348,7 +2317,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2366,11 +2335,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { erc20Contract = new ethers.Contract( data.tokenAddress_sepoliaUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await sepoliaTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_sepoliaUSDC, @@ -2420,12 +2389,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s value: ethers.utils.parseEther(data.invalidValue), }); - addContext(test, message.fail_addTransaction_2) + addContext(test, message.fail_addTransaction_2); assert.fail(message.fail_addTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_value_1)) { - addContext(test, vali_addTransaction_1) + addContext(test, vali_addTransaction_1); console.log(vali_addTransaction_1); } else { console.error(e); @@ -2449,13 +2418,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s let arka_url = data.paymaster_arka; let invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2474,7 +2440,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2492,11 +2458,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { erc20Contract = new ethers.Contract( data.tokenAddress_sepoliaUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await sepoliaTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_sepoliaUSDC, @@ -2558,15 +2524,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s paymasterDetails: { url: `${invalid_arka_url}${queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.not_found)) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -2589,15 +2555,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; - let invalid_queryString = `?apiKey=${process.env.INVALID_API_KEY - }&chainId=${Number(data.sepolia_chainid)}`; // invalid API Key in queryString + let invalid_queryString = `?apiKey=${ + process.env.INVALID_API_KEY + }&chainId=${Number(data.sepolia_chainid)}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2616,7 +2580,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2634,11 +2598,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { erc20Contract = new ethers.Contract( data.tokenAddress_sepoliaUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await sepoliaTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_sepoliaUSDC, @@ -2700,15 +2664,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_apiKey)) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -2731,14 +2695,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; let invalid_queryString = `?chainId=${Number(data.sepolia_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2757,7 +2718,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2775,11 +2736,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { erc20Contract = new ethers.Contract( data.tokenAddress_sepoliaUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await sepoliaTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_sepoliaUSDC, @@ -2841,15 +2802,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_apiKey)) { - addContext(test, message.vali_estimateTransaction_5) + addContext(test, message.vali_estimateTransaction_5); console.log(message.vali_estimateTransaction_5); } else { console.error(e); @@ -2872,16 +2833,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; let invalid_queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_sepolia_chainid, + data.invalid_sepolia_chainid )}`; // invalid chainid in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -2900,7 +2858,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -2918,11 +2876,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { erc20Contract = new ethers.Contract( data.tokenAddress_sepoliaUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await sepoliaTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_sepoliaUSDC, @@ -2984,15 +2942,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_7) + addContext(test, message.fail_estimateTransaction_7); assert.fail(message.fail_estimateTransaction_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_3)) { - addContext(test, message.vali_estimateTransaction_6) + addContext(test, message.vali_estimateTransaction_6); console.log(message.vali_estimateTransaction_6); } else { console.error(e); @@ -3015,14 +2973,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; let invalid_queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - let returnedValue; let paymasterAddress; let erc20Contract; @@ -3041,7 +2996,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s body: JSON.stringify({ params: [data.entryPointAddress, { token: data.usdc_token }], }), - }, + } ).then((res) => { return res.json(); }); @@ -3059,11 +3014,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s try { erc20Contract = new ethers.Contract( data.tokenAddress_sepoliaUSDC, - ERC20_ABI, + ERC20_ABI ); encodedData = erc20Contract.interface.encodeFunctionData( 'approve', - [paymasterAddress, ethers.constants.MaxUint256], + [paymasterAddress, ethers.constants.MaxUint256] ); await sepoliaTestNetSdk.addUserOpsToBatch({ to: data.tokenAddress_sepoliaUSDC, @@ -3125,15 +3080,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s paymasterDetails: { url: `${arka_url}${invalid_queryString}`, context: { token: data.usdc_token, mode: 'erc20' }, - } + }, }); - addContext(test, message.fail_estimateTransaction_8) + addContext(test, message.fail_estimateTransaction_8); assert.fail(message.fail_estimateTransaction_8); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { - addContext(test, message.vali_estimateTransaction_7) + addContext(test, message.vali_estimateTransaction_7); console.log(message.vali_estimateTransaction_7); } else { console.error(e); @@ -3156,13 +3111,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let invalid_arka_url = data.invalid_paymaster_arka; let queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.sepolia_chainid, + data.sepolia_chainid )}`; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await sepoliaTestNetSdk.getNativeBalance(); @@ -3222,15 +3174,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_2) + addContext(test, message.fail_estimateTransaction_2); assert.fail(message.fail_estimateTransaction_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.not_found)) { - addContext(test, message.vali_estimateTransaction_1) + addContext(test, message.vali_estimateTransaction_1); console.log(message.vali_estimateTransaction_1); } else { console.error(e); @@ -3248,13 +3200,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s it('REGRESSION: Perform the transfer token on arka paymaster with validUntil and validAfter with invalid API Token on the sepolia network', async function () { var test = this; let arka_url = data.paymaster_arka; - let invalid_queryString = `?apiKey=${process.env.INVALID_API_KEY - }&chainId=${Number(data.sepolia_chainid)}`; // invalid API Key in queryString + let invalid_queryString = `?apiKey=${ + process.env.INVALID_API_KEY + }&chainId=${Number(data.sepolia_chainid)}`; // invalid API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await sepoliaTestNetSdk.getNativeBalance(); @@ -3314,14 +3264,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_4) + addContext(test, message.fail_estimateTransaction_4); assert.fail(message.fail_estimateTransaction_4); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -3342,9 +3292,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s let invalid_queryString = `?chainId=${Number(data.sepolia_chainid)}`; // without API Key in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await sepoliaTestNetSdk.getNativeBalance(); @@ -3404,14 +3351,14 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_6) + addContext(test, message.fail_estimateTransaction_6); assert.fail(message.fail_estimateTransaction_6); } catch (e) { if (e.message === constant.invalid_apiKey) { - addContext(test, message.vali_estimateTransaction_3) + addContext(test, message.vali_estimateTransaction_3); console.log(message.vali_estimateTransaction_3); } else { console.error(e); @@ -3430,13 +3377,10 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; let arka_url = data.paymaster_arka; let invalid_queryString = `?apiKey=${process.env.API_KEY}&chainId=${Number( - data.invalid_sepolia_chainid, + data.invalid_sepolia_chainid )}`; // invalid ChainID in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await sepoliaTestNetSdk.getNativeBalance(); @@ -3496,15 +3440,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_7) + addContext(test, message.fail_estimateTransaction_7); assert.fail(message.fail_estimateTransaction_7); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_3)) { - addContext(test, message.vali_estimateTransaction_6) + addContext(test, message.vali_estimateTransaction_6); console.log(message.vali_estimateTransaction_6); } else { console.error(e); @@ -3525,9 +3469,6 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s let invalid_queryString = `?apiKey=${process.env.API_KEY}`; // without ChainID in queryString if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get balance of the account address try { await sepoliaTestNetSdk.getNativeBalance(); @@ -3587,15 +3528,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s validAfter: new Date().valueOf(), validUntil: new Date().valueOf() + 6000000, }, - } + }, }); - addContext(test, message.fail_estimateTransaction_8) + addContext(test, message.fail_estimateTransaction_8); assert.fail(message.fail_estimateTransaction_8); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { - addContext(test, message.vali_estimateTransaction_7) + addContext(test, message.vali_estimateTransaction_7); console.log(message.vali_estimateTransaction_7); } else { console.error(e); @@ -3614,16 +3555,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the get token paymaster address try { await arkaPaymaster.getTokenPaymasterAddress(data.invalid_usdc_token); - addContext(test, message.fail_getTokenPaymasterAddress_2) - assert.fail(message.fail_getTokenPaymasterAddress_2) + addContext(test, message.fail_getTokenPaymasterAddress_2); + assert.fail(message.fail_getTokenPaymasterAddress_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_1)) { @@ -3646,16 +3583,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the get token paymaster address try { await arkaPaymaster.getTokenPaymasterAddress(); - addContext(test, message.fail_getTokenPaymasterAddress_3) - assert.fail(message.fail_getTokenPaymasterAddress_3) + addContext(test, message.fail_getTokenPaymasterAddress_3); + assert.fail(message.fail_getTokenPaymasterAddress_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { @@ -3678,15 +3611,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { await arkaPaymaster.removeWhitelist([data.invalidSender]); - addContext(test, message.fail_removeWhitelist_3) + addContext(test, message.fail_removeWhitelist_3); assert.fail(message.fail_removeWhitelist_3); } catch (e) { let errorMessage = e.message; @@ -3710,15 +3639,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { await arkaPaymaster.removeWhitelist([data.incorrectSender]); - addContext(test, message.fail_removeWhitelist_4) + addContext(test, message.fail_removeWhitelist_4); assert.fail(message.fail_removeWhitelist_4); } catch (e) { let errorMessage = e.message; @@ -3742,16 +3667,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress = ethers.Wallet.createRandom(); await arkaPaymaster.removeWhitelist([randomAddress.address]); - addContext(test, message.fail_removeWhitelist_5) + addContext(test, message.fail_removeWhitelist_5); assert.fail(message.fail_removeWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -3775,16 +3696,15 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - await arkaPaymaster.removeWhitelist([randomAddress.address, data.sender]); + await arkaPaymaster.removeWhitelist([ + randomAddress.address, + data.sender, + ]); - addContext(test, message.fail_removeWhitelist_5) + addContext(test, message.fail_removeWhitelist_5); assert.fail(message.fail_removeWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -3808,20 +3728,22 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); // make whitelisted addresses - await arkaPaymaster.addWhitelist([randomAddress1.address, randomAddress2.address]); + await arkaPaymaster.addWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); // remove whitelist addresses - let removewhitelist = await arkaPaymaster.removeWhitelist([randomAddress1.address, randomAddress2.address]); + let removewhitelist = await arkaPaymaster.removeWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); if (removewhitelist.includes(constant.remove_whitelist_2)) { addContext(test, message.vali_removeWhitelist_1); @@ -3852,17 +3774,16 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the remove whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); - await arkaPaymaster.removeWhitelist([randomAddress1.address, randomAddress2.address]); + await arkaPaymaster.removeWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); - addContext(test, message.fail_removeWhitelist_6) + addContext(test, message.fail_removeWhitelist_6); assert.fail(message.fail_removeWhitelist_6); } catch (e) { let errorMessage = e.message; @@ -3886,15 +3807,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { await arkaPaymaster.addWhitelist([data.invalidSender]); - addContext(test, message.fail_addWhitelist_3) + addContext(test, message.fail_addWhitelist_3); assert.fail(message.fail_addWhitelist_3); } catch (e) { let errorMessage = e.message; @@ -3918,15 +3835,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { await arkaPaymaster.addWhitelist([data.incorrectSender]); - addContext(test, message.fail_addWhitelist_4) + addContext(test, message.fail_addWhitelist_4); assert.fail(message.fail_addWhitelist_4); } catch (e) { let errorMessage = e.message; @@ -3950,14 +3863,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - let addwhitelist = await arkaPaymaster.addWhitelist([randomAddress.address]); + let addwhitelist = await arkaPaymaster.addWhitelist([ + randomAddress.address, + ]); if (addwhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_5); @@ -3988,14 +3899,13 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress = ethers.Wallet.createRandom(); - await arkaPaymaster.addWhitelist([randomAddress.address, data.sender]); + await arkaPaymaster.addWhitelist([ + randomAddress.address, + data.sender, + ]); if (addWhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_1); @@ -4026,17 +3936,16 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the add whitelist address try { const randomAddress1 = ethers.Wallet.createRandom(); const randomAddress2 = ethers.Wallet.createRandom(); // add whitelist addresses - let addwhitelist = await arkaPaymaster.addWhitelist([randomAddress1.address, randomAddress2.address]); + let addwhitelist = await arkaPaymaster.addWhitelist([ + randomAddress1.address, + randomAddress2.address, + ]); if (addwhitelist.includes(constant.add_whitelist_3)) { addContext(test, message.vali_addWhitelist_1); @@ -4067,16 +3976,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(data.invalidSender); - addContext(test, message.fail_checkWhitelist_2) - assert.fail(message.fail_checkWhitelist_2) + addContext(test, message.fail_checkWhitelist_2); + assert.fail(message.fail_checkWhitelist_2); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_5)) { @@ -4099,16 +4004,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(data.invalidSender); - addContext(test, message.fail_checkWhitelist_3) - assert.fail(message.fail_checkWhitelist_3) + addContext(test, message.fail_checkWhitelist_3); + assert.fail(message.fail_checkWhitelist_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_address_5)) { @@ -4131,14 +4032,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { const randomAddress = ethers.Wallet.createRandom(); - let checkwhitelist = await arkaPaymaster.checkWhitelist(randomAddress.address); + let checkwhitelist = await arkaPaymaster.checkWhitelist( + randomAddress.address + ); if (checkwhitelist.includes(constant.check_whitelist_1)) { addContext(test, message.vali_addWhitelist_2); @@ -4163,15 +4062,11 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the whilelist address try { await arkaPaymaster.checkWhitelist(); - addContext(test, message.fail_checkWhitelist_5) + addContext(test, message.fail_checkWhitelist_5); assert.fail(message.fail_checkWhitelist_5); } catch (e) { let errorMessage = e.message; @@ -4195,16 +4090,12 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with s var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - - // validate the deposit try { - await arkaPaymaster.deposit("one"); + await arkaPaymaster.deposit('one'); - addContext(test, message.fail_deposit_3) - assert.fail(message.fail_deposit_3) + addContext(test, message.fail_deposit_3); + assert.fail(message.fail_deposit_3); } catch (e) { let errorMessage = e.message; if (errorMessage.includes(constant.invalid_data)) { diff --git a/test/specs/testnet/transactionHistory/sepolia.spec.js b/test/specs/testnet/transactionHistory/sepolia.spec.js index 1b1703a..955422e 100644 --- a/test/specs/testnet/transactionHistory/sepolia.spec.js +++ b/test/specs/testnet/transactionHistory/sepolia.spec.js @@ -22,7 +22,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -30,15 +29,16 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction sepoliaTestNetSdk = new PrimeSdk( { privateKey: process.env.PRIVATE_KEY }, { - chainId: Number(data.sepolia_chainid) - }, + chainId: Number(data.sepolia_chainid), + } ); try { assert.strictEqual( sepoliaTestNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -60,7 +60,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction assert.strictEqual( sepoliaEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -70,16 +71,12 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction console.error(e.message); const eString = e.toString(); addContext(test, eString); - assert.fail( - message.fail_smart_address - ); + assert.fail(message.fail_smart_address); } // initializating Data service... try { - sepoliaDataService = new DataUtils( - process.env.DATA_API_KEY - ); + sepoliaDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -130,7 +127,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -219,7 +215,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.chainId, - message.vali_getTransaction_chainId); + message.vali_getTransaction_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -229,7 +226,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.hash, - message.vali_getTransaction_hash); + message.vali_getTransaction_hash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -239,7 +237,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.nonce, - message.vali_getTransaction_nonce); + message.vali_getTransaction_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -249,7 +248,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.blockHash, - message.vali_getTransaction_blockHash); + message.vali_getTransaction_blockHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -259,7 +259,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.blockNumber, - message.vali_getTransaction_blockNumber); + message.vali_getTransaction_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -269,7 +270,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.from, - message.vali_getTransaction_from); + message.vali_getTransaction_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -279,7 +281,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.to, - message.vali_getTransaction_to); + message.vali_getTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -289,7 +292,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.value, - message.vali_getTransaction_value); + message.vali_getTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -299,7 +303,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.gasPrice, - message.vali_getTransaction_gasPrice); + message.vali_getTransaction_gasPrice + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -309,7 +314,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.gasLimit, - message.vali_getTransaction_gasLimit); + message.vali_getTransaction_gasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -319,7 +325,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.input, - message.vali_getTransaction_input); + message.vali_getTransaction_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -329,7 +336,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.status, - message.vali_getTransaction_status); + message.vali_getTransaction_status + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -339,7 +347,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.blockExplorerUrl, - message.vali_getTransaction_blockExplorerUrl); + message.vali_getTransaction_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -349,7 +358,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.transactionIndex, - message.vali_getTransaction_transactionIndex); + message.vali_getTransaction_transactionIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -359,7 +369,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.gasUsed, - message.vali_getTransaction_gasUsed); + message.vali_getTransaction_gasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -369,7 +380,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].transactionIndex, - message.vali_getTransaction_log_transactionIndex); + message.vali_getTransaction_log_transactionIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -379,7 +391,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].blockNumber, - message.vali_getTransaction_log_blockNumber); + message.vali_getTransaction_log_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -389,7 +402,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].transactionHash, - message.vali_getTransaction_log_transactionHash); + message.vali_getTransaction_log_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -399,7 +413,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].address, - message.vali_getTransaction_log_address); + message.vali_getTransaction_log_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -409,7 +424,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].topics, - message.vali_getTransaction_log_topics); + message.vali_getTransaction_log_topics + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -419,7 +435,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].data, - message.vali_getTransaction_log_data); + message.vali_getTransaction_log_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -429,7 +446,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( singleTransaction.logs[0].logIndex, - message.vali_getTransaction_log_logIndex); + message.vali_getTransaction_log_logIndex + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -439,7 +457,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( singleTransaction.logs[0].blockHash, - message.vali_getTransaction_log_blockHash); + message.vali_getTransaction_log_blockHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -452,7 +471,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction assert.fail(message.fail_getTransaction_1); } } else { - addContext(test, message.vali_getTransaction_1) + addContext(test, message.vali_getTransaction_1); console.log(message.vali_getTransaction_1); } }, data.retry); // Retry this async test up to 5 times @@ -465,7 +484,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // Fetching historical transactions @@ -475,16 +493,18 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { transactions = await sepoliaDataService.getTransactions({ chainId: Number(data.sepolia_chainid), - account: data.sender + account: data.sender, }); randomTransaction = - Math.floor(Math.random() * (transactions.transactions.length - 1)) + 1; + Math.floor(Math.random() * (transactions.transactions.length - 1)) + + 1; try { assert.isNumber( transactions.transactions[randomTransaction].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -494,7 +514,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -504,7 +525,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -514,7 +536,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -524,7 +547,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -534,7 +558,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -544,7 +569,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -554,7 +580,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -564,7 +591,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -574,7 +602,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -584,7 +613,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -594,7 +624,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -604,7 +635,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[randomTransaction].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -614,7 +646,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -624,7 +657,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -634,7 +668,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -644,7 +679,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].preVerificationGas, - message.vali_getTransactions_preVerificationGas); + message.vali_getTransactions_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -654,7 +690,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -664,7 +701,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[randomTransaction].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -686,7 +724,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -761,7 +798,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } // wait for the 10 seconds - helper.wait(10000) + helper.wait(10000); // Fetching historical transactions let transactions; @@ -770,14 +807,15 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.sepolia_chainid), account: data.sender, page: 1, - limit: 10 + limit: 10, }); if (userOpsReceipt != null) { try { assert.isNumber( transactions.transactions[0].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -787,7 +825,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].blockNumber, - message.vali_getTransactions_blockNumber); + message.vali_getTransactions_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -797,7 +836,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -807,7 +847,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].target, - message.vali_getTransactions_target); + message.vali_getTransactions_target + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -817,7 +858,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -827,7 +869,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -837,7 +880,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -847,7 +891,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -857,7 +902,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -867,7 +913,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -877,7 +924,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -887,7 +935,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -897,7 +946,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -907,7 +957,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -917,7 +968,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -927,7 +979,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -937,7 +990,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -947,7 +1001,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -957,7 +1012,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].preVerificationGas, - 'The preVerificationGas value is empty in the get transactions response.'); + 'The preVerificationGas value is empty in the get transactions response.' + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -967,7 +1023,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -977,7 +1034,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -987,7 +1045,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -997,7 +1056,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].from, - message.vali_getTransactions_nativeTransfers_from); + message.vali_getTransactions_nativeTransfers_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1007,7 +1067,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].to, - message.vali_getTransactions_nativeTransfers_to); + message.vali_getTransactions_nativeTransfers_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1017,7 +1078,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].value, - message.vali_getTransactions_nativeTransfers_value); + message.vali_getTransactions_nativeTransfers_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1027,7 +1089,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].asset, - message.vali_getTransactions_nativeTransfers_asset); + message.vali_getTransactions_nativeTransfers_asset + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1037,7 +1100,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].address, - message.vali_getTransactions_nativeTransfers_address); + message.vali_getTransactions_nativeTransfers_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1047,7 +1111,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nativeTransfers[0].decimal, - message.vali_getTransactions_nativeTransfers_decimal); + message.vali_getTransactions_nativeTransfers_decimal + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1057,15 +1122,16 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].nativeTransfers[0].data, - message.vali_getTransactions_nativeTransfers_data); + message.vali_getTransactions_nativeTransfers_data + ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); } } else { - addContext(test, message.vali_getTransactions_1) - console.log(message.vali_getTransactions_1) + addContext(test, message.vali_getTransactions_1); + console.log(message.vali_getTransactions_1); } } catch (e) { console.error(e); @@ -1083,14 +1149,14 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1104,7 +1170,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1128,7 +1195,11 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1199,7 +1270,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction } // wait for the 10 seconds - helper.wait(10000) + helper.wait(10000); // Fetching historical transactions let transactions; @@ -1208,14 +1279,15 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.sepolia_chainid), account: data.sender, page: 1, - limit: 10 + limit: 10, }); if (userOpsReceipt != null) { try { assert.isNumber( transactions.transactions[0].chainId, - message.vali_getTransactions_chainId); + message.vali_getTransactions_chainId + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1225,7 +1297,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].blockNumber, - message.vali_getTransactions_blockNumber); + message.vali_getTransactions_blockNumber + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1235,7 +1308,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].sender, - message.vali_getTransactions_sender); + message.vali_getTransactions_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1245,7 +1319,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].target, - message.vali_getTransactions_target); + message.vali_getTransactions_target + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1255,7 +1330,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].transactionHash, - message.vali_getTransactions_transactionHash); + message.vali_getTransactions_transactionHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1265,7 +1341,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].userOpHash, - message.vali_getTransactions_userOpHash); + message.vali_getTransactions_userOpHash + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1275,7 +1352,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasCost, - message.vali_getTransactions_actualGasCost); + message.vali_getTransactions_actualGasCost + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1285,7 +1363,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].actualGasUsed, - message.vali_getTransactions_actualGasUsed); + message.vali_getTransactions_actualGasUsed + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1295,7 +1374,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].success, - message.vali_getTransactions_success); + message.vali_getTransactions_success + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1305,7 +1385,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].timestamp, - message.vali_getTransactions_timestamp); + message.vali_getTransactions_timestamp + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1315,7 +1396,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].paymaster, - message.vali_getTransactions_paymaster); + message.vali_getTransactions_paymaster + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1325,7 +1407,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].value, - message.vali_getTransactions_value); + message.vali_getTransactions_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1335,7 +1418,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].blockExplorerUrl, - message.vali_getTransactions_blockExplorerUrl); + message.vali_getTransactions_blockExplorerUrl + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1345,7 +1429,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].input, - message.vali_getTransactions_input); + message.vali_getTransactions_input + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1355,7 +1440,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].nonce, - message.vali_getTransactions_nonce); + message.vali_getTransactions_nonce + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1365,7 +1451,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].initCode, - message.vali_getTransactions_initCode); + message.vali_getTransactions_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1375,7 +1462,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].callData, - message.vali_getTransactions_callData); + message.vali_getTransactions_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1385,7 +1473,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].verificationGasLimit, - message.vali_getTransactions_verificationGasLimit); + message.vali_getTransactions_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1395,7 +1484,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].preVerificationGas, - message.vali_getTransactions_preVerificationGas); + message.vali_getTransactions_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1405,7 +1495,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxFeePerGas, - message.vali_getTransactions_maxFeePerGas); + message.vali_getTransactions_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1415,7 +1506,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1425,7 +1517,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].maxPriorityFeePerGas, - message.vali_getTransactions_maxPriorityFeePerGas); + message.vali_getTransactions_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1435,7 +1528,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].from, - message.vali_getTransactions_erc20Transfers_from); + message.vali_getTransactions_erc20Transfers_from + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1445,7 +1539,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].to, - message.vali_getTransactions_erc20Transfers_to); + message.vali_getTransactions_erc20Transfers_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1455,7 +1550,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].value, - message.vali_getTransactions_erc20Transfers_value); + message.vali_getTransactions_erc20Transfers_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1465,7 +1561,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].asset, - message.vali_getTransactions_erc20Transfers_asset); + message.vali_getTransactions_erc20Transfers_asset + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1475,7 +1572,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].address, - message.vali_getTransactions_erc20Transfers_address); + message.vali_getTransactions_erc20Transfers_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1485,7 +1583,8 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNumber( transactions.transactions[0].erc20Transfers[0].decimal, - message.vali_getTransactions_erc20Transfers_decimal); + message.vali_getTransactions_erc20Transfers_decimal + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1495,15 +1594,16 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction try { assert.isNotEmpty( transactions.transactions[0].erc20Transfers[0].data, - message.vali_getTransactions_erc20Transfers_data); + message.vali_getTransactions_erc20Transfers_data + ); } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); } } else { - addContext(test, message.vali_getTransactions_1) - console.log(message.vali_getTransactions_1) + addContext(test, message.vali_getTransactions_1); + console.log(message.vali_getTransactions_1); } } catch (e) { console.error(e); @@ -1521,9 +1621,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // Fetching a single transaction let transaction; try { @@ -1533,7 +1630,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction }); if (transaction === null || Object.keys(transaction).length === 0) { - addContext(test, message.vali_getTransactions_2) + addContext(test, message.vali_getTransactions_2); console.log(message.vali_getTransactions_2); } else { addContext(test, message.fail_getTransactions_6); @@ -1555,9 +1652,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // Fetching a single transaction try { await sepoliaDataService.getTransaction({ @@ -1565,11 +1659,11 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction chainId: Number(data.sepolia_chainid), }); - addContext(test, message.fail_getTransactions_7) + addContext(test, message.fail_getTransactions_7); assert.fail(message.fail_getTransactions_7); } catch (e) { if (e.errors[0].constraints.isHex === constant.hash_32) { - addContext(test, message.vali_getTransactions_3) + addContext(test, message.vali_getTransactions_3); console.log(message.vali_getTransactions_3); } else { console.error(e); @@ -1588,9 +1682,6 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let transactions = await sepoliaDataService.getTransactions({ chainId: Number(data.invalid_sepolia_chainid), @@ -1598,7 +1689,7 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction }); if (transactions.transactions.length === 0) { - addContext(test, message.vali_getTransactions_4) + addContext(test, message.vali_getTransactions_4); console.log(message.vali_getTransactions_4); } else { addContext(test, message.fail_getTransactions_8); @@ -1620,21 +1711,21 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { let a = await sepoliaDataService.getTransactions({ chainId: Number(data.sepolia_chainid), account: data.invalidSender, }); - addContext(test, message.fail_getTransactions_10) + addContext(test, message.fail_getTransactions_10); assert.fail(message.fail_getTransactions_10); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_getTransactions_6) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_getTransactions_6); console.log(message.vali_getTransactions_6); } else { console.error(e); @@ -1653,21 +1744,21 @@ describe('The PrimeSDK, when get the single transaction and multiple transaction var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - try { await sepoliaDataService.getTransactions({ chainId: Number(data.sepolia_chainid), account: data.incorrectSender, }); - addContext(test, message.fail_getTransactions_11) + addContext(test, message.fail_getTransactions_11); assert.fail(message.fail_getTransactions_11); } catch (e) { const errorResponse = JSON.parse(e.message); - if (errorResponse[0].constraints.isAddress === constant.invalid_address_1) { - addContext(test, message.vali_getTransactions_7) + if ( + errorResponse[0].constraints.isAddress === + constant.invalid_address_1 + ) { + addContext(test, message.vali_getTransactions_7); console.log(message.vali_getTransactions_7); } else { console.error(e); diff --git a/test/specs/testnet/transferringFunds/sepolia.spec.js b/test/specs/testnet/transferringFunds/sepolia.spec.js index 9a8ef76..14204d9 100644 --- a/test/specs/testnet/transferringFunds/sepolia.spec.js +++ b/test/specs/testnet/transferringFunds/sepolia.spec.js @@ -23,7 +23,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // initializating sdk @@ -32,13 +31,15 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe { privateKey: process.env.PRIVATE_KEY }, { chainId: Number(data.sepolia_chainid), - }); + } + ); try { assert.strictEqual( sepoliaTestNetSdk.state.EOAAddress, data.eoaAddress, - message.vali_eoa_address); + message.vali_eoa_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -60,7 +61,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe assert.strictEqual( sepoliaEtherspotWalletAddress, data.sender, - message.vali_smart_address); + message.vali_smart_address + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -75,8 +77,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe // initializating Data service... try { - sepoliaDataService = new DataUtils( - process.env.DATA_API_KEY); + sepoliaDataService = new DataUtils(process.env.DATA_API_KEY); } catch (e) { console.error(e); const eString = e.toString(); @@ -127,7 +128,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -151,7 +151,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -161,7 +162,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -171,7 +173,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -190,9 +193,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe balance = await sepoliaTestNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -213,7 +214,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -221,9 +223,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -233,7 +233,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -243,7 +244,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -253,7 +255,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -263,7 +266,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -273,7 +277,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -283,7 +288,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -293,7 +299,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -303,7 +310,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -313,7 +321,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -332,9 +341,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe uoHash = await sepoliaTestNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -356,19 +363,20 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); try { assert.isTrue( provider._isProvider, - message.vali_erc20Transfer_provider); + message.vali_erc20Transfer_provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -387,7 +395,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -401,9 +410,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe decimals = await erc20Instance.functions.decimals(); try { - assert.isNotEmpty( - decimals, - message.vali_erc20Contract_decimals); + assert.isNotEmpty(decimals, message.vali_erc20Contract_decimals); } catch (e) { console.error(e); const eString = e.toString(); @@ -421,12 +428,17 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); try { assert.isNotEmpty( transactionData, - message.vali_erc20Contract_transferFrom); + message.vali_erc20Contract_transferFrom + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -458,9 +470,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe }); try { - assert.isNotEmpty( - userOpsBatch.to, - message.vali_addTransaction_to); + assert.isNotEmpty(userOpsBatch.to, message.vali_addTransaction_to); } catch (e) { console.error(e); const eString = e.toString(); @@ -470,7 +480,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( userOpsBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -480,7 +491,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( userOpsBatch.value[0], - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -501,7 +513,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -509,9 +522,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -521,7 +532,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -531,7 +543,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -541,7 +554,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -551,7 +565,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -561,7 +576,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -571,7 +587,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -581,7 +598,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -591,7 +609,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -601,7 +620,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -620,9 +640,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe uoHash = await sepoliaTestNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -644,7 +662,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // get erc721 Contract Interface @@ -662,7 +679,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( erc721Data, - message.vali_erc721Transfer_contractInterface); + message.vali_erc721Transfer_contractInterface + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -696,7 +714,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( userOpsBatch.to[0], - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -706,7 +725,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( userOpsBatch.data[0], - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -716,7 +736,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( userOpsBatch.value[0], - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -737,7 +758,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -745,9 +767,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -757,7 +777,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -767,7 +788,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -777,7 +799,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -787,7 +810,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -797,7 +821,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -807,7 +832,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -817,7 +843,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -827,7 +854,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -837,7 +865,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -856,9 +885,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe uoHash = await sepoliaTestNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -880,7 +907,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); // clear the transaction batch @@ -904,7 +930,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -914,7 +941,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -924,7 +952,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -943,9 +972,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe balance = await sepoliaTestNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -967,7 +994,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.sender, - message.vali_estimateTransaction_sender); + message.vali_estimateTransaction_sender + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -975,9 +1003,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe } try { - assert.isNotEmpty( - op.nonce, - message.vali_estimateTransaction_nonce); + assert.isNotEmpty(op.nonce, message.vali_estimateTransaction_nonce); } catch (e) { console.error(e); const eString = e.toString(); @@ -987,7 +1013,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.initCode, - message.vali_estimateTransaction_initCode); + message.vali_estimateTransaction_initCode + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -997,7 +1024,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.callData, - message.vali_estimateTransaction_callData); + message.vali_estimateTransaction_callData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1007,7 +1035,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.callGasLimit, - message.vali_estimateTransaction_callGasLimit); + message.vali_estimateTransaction_callGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1017,7 +1046,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.verificationGasLimit, - message.vali_estimateTransaction_verificationGasLimit); + message.vali_estimateTransaction_verificationGasLimit + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1027,7 +1057,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.maxFeePerGas, - message.vali_estimateTransaction_maxFeePerGas); + message.vali_estimateTransaction_maxFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1037,7 +1068,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.maxPriorityFeePerGas, - message.vali_estimateTransaction_maxPriorityFeePerGas); + message.vali_estimateTransaction_maxPriorityFeePerGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1047,7 +1079,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.paymasterAndData, - message.vali_estimateTransaction_paymasterAndData); + message.vali_estimateTransaction_paymasterAndData + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1057,7 +1090,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.preVerificationGas, - message.vali_estimateTransaction_preVerificationGas); + message.vali_estimateTransaction_preVerificationGas + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1067,7 +1101,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( op.signature, - message.vali_estimateTransaction_signature); + message.vali_estimateTransaction_signature + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1086,9 +1121,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe uoHash = await sepoliaTestNetSdk.send(op); try { - assert.isNotEmpty( - uoHash, - message.vali_submitTransaction_uoHash); + assert.isNotEmpty(uoHash, message.vali_submitTransaction_uoHash); } catch (e) { console.error(e); const eString = e.toString(); @@ -1111,9 +1144,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { - await customRetryAsync(async function () { - helper.wait(data.mediumTimeout); const provider = new providers.JsonRpcProvider(); @@ -1139,7 +1170,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( transactionBatch.to, - message.vali_addTransaction_to); + message.vali_addTransaction_to + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1149,7 +1181,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( transactionBatch.data, - message.vali_addTransaction_data); + message.vali_addTransaction_data + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1159,7 +1192,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { assert.isNotEmpty( transactionBatch.value, - message.vali_addTransaction_value); + message.vali_addTransaction_value + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1178,9 +1212,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe balance = await sepoliaTestNetSdk.getNativeBalance(); try { - assert.isNotEmpty( - balance, - message.vali_getBalance_balance); + assert.isNotEmpty(balance, message.vali_getBalance_balance); } catch (e) { console.error(e); const eString = e.toString(); @@ -1201,11 +1233,13 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { while (--concurrentUseropsCount >= 0) { - const op = await sepoliaTestNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await sepoliaTestNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await sepoliaTestNetSdk.send(op); uoHashes.push(uoHash); @@ -1214,37 +1248,41 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_submitTransaction_1) + assert.fail(message.fail_submitTransaction_1); } try { console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await sepoliaTestNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await sepoliaTestNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -1256,9 +1294,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1295,12 +1330,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await sepoliaTestNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_9) + addContext(test, message.fail_estimateTransaction_9); assert.fail(message.fail_estimateTransaction_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1319,9 +1354,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1358,12 +1390,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await sepoliaTestNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_10) + addContext(test, message.fail_estimateTransaction_10); assert.fail(message.fail_estimateTransaction_10); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_9) + addContext(test, message.vali_estimateTransaction_9); console.log(message.vali_estimateTransaction_9); } else { console.error(e); @@ -1382,9 +1414,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1401,11 +1430,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe value: ethers.utils.parseUnits(data.invalidValue), // invalid value }); - addContext(test, message.fail_estimateTransaction_11) + addContext(test, message.fail_estimateTransaction_11); assert.fail(message.fail_estimateTransaction_11); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_estimateTransaction_10) + addContext(test, message.vali_estimateTransaction_10); console.log(message.vali_estimateTransaction_10); } else { console.error(e); @@ -1424,9 +1453,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1443,11 +1469,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe value: ethers.utils.parseUnits(data.smallValue), // very small value }); - addContext(test, message.fail_estimateTransaction_12) + addContext(test, message.fail_estimateTransaction_12); assert.fail(message.fail_estimateTransaction_12); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_estimateTransaction_11) + addContext(test, message.vali_estimateTransaction_11); console.log(message.vali_estimateTransaction_11); } else { console.error(e); @@ -1466,9 +1492,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1493,11 +1516,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await sepoliaTestNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -1516,9 +1539,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1556,12 +1576,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await sepoliaTestNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_9) + addContext(test, message.fail_estimateTransaction_9); assert.fail(message.fail_estimateTransaction_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1580,9 +1600,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1620,12 +1637,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await sepoliaTestNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_10) + addContext(test, message.fail_estimateTransaction_10); assert.fail(message.fail_estimateTransaction_10); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_8) + addContext(test, message.vali_estimateTransaction_8); console.log(message.vali_estimateTransaction_8); } else { console.error(e); @@ -1644,9 +1661,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // clear the transaction batch try { await sepoliaTestNetSdk.clearUserOpsFromBatch(); @@ -1672,11 +1686,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await sepoliaTestNetSdk.estimate({ callGasLimit: 40000 }); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.empty_batch) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -1695,14 +1709,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.invalidProviderNetwork_sepolia, // invalid provider + data.invalidProviderNetwork_sepolia // invalid provider ); } catch (e) { console.error(e); @@ -1717,7 +1728,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1729,11 +1741,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_14) + addContext(test, message.fail_estimateTransaction_14); assert.fail(message.fail_estimateTransaction_14); } catch (e) { if (e.reason === constant.invalid_network_2) { - addContext(test, message.vali_estimateTransaction_13) + addContext(test, message.vali_estimateTransaction_13); console.log(message.vali_estimateTransaction_13); } else { console.error(e); @@ -1752,9 +1764,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { @@ -1772,7 +1781,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1784,11 +1794,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_14) + addContext(test, message.fail_estimateTransaction_14); assert.fail(message.fail_estimateTransaction_14); } catch (e) { if (e.reason === constant.invalid_network_2) { - addContext(test, message.vali_estimateTransaction_13) + addContext(test, message.vali_estimateTransaction_13); console.log(message.vali_estimateTransaction_13); } else { console.error(e); @@ -1807,14 +1817,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.otherProviderNetwork_sepolia, // other provider + data.otherProviderNetwork_sepolia // other provider ); } catch (e) { console.error(e); @@ -1829,7 +1836,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1841,12 +1849,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_estimateTransaction_15) + addContext(test, message.fail_estimateTransaction_15); assert.fail(message.fail_estimateTransaction_15); } catch (e) { let error = e.message; if (error.includes(constant.invalid_value_3)) { - addContext(test, message.vali_estimateTransaction_14) + addContext(test, message.vali_estimateTransaction_14); console.log(message.vali_estimateTransaction_14); } else { console.error(e); @@ -1865,14 +1873,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1886,7 +1892,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.incorrectTokenAddress_sepoliaUSDC, // incorrect token address ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1898,11 +1905,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await erc20Instance.functions.decimals(); - addContext(message.fail_erc20Transfer_1) + addContext(message.fail_erc20Transfer_1); assert.fail(message.fail_erc20Transfer_1); } catch (e) { if (e.reason === constant.invalid_address_6) { - addContext(test, message.vali_erc20Transfer_1) + addContext(test, message.vali_erc20Transfer_1); console.log(message.vali_erc20Transfer_1); } else { console.error(e); @@ -1921,14 +1928,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1942,7 +1947,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.invalidTokenAddress_sepoliaUSDC, // invalid token address ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1954,11 +1960,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await erc20Instance.functions.decimals(); - addContext(test, message.fail_erc20Transfer_2) + addContext(test, message.fail_erc20Transfer_2); assert.fail(message.fail_erc20Transfer_2); } catch (e) { if (e.reason === constant.invalid_address_4) { - addContext(test, message.vali_erc20Transfer_2) + addContext(test, message.vali_erc20Transfer_2); console.log(message.vali_erc20Transfer_2); } else { console.error(e); @@ -1977,14 +1983,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -1996,11 +2000,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { new ethers.Contract(null, ERC20_ABI, provider); // null token address - addContext(test, message.fail_erc20Transfer_3) + addContext(test, message.fail_erc20Transfer_3); assert.fail(message.fail_erc20Transfer_3); } catch (e) { if (e.reason === constant.contract_address_2) { - addContext(test, message.vali_erc20Transfer_3) + addContext(test, message.vali_erc20Transfer_3); console.log(message.vali_erc20Transfer_3); } else { console.error(e); @@ -2019,14 +2023,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2040,7 +2042,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2066,11 +2069,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_4) + addContext(test, message.fail_erc20Transfer_4); assert.fail(message.fail_erc20Transfer_4); } catch (e) { if (e.reason === constant.no_function) { - addContext(test, message.vali_erc20Transfer_4) + addContext(test, message.vali_erc20Transfer_4); console.log(message.vali_erc20Transfer_4); } else { console.error(e); @@ -2089,14 +2092,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2110,7 +2111,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2136,11 +2138,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe ethers.utils.parseUnits(data.invalidValue, decimals), // invalid value ]); - addContext(test, message.fail_erc20Transfer_5) + addContext(test, message.fail_erc20Transfer_5); assert.fail(message.fail_erc20Transfer_5); } catch (e) { if (e.reason === constant.invalid_value_1) { - addContext(test, message.vali_erc20Transfer_5) + addContext(test, message.vali_erc20Transfer_5); console.log(message.vali_erc20Transfer_5); } else { console.error(e); @@ -2159,14 +2161,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2180,7 +2180,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2206,11 +2207,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe ethers.utils.parseUnits(data.smallValue, decimals), // very small value ]); - addContext(test, message.fail_erc20Transfer_6) + addContext(test, message.fail_erc20Transfer_6); assert.fail(message.fail_erc20Transfer_6); } catch (e) { if (e.reason === constant.invalid_value_2) { - addContext(test, message.vali_erc20Transfer_6) + addContext(test, message.vali_erc20Transfer_6); console.log(message.vali_erc20Transfer_6); } else { console.error(e); @@ -2229,14 +2230,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2250,7 +2249,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2274,11 +2274,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe data.recipient, ]); - addContext(test, message.fail_erc20Transfer_7) + addContext(test, message.fail_erc20Transfer_7); assert.fail(message.fail_erc20Transfer_7); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc20Transfer_7) + addContext(test, message.vali_erc20Transfer_7); console.log(message.vali_erc20Transfer_7); } else { console.error(e); @@ -2297,14 +2297,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2318,7 +2316,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2344,12 +2343,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_8) + addContext(test, message.fail_erc20Transfer_8); assert.fail(message.fail_erc20Transfer_8); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc20Transfer_8) + addContext(test, message.vali_erc20Transfer_8); console.log(message.vali_erc20Transfer_8); } else { console.error(e); @@ -2368,14 +2367,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2389,7 +2386,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2415,12 +2413,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_9) + addContext(test, message.fail_erc20Transfer_9); assert.fail(message.fail_erc20Transfer_9); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc20Transfer_9) + addContext(test, message.vali_erc20Transfer_9); console.log(message.vali_erc20Transfer_9); } else { console.error(e); @@ -2439,14 +2437,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2460,7 +2456,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2485,11 +2482,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe ethers.utils.parseUnits(data.erc20_value, decimals), ]); - addContext(test, message.fail_erc20Transfer_10) + addContext(test, message.fail_erc20Transfer_10); assert.fail(message.fail_erc20Transfer_10); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc20Transfer_10) + addContext(test, message.vali_erc20Transfer_10); console.log(message.vali_erc20Transfer_10); } else { console.error(e); @@ -2508,14 +2505,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2529,7 +2524,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2553,7 +2549,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2588,12 +2588,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await sepoliaTestNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_16) + addContext(test, message.fail_estimateTransaction_16); assert.fail(message.fail_estimateTransaction_16); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_6)) { - addContext(test, message.vali_estimateTransaction_15) + addContext(test, message.vali_estimateTransaction_15); console.log(message.vali_estimateTransaction_15); } else { console.error(e); @@ -2612,14 +2612,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2633,7 +2631,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2657,7 +2656,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2692,12 +2695,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await sepoliaTestNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_17) + addContext(test, message.fail_estimateTransaction_17); assert.fail(message.fail_estimateTransaction_17); } catch (e) { let error = e.reason; if (error.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_16) + addContext(test, message.vali_estimateTransaction_16); console.log(message.vali_estimateTransaction_16); } else { console.error(e); @@ -2716,14 +2719,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2737,7 +2738,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2761,7 +2763,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2796,11 +2802,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await sepoliaTestNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_18) + addContext(test, message.fail_estimateTransaction_18); assert.fail(message.fail_estimateTransaction_18); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_17) + addContext(test, message.vali_estimateTransaction_17); console.log(message.vali_estimateTransaction_17); } else { console.error(e); @@ -2819,14 +2825,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2840,7 +2844,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2864,7 +2869,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { transactionData = erc20Instance.interface.encodeFunctionData( 'transfer', - [data.recipient, ethers.utils.parseUnits(data.erc20_value, decimals)]); + [ + data.recipient, + ethers.utils.parseUnits(data.erc20_value, decimals), + ] + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2898,11 +2907,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await sepoliaTestNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_19) + addContext(test, message.fail_estimateTransaction_19); assert.fail(message.fail_estimateTransaction_19); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_estimateTransaction_18) + addContext(test, message.vali_estimateTransaction_18); console.log(message.vali_estimateTransaction_18); } else { console.error(e); @@ -2921,14 +2930,12 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get the respective provider details let provider; try { provider = new ethers.providers.JsonRpcProvider( - data.providerNetwork_sepolia); + data.providerNetwork_sepolia + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2942,7 +2949,8 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe erc20Instance = new ethers.Contract( data.tokenAddress_sepoliaUSDC, ERC20_ABI, - provider); + provider + ); } catch (e) { console.error(e); const eString = e.toString(); @@ -2991,7 +2999,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -3010,9 +3018,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3024,11 +3029,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_1) + addContext(test, message.fail_erc721Transfer_1); assert.fail(message.fail_erc721Transfer_1); } catch (e) { if (e.reason.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc721Transfer_1) + addContext(test, message.vali_erc721Transfer_1); console.log(message.vali_erc721Transfer_1); } else { console.error(e); @@ -3047,9 +3052,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3061,11 +3063,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_2) + addContext(test, message.fail_erc721Transfer_2); assert.fail(message.fail_erc721Transfer_2); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc721Transfer_2) + addContext(test, message.vali_erc721Transfer_2); console.log(message.vali_erc721Transfer_2); } else { console.error(e); @@ -3084,9 +3086,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3097,11 +3096,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_3) + addContext(test, message.fail_erc721Transfer_3); assert.fail(message.fail_erc721Transfer_3); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_3) + addContext(test, message.vali_erc721Transfer_3); console.log(message.vali_erc721Transfer_3); } else { console.error(e); @@ -3120,9 +3119,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3134,11 +3130,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_4) + addContext(test, message.fail_erc721Transfer_4); assert.fail(message.fail_erc721Transfer_4); } catch (e) { if (e.reason.includes(constant.invalid_address_6)) { - addContext(test, message.vali_erc721Transfer_4) + addContext(test, message.vali_erc721Transfer_4); console.log(message.vali_erc721Transfer_4); } else { console.error(e); @@ -3157,9 +3153,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3171,11 +3164,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_5) + addContext(test, message.fail_erc721Transfer_5); assert.fail(message.fail_erc721Transfer_5); } catch (e) { if (e.reason.includes(constant.invalid_address_4)) { - addContext(test, message.vali_erc721Transfer_5) + addContext(test, message.vali_erc721Transfer_5); console.log(message.vali_erc721Transfer_5); } else { console.error(e); @@ -3194,9 +3187,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3207,11 +3197,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe data.tokenId, ]); - addContext(test, message.fail_erc721Transfer_6) + addContext(test, message.fail_erc721Transfer_6); assert.fail(message.fail_erc721Transfer_6); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_6) + addContext(test, message.vali_erc721Transfer_6); console.log(message.vali_erc721Transfer_6); } else { console.error(e); @@ -3230,9 +3220,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3244,11 +3231,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe data.incorrectTokenId, // incorrect tokenid ]); - addContext(message.fail_erc721Transfer_7) + addContext(message.fail_erc721Transfer_7); assert.fail(message.fail_erc721Transfer_7); } catch (e) { if (e.reason === constant.invalid_bignumber_1) { - addContext(test, message.vali_erc721Transfer_7) + addContext(test, message.vali_erc721Transfer_7); console.log(message.vali_erc721Transfer_7); } else { console.error(e); @@ -3267,9 +3254,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3280,11 +3264,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe data.recipient, // not added tokenid ]); - addContext(test, message.fail_erc721Transfer_8) + addContext(test, message.fail_erc721Transfer_8); assert.fail(message.fail_erc721Transfer_8); } catch (e) { if (e.reason === constant.invalid_value_4) { - addContext(test, message.vali_erc721Transfer_8) + addContext(test, message.vali_erc721Transfer_8); console.log(message.vali_erc721Transfer_8); } else { console.error(e); @@ -3303,9 +3287,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - // get erc721 Contract Interface let erc721Interface; try { @@ -3347,11 +3328,11 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { await sepoliaTestNetSdk.estimate(); - addContext(test, message.fail_estimateTransaction_13) + addContext(test, message.fail_estimateTransaction_13); assert.fail(message.fail_estimateTransaction_13); } catch (e) { if (e.message === constant.invalid_parameter) { - addContext(test, message.vali_estimateTransaction_12) + addContext(test, message.vali_estimateTransaction_12); console.log(message.vali_estimateTransaction_12); } else { console.error(e); @@ -3371,11 +3352,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); // clear the transaction batch @@ -3406,7 +3383,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe let balance; try { balance = await sepoliaTestNetSdk.getNativeBalance(); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3422,48 +3398,54 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { while (--concurrentUseropsCount >= 0) { - const op = await sepoliaTestNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await sepoliaTestNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await sepoliaTestNetSdk.send(op); uoHashes.push(uoHash); } } catch (e) { - addContext(test, message.fail_submitTransaction_1) - assert.fail(message.fail_submitTransaction_1) + addContext(test, message.fail_submitTransaction_1); + assert.fail(message.fail_submitTransaction_1); } try { console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await sepoliaTestNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await sepoliaTestNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -3476,11 +3458,7 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); // clear the transaction batch @@ -3500,7 +3478,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe to: data.recipient, value: ethers.utils.parseEther(data.value), }); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3512,7 +3489,6 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe let balance; try { balance = await sepoliaTestNetSdk.getNativeBalance(); - } catch (e) { console.error(e); const eString = e.toString(); @@ -3528,48 +3504,54 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe try { while (--concurrentUseropsCount >= 0) { - const op = await sepoliaTestNetSdk.estimate({ key: concurrentUseropsCount }); + const op = await sepoliaTestNetSdk.estimate({ + key: concurrentUseropsCount, + }); userops.push(op); } - console.log("Sending userops..."); + console.log('Sending userops...'); for (const op of userops) { const uoHash = await sepoliaTestNetSdk.send(op); uoHashes.push(uoHash); } } catch (e) { - addContext(test, message.fail_submitTransaction_1) - assert.fail(message.fail_submitTransaction_1) + addContext(test, message.fail_submitTransaction_1); + assert.fail(message.fail_submitTransaction_1); } try { console.log('Waiting for transactions...'); const userOpsReceipts = new Array(uoHashes.length).fill(null); const timeout = Date.now() + 60000; // 1 minute timeout - while ((userOpsReceipts.some(receipt => receipt == null)) && (Date.now() < timeout)) { - helper.wait(2000) + while ( + userOpsReceipts.some((receipt) => receipt == null) && + Date.now() < timeout + ) { + helper.wait(2000); for (let i = 0; i < uoHashes.length; ++i) { if (userOpsReceipts[i]) continue; const uoHash = uoHashes[i]; - userOpsReceipts[i] = await sepoliaTestNetSdk.getUserOpReceipt(uoHash); + userOpsReceipts[i] = + await sepoliaTestNetSdk.getUserOpReceipt(uoHash); } } - if (userOpsReceipts.some(receipt => receipt != null)) { + if (userOpsReceipts.some((receipt) => receipt != null)) { for (const uoReceipt of userOpsReceipts) { if (!uoReceipt) continue; - addContext(test, message.vali_submitTransaction_1) + addContext(test, message.vali_submitTransaction_1); console.log(message.vali_submitTransaction_1); } } else { - addContext(test, message.vali_submitTransaction_2) + addContext(test, message.vali_submitTransaction_2); console.log(message.vali_submitTransaction_2); } } catch (e) { console.error(e); const eString = e.toString(); addContext(test, eString); - assert.fail(message.fail_getUserOpReceipt_1) + assert.fail(message.fail_getUserOpReceipt_1); } }, data.retry); // Retry this async test up to 5 times } else { @@ -3580,26 +3562,22 @@ describe('The PrimeSDK, when transfer a token with sepolia network on the TestNe it('REGRESSION: Perform the concurrent userops with non deployed address on the sepolia network', async function () { var test = this; if (runTest) { - await customRetryAsync(async function () { - - helper.wait(data.mediumTimeout); - const provider = new providers.JsonRpcProvider(); try { if ((await provider.getCode(data.eoaAddress)).length <= 2) { - addContext(test, message.vali_deployAddress_1) + addContext(test, message.vali_deployAddress_1); console.log(message.vali_deployAddress_1); return; } - addContext(test, message.fail_deployAddress_1) - assert.fail(message.fail_deployAddress_1) + addContext(test, message.fail_deployAddress_1); + assert.fail(message.fail_deployAddress_1); } catch (e) { const errorMessage = e.message; if (errorMessage.includes(constant.invalid_network_2)) { - addContext(test, message.vali_deployAddress_2) + addContext(test, message.vali_deployAddress_2); console.log(message.vali_deployAddress_2); } else { console.error(e); diff --git a/test/utils/baseTest.js b/test/utils/baseTest.js index cf29937..2e13215 100644 --- a/test/utils/baseTest.js +++ b/test/utils/baseTest.js @@ -1,4 +1,4 @@ -import helper from "./helper.js"; +import helper from './helper.js'; function customRetryAsync(fn, maxRetries) { return new Promise((resolve, reject) => { @@ -12,9 +12,7 @@ function customRetryAsync(fn, maxRetries) { } catch (error) { if (retries < maxRetries) { console.log( - `Test failed (retry ${retries + 1}/${maxRetries}): ${ - error.message - }`, + `Test failed (retry ${retries + 1}/${maxRetries}): ${error.message}` ); await new Promise((resolve) => setTimeout(resolve, retryDelay)); retries++; @@ -28,4 +26,4 @@ function customRetryAsync(fn, maxRetries) { }); } -export default customRetryAsync; \ No newline at end of file +export default customRetryAsync;