diff --git a/.github/workflows/fork-state.yml b/.github/workflows/fork-state.yml index 7292fd72d..d32c5bbf9 100644 --- a/.github/workflows/fork-state.yml +++ b/.github/workflows/fork-state.yml @@ -83,7 +83,7 @@ jobs: - name: Fetch the service status uses: nev7n/wait_for_response@v1 with: - url: "https://devnet.cicd.rootnet.app:9933/" + url: "https://devnet.cicd.rootnet.app:9944/" responseCode: 405 timeout: 300 interval: 20 diff --git a/Dockerfile b/Dockerfile index 45c7af2ef..c5bf65b8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,6 @@ LABEL maintainer="The Root Network Team" LABEL org.opencontainers.image.source=https://github.com/futureversecom/trn-seed COPY --from=0 /workdir/target/release/seed /usr/bin/ -EXPOSE 30333 9933 9944 +EXPOSE 30333 9944 VOLUME ["/node-data"] ENTRYPOINT ["/usr/bin/seed"] diff --git a/README.md b/README.md index a41dd386d..357392343 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,11 @@ Docker images are published for every tagged release, you can quickly have a nod ```bash # Root chainspec -docker run -p 9933:9933 -p 9944:9944 -p 30333:30333 ghcr.io/futureversecom/seed:latest --chain=root +docker run -p 9944:9944 -p 30333:30333 ghcr.io/futureversecom/seed:latest --chain=root # Porcini chainspec -docker run -p 9933:9933 -p 9944:9944 -p 30333:30333 ghcr.io/futureversecom/seed:latest --chain=porcini +docker run -p 9944:9944 -p 30333:30333 ghcr.io/futureversecom/seed:latest --chain=porcini # Dev chainspec -docker run -p 9933:9933 -p 9944:9944 -p 30333:30333 ghcr.io/futureversecom/seed:latest --dev --unsafe-rpc-external --unsafe-ws-external --rpc-cors=all +docker run -p 9944:9944 -p 30333:30333 ghcr.io/futureversecom/seed:latest --dev --unsafe-rpc-external --rpc-port=9944 --rpc-cors=all ``` ### Run using source code @@ -63,7 +63,7 @@ After building the source code, run the following commands to start the node. # Porcini chainspec ./target/release/seed --chain=porcini # Dev chainspec -./target/release/seed --dev --unsafe-rpc-external --unsafe-ws-external --rpc-cors=all +./target/release/seed --dev --unsafe-rpc-external --rpc-port=9944 --rpc-cors=all ``` ## 🚧 Development diff --git a/ci-scripts/runtime-upgrade/yarn.lock b/ci-scripts/runtime-upgrade/yarn.lock deleted file mode 100644 index c365bee38..000000000 --- a/ci-scripts/runtime-upgrade/yarn.lock +++ /dev/null @@ -1,502 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@noble/curves@1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.1.0.tgz#f13fc667c89184bc04cccb9b11e8e7bae27d8c3d" - integrity sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA== - dependencies: - "@noble/hashes" "1.3.1" - -"@noble/hashes@1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9" - integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== - -"@polkadot/api-augment@10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-10.9.1.tgz#9fc81b81903229bb23b0b16783e97ec52a5d4f1b" - integrity sha512-kRZZvCFVcN4hAH4dJ+Qzfdy27/4EEq3oLDf3ihj0LTVrAezSWcKPGE3EVFy+Mn6Lo4SUc7RVyoKvIUhSk2l4Dg== - dependencies: - "@polkadot/api-base" "10.9.1" - "@polkadot/rpc-augment" "10.9.1" - "@polkadot/types" "10.9.1" - "@polkadot/types-augment" "10.9.1" - "@polkadot/types-codec" "10.9.1" - "@polkadot/util" "^12.3.1" - tslib "^2.5.3" - -"@polkadot/api-base@10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-10.9.1.tgz#27f63c4950814c2f10535f794121fa1384dc2207" - integrity sha512-Q3m2KzlceMK2kX8bhnUZWk3RT6emmijeeFZZQgCePpEcrSeNjnqG4qjuTPgkveaOkUT8MAoDc5Avuzcc2jlW9g== - dependencies: - "@polkadot/rpc-core" "10.9.1" - "@polkadot/types" "10.9.1" - "@polkadot/util" "^12.3.1" - rxjs "^7.8.1" - tslib "^2.5.3" - -"@polkadot/api-derive@10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-10.9.1.tgz#04a4ca3285fd215c4cd50cfb3f4791d38dd90050" - integrity sha512-mRud1UZCFIc4Z63qAoGSIHh/foyUYADfy1RQYCmPpeFKfIdCIrHpd7xFdJXTOMYOS0BwlM6u4qli/ZT4XigezQ== - dependencies: - "@polkadot/api" "10.9.1" - "@polkadot/api-augment" "10.9.1" - "@polkadot/api-base" "10.9.1" - "@polkadot/rpc-core" "10.9.1" - "@polkadot/types" "10.9.1" - "@polkadot/types-codec" "10.9.1" - "@polkadot/util" "^12.3.1" - "@polkadot/util-crypto" "^12.3.1" - rxjs "^7.8.1" - tslib "^2.5.3" - -"@polkadot/api@10.9.1", "@polkadot/api@^10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-10.9.1.tgz#156b3436f45ef18218960804988c1f552d2c4e46" - integrity sha512-ND/2UqZBWvtt4PfV03OStTKg0mxmPk4UpMAgJKutdgsz/wP9CYJ1KbjwFgPNekL9JnzbKQsWyQNPVrcw7kQk8A== - dependencies: - "@polkadot/api-augment" "10.9.1" - "@polkadot/api-base" "10.9.1" - "@polkadot/api-derive" "10.9.1" - "@polkadot/keyring" "^12.3.1" - "@polkadot/rpc-augment" "10.9.1" - "@polkadot/rpc-core" "10.9.1" - "@polkadot/rpc-provider" "10.9.1" - "@polkadot/types" "10.9.1" - "@polkadot/types-augment" "10.9.1" - "@polkadot/types-codec" "10.9.1" - "@polkadot/types-create" "10.9.1" - "@polkadot/types-known" "10.9.1" - "@polkadot/util" "^12.3.1" - "@polkadot/util-crypto" "^12.3.1" - eventemitter3 "^5.0.1" - rxjs "^7.8.1" - tslib "^2.5.3" - -"@polkadot/keyring@^12.3.1": - version "12.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-12.3.2.tgz#112a0c28816a1f47edad6260dc94222c29465a54" - integrity sha512-NTdtDeI0DP9l/45hXynNABeP5VB8piw5YR+CbUxK2e36xpJWVXwbcOepzslg5ghE9rs8UKJb30Z/HqTU4sBY0Q== - dependencies: - "@polkadot/util" "12.3.2" - "@polkadot/util-crypto" "12.3.2" - tslib "^2.5.3" - -"@polkadot/networks@12.3.2", "@polkadot/networks@^12.3.1": - version "12.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-12.3.2.tgz#131b0439c481add159814dd2cf0286c6c3fe5b3b" - integrity sha512-uCkyybKoeEm1daKr0uT/9oNDHDDzCy2/ZdVl346hQqfdR1Ct3BaxMjxqvdmb5N8aCw0cBWSfgsxAYtw8ESmllQ== - dependencies: - "@polkadot/util" "12.3.2" - "@substrate/ss58-registry" "^1.40.0" - tslib "^2.5.3" - -"@polkadot/rpc-augment@10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-10.9.1.tgz#214ec3ee145d20caa61ea204041a3aadb89c6b0f" - integrity sha512-MaLHkNlyqN20ZRYr6uNd1BZr1OsrnX9qLAmsl0mcrri1vPGRH6VHjfFH1RBLkikpWD82v17g0l2hLwdV1ZHMcw== - dependencies: - "@polkadot/rpc-core" "10.9.1" - "@polkadot/types" "10.9.1" - "@polkadot/types-codec" "10.9.1" - "@polkadot/util" "^12.3.1" - tslib "^2.5.3" - -"@polkadot/rpc-core@10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-10.9.1.tgz#798c514dbed6f6c2e43098a494c9f51fb144dc31" - integrity sha512-ZtA8B8SfXSAwVkBlCcKRHw0eSM7ec/sbiNOM5GasXPeRujUgT7lOwSH2GbUZSqe9RfRDMp6DvO9c2JoGc3LLWw== - dependencies: - "@polkadot/rpc-augment" "10.9.1" - "@polkadot/rpc-provider" "10.9.1" - "@polkadot/types" "10.9.1" - "@polkadot/util" "^12.3.1" - rxjs "^7.8.1" - tslib "^2.5.3" - -"@polkadot/rpc-provider@10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-10.9.1.tgz#de3a474bbcd26d28d9cd3134acdb3b5ce92b680b" - integrity sha512-4QzT2QzD+320+eT6b79sGAA85Tt3Bb8fQvse4r5Mom2iiBd2SO81vOhxSAOaIe4GUsw25VzFJmsbe7+OObItdg== - dependencies: - "@polkadot/keyring" "^12.3.1" - "@polkadot/types" "10.9.1" - "@polkadot/types-support" "10.9.1" - "@polkadot/util" "^12.3.1" - "@polkadot/util-crypto" "^12.3.1" - "@polkadot/x-fetch" "^12.3.1" - "@polkadot/x-global" "^12.3.1" - "@polkadot/x-ws" "^12.3.1" - eventemitter3 "^5.0.1" - mock-socket "^9.2.1" - nock "^13.3.1" - tslib "^2.5.3" - optionalDependencies: - "@substrate/connect" "0.7.26" - -"@polkadot/types-augment@10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-10.9.1.tgz#5f1c1225c04ffbfe243629a46087c9c9de25a6b3" - integrity sha512-OY9/jTMFRFqYdkUnfcGwqMLC64A0Q25bjvCuVQCVjsPFKE3wl0Kt5rNT01eV2UmLXrR6fY0xWbR2w80bLA7CIQ== - dependencies: - "@polkadot/types" "10.9.1" - "@polkadot/types-codec" "10.9.1" - "@polkadot/util" "^12.3.1" - tslib "^2.5.3" - -"@polkadot/types-codec@10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-10.9.1.tgz#f30026d3dfeaa69c07c45fa66d1c39318fd232cc" - integrity sha512-mJ5OegKGraY1FLvEa8FopRCr3pQrhDkcn5RNOjmgJQozENVeRaxhk0NwxYz7IojFvSDnKnc6lNQfKaaSe5pLHg== - dependencies: - "@polkadot/util" "^12.3.1" - "@polkadot/x-bigint" "^12.3.1" - tslib "^2.5.3" - -"@polkadot/types-create@10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-10.9.1.tgz#087d7e2af51cce558b67e3859613b932a3bdc0a3" - integrity sha512-OVz50MGTTuiuVnRP/zAx4CTuLioc0hsiwNwqN2lNhmIJGtnQ4Vy/7mQRsIWehiYz6g0Vzzm5B3qWkTXO1NSN5w== - dependencies: - "@polkadot/types-codec" "10.9.1" - "@polkadot/util" "^12.3.1" - tslib "^2.5.3" - -"@polkadot/types-known@10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-10.9.1.tgz#fe0c7e55191aa843119edcaf9abb5d2471463a7d" - integrity sha512-zCMVWc4pJtkbMFPu72bD4IhvV/gkHXPX3C5uu92WdmCfnn0vEIEsMKWlVXVVvQQZKAqvs/awpqIfrUtEViOGEA== - dependencies: - "@polkadot/networks" "^12.3.1" - "@polkadot/types" "10.9.1" - "@polkadot/types-codec" "10.9.1" - "@polkadot/types-create" "10.9.1" - "@polkadot/util" "^12.3.1" - tslib "^2.5.3" - -"@polkadot/types-support@10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-10.9.1.tgz#17a861aab8e5a225a4e20cefa2d16076ddd51baf" - integrity sha512-XsieuLDsszvMZQlleacQBfx07i/JkwQV/UxH9q8Hz7Okmaz9pEVEW1h3ka2/cPuC7a4l32JhaORBUYshBZNdJg== - dependencies: - "@polkadot/util" "^12.3.1" - tslib "^2.5.3" - -"@polkadot/types@10.9.1", "@polkadot/types@^10.9.1": - version "10.9.1" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-10.9.1.tgz#f111d00f7278ad3be95deba3d701fafefe080cb2" - integrity sha512-AG33i2ZGGfq7u+5rkAdGrXAQHHl844/Yv+junH5ZzX69xiCoWO1bH/yzDUNBdpki2GlACWvF9nLYh3F2tVF93w== - dependencies: - "@polkadot/keyring" "^12.3.1" - "@polkadot/types-augment" "10.9.1" - "@polkadot/types-codec" "10.9.1" - "@polkadot/types-create" "10.9.1" - "@polkadot/util" "^12.3.1" - "@polkadot/util-crypto" "^12.3.1" - rxjs "^7.8.1" - tslib "^2.5.3" - -"@polkadot/util-crypto@12.3.2", "@polkadot/util-crypto@^12.3.1": - version "12.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-12.3.2.tgz#42d810886904e06fa6e5db254c15f6ef80f4ab72" - integrity sha512-pTpx+YxolY0BDT4RcGmgeKbHHD/dI6Ll9xRsqmVdIjpcVVY20uDNTyXs81ZNtfKgyod1y9JQkfNv2Dz9iEpTkQ== - dependencies: - "@noble/curves" "1.1.0" - "@noble/hashes" "1.3.1" - "@polkadot/networks" "12.3.2" - "@polkadot/util" "12.3.2" - "@polkadot/wasm-crypto" "^7.2.1" - "@polkadot/wasm-util" "^7.2.1" - "@polkadot/x-bigint" "12.3.2" - "@polkadot/x-randomvalues" "12.3.2" - "@scure/base" "1.1.1" - tslib "^2.5.3" - -"@polkadot/util@12.3.2", "@polkadot/util@^12.3.1", "@polkadot/util@^12.3.2": - version "12.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-12.3.2.tgz#f46e147b0e6a426da5ba59df4ce65de1a3effe4a" - integrity sha512-y/JShcGyOamCUiSIg++XZuLHt1ktSKBaSH2K5Nw5NXlgP0+7am+GZzqPB8fQ4qhYLruEOv+YRiz0GC1Zr9S+wg== - dependencies: - "@polkadot/x-bigint" "12.3.2" - "@polkadot/x-global" "12.3.2" - "@polkadot/x-textdecoder" "12.3.2" - "@polkadot/x-textencoder" "12.3.2" - "@types/bn.js" "^5.1.1" - bn.js "^5.2.1" - tslib "^2.5.3" - -"@polkadot/wasm-bridge@7.2.1": - version "7.2.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-7.2.1.tgz#8464a96552207d2b49c6f32137b24132534b91ee" - integrity sha512-uV/LHREDBGBbHrrv7HTki+Klw0PYZzFomagFWII4lp6Toj/VCvRh5WMzooVC+g/XsBGosAwrvBhoModabyHx+A== - dependencies: - "@polkadot/wasm-util" "7.2.1" - tslib "^2.5.0" - -"@polkadot/wasm-crypto-asmjs@7.2.1": - version "7.2.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-7.2.1.tgz#3e7a91e2905ab7354bc37b82f3e151a62bb024db" - integrity sha512-z/d21bmxyVfkzGsKef/FWswKX02x5lK97f4NPBZ9XBeiFkmzlXhdSnu58/+b1sKsRAGdW/Rn/rTNRDhW0GqCAg== - dependencies: - tslib "^2.5.0" - -"@polkadot/wasm-crypto-init@7.2.1": - version "7.2.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-7.2.1.tgz#9dbba41ed7d382575240f1483cf5a139ff2787bd" - integrity sha512-GcEXtwN9LcSf32V9zSaYjHImFw16hCyo2Xzg4GLLDPPeaAAfbFr2oQMgwyDbvBrBjLKHVHjsPZyGhXae831amw== - dependencies: - "@polkadot/wasm-bridge" "7.2.1" - "@polkadot/wasm-crypto-asmjs" "7.2.1" - "@polkadot/wasm-crypto-wasm" "7.2.1" - "@polkadot/wasm-util" "7.2.1" - tslib "^2.5.0" - -"@polkadot/wasm-crypto-wasm@7.2.1": - version "7.2.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-7.2.1.tgz#d2486322c725f6e5d2cc2d6abcb77ecbbaedc738" - integrity sha512-DqyXE4rSD0CVlLIw88B58+HHNyrvm+JAnYyuEDYZwCvzUWOCNos/DDg9wi/K39VAIsCCKDmwKqkkfIofuOj/lA== - dependencies: - "@polkadot/wasm-util" "7.2.1" - tslib "^2.5.0" - -"@polkadot/wasm-crypto@^7.2.1": - version "7.2.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-7.2.1.tgz#db671dcb73f1646dc13478b5ffc3be18c64babe1" - integrity sha512-SA2+33S9TAwGhniKgztVN6pxUKpGfN4Tre/eUZGUfpgRkT92wIUT2GpGWQE+fCCqGQgADrNiBcwt6XwdPqMQ4Q== - dependencies: - "@polkadot/wasm-bridge" "7.2.1" - "@polkadot/wasm-crypto-asmjs" "7.2.1" - "@polkadot/wasm-crypto-init" "7.2.1" - "@polkadot/wasm-crypto-wasm" "7.2.1" - "@polkadot/wasm-util" "7.2.1" - tslib "^2.5.0" - -"@polkadot/wasm-util@7.2.1", "@polkadot/wasm-util@^7.2.1": - version "7.2.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-7.2.1.tgz#fda233120ec02f77f0d14e4d3c7ad9ce06535fb8" - integrity sha512-FBSn/3aYJzhN0sYAYhHB8y9JL8mVgxLy4M1kUXYbyo+8GLRQEN5rns8Vcb8TAlIzBWgVTOOptYBvxo0oj0h7Og== - dependencies: - tslib "^2.5.0" - -"@polkadot/x-bigint@12.3.2", "@polkadot/x-bigint@^12.3.1": - version "12.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-12.3.2.tgz#0e99489cc7938bed40762aaaed58ded6850ab54b" - integrity sha512-JLqLgfGXe/x+hZJETd5ZqfpVsbwyMsH5Nn1Q20ineMMjXN/ig+kVR8Mc15LXBMuw4g7LldFW6UUrotWnuMI8Yw== - dependencies: - "@polkadot/x-global" "12.3.2" - tslib "^2.5.3" - -"@polkadot/x-fetch@^12.3.1": - version "12.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-12.3.2.tgz#7e8d2113268e792dd5d1b259ef13839c6aa77996" - integrity sha512-3IEuZ5S+RI/t33NsdPLIIa5COfDCfpUW2sbaByEczn75aD1jLqJZSEDwiBniJ2osyNd4uUxBf6e5jw7LAZeZJg== - dependencies: - "@polkadot/x-global" "12.3.2" - node-fetch "^3.3.1" - tslib "^2.5.3" - -"@polkadot/x-global@12.3.2", "@polkadot/x-global@^12.3.1": - version "12.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-12.3.2.tgz#04ac0b0e559a35107f0b95ff7889fcade3796aa3" - integrity sha512-yVZq6oIegjlyh5rUZiTklgu+fL+W/DG1ypEa02683tUCB3avV5cA3PAHKptMSlb6FpweHu37lKKrqfAWrraDxg== - dependencies: - tslib "^2.5.3" - -"@polkadot/x-randomvalues@12.3.2": - version "12.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-12.3.2.tgz#43ac489a998098bdd40b3f82f28adb5b542db2a5" - integrity sha512-ywjIs8CWpvOGmq+3cGCNPOHxAjPHdBUiXyDccftx5BRVdmtbt36gK/V84bKr6Xs73FGu0jprUAOSRRsLZX/3dg== - dependencies: - "@polkadot/x-global" "12.3.2" - tslib "^2.5.3" - -"@polkadot/x-textdecoder@12.3.2": - version "12.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-12.3.2.tgz#bbd5682744f3552ce5d4d792ff48a3ca525eafcf" - integrity sha512-lY5bfA5xArJRWEJlYOlQQMJeTjWD8s0yMhchirVgf5xj8Id9vPGeUoneH+VFDEwgXxrqBvDFJ4smN4T/r6a/fg== - dependencies: - "@polkadot/x-global" "12.3.2" - tslib "^2.5.3" - -"@polkadot/x-textencoder@12.3.2": - version "12.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-12.3.2.tgz#223e6f6dd78e2d81c6dcc6f244c76ceae7b08e32" - integrity sha512-iP3qEBiHzBckQ9zeY7ZHRWuu7mCEg5SMpOugs6UODRk8sx6KHzGQYlghBbWLit0uppPDVE0ifEwZ2n73djJHWQ== - dependencies: - "@polkadot/x-global" "12.3.2" - tslib "^2.5.3" - -"@polkadot/x-ws@^12.3.1": - version "12.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-12.3.2.tgz#422559dfbdaac4c965d5e1b406b6cc4529214f94" - integrity sha512-yM9Z64pLNlHpJE43+Xtr+iUXmYpFFY5u5hrke2PJt13O48H8f9Vb9cRaIh94appLyICoS0aekGhDkGH+MCspBA== - dependencies: - "@polkadot/x-global" "12.3.2" - tslib "^2.5.3" - ws "^8.13.0" - -"@scure/base@1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" - integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== - -"@substrate/connect-extension-protocol@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-1.0.1.tgz#fa5738039586c648013caa6a0c95c43265dbe77d" - integrity sha512-161JhCC1csjH3GE5mPLEd7HbWtwNSPJBg3p1Ksz9SFlTzj/bgEwudiRN2y5i0MoLGCIJRYKyKGMxVnd29PzNjg== - -"@substrate/connect@0.7.26": - version "0.7.26" - resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.26.tgz#a0ee5180c9cb2f29250d1219a32f7b7e7dea1196" - integrity sha512-uuGSiroGuKWj1+38n1kY5HReer5iL9bRwPCzuoLtqAOmI1fGI0hsSI2LlNQMAbfRgr7VRHXOk5MTuQf5ulsFRw== - dependencies: - "@substrate/connect-extension-protocol" "^1.0.1" - eventemitter3 "^4.0.7" - smoldot "1.0.4" - -"@substrate/ss58-registry@^1.40.0": - version "1.41.0" - resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.41.0.tgz#dd18e132f44b73c3cd31cf0db489c10af70bef36" - integrity sha512-TLz5VkEaJRNFzf1Oiix9gqknKer3aKbLfjK9XHBFCIhdxlQpI+S6lZGu3wT4DHAGXPakYfXb8+9ZIOtWLcQ/2Q== - -"@types/bn.js@^5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" - integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== - dependencies: - "@types/node" "*" - -"@types/node@*": - version "20.4.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.9.tgz#c7164e0f8d3f12dfae336af0b1f7fdec8c6b204f" - integrity sha512-8e2HYcg7ohnTUbHk8focoklEQYvemQmu9M/f43DZVx43kHn0tE3BY/6gSDxS7k0SprtS0NHvj+L80cGLnoOUcQ== - -bn.js@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== - -data-uri-to-buffer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" - integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== - -debug@^4.1.0: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -eventemitter3@^4.0.7: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -eventemitter3@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" - integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== - -fetch-blob@^3.1.2, fetch-blob@^3.1.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" - integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== - dependencies: - node-domexception "^1.0.0" - web-streams-polyfill "^3.0.3" - -formdata-polyfill@^4.0.10: - version "4.0.10" - resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" - integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== - dependencies: - fetch-blob "^3.1.2" - -json-stringify-safe@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - -lodash@^4.17.21: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -mock-socket@^9.2.1: - version "9.2.1" - resolved "https://registry.yarnpkg.com/mock-socket/-/mock-socket-9.2.1.tgz#cc9c0810aa4d0afe02d721dcb2b7e657c00e2282" - integrity sha512-aw9F9T9G2zpGipLLhSNh6ZpgUyUl4frcVmRN08uE1NWPWg43Wx6+sGPDbQ7E5iFZZDJW5b5bypMeAEHqTbIFag== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -nock@^13.3.1: - version "13.3.2" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.3.2.tgz#bfa6be92d37f744b1b758ea89b1105cdaf5c8b3f" - integrity sha512-CwbljitiWJhF1gL83NbanhoKs1l23TDlRioNraPTZrzZIEooPemrHRj5m0FZCPkB1ecdYCSWWGcHysJgX/ngnQ== - dependencies: - debug "^4.1.0" - json-stringify-safe "^5.0.1" - lodash "^4.17.21" - propagate "^2.0.0" - -node-domexception@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" - integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== - -node-fetch@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" - integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== - dependencies: - data-uri-to-buffer "^4.0.0" - fetch-blob "^3.1.4" - formdata-polyfill "^4.0.10" - -pako@^2.0.4: - version "2.1.0" - resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" - integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== - -propagate@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" - integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== - -rxjs@^7.8.1: - version "7.8.1" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" - integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== - dependencies: - tslib "^2.1.0" - -smoldot@1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/smoldot/-/smoldot-1.0.4.tgz#e4c38cedad68d699a11b5b9ce72bb75c891bfd98" - integrity sha512-N3TazI1C4GGrseFH/piWyZCCCRJTRx2QhDfrUKRT4SzILlW5m8ayZ3QTKICcz1C/536T9cbHHJyP7afxI6Mi1A== - dependencies: - pako "^2.0.4" - ws "^8.8.1" - -tslib@^2.1.0, tslib@^2.5.0, tslib@^2.5.3: - version "2.6.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410" - integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig== - -web-streams-polyfill@^3.0.3: - version "3.2.1" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" - integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== - -ws@^8.13.0, ws@^8.8.1: - version "8.13.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" - integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== diff --git a/docker-compose.yml b/docker-compose.yml index 002bca45f..9488e523e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,9 +10,9 @@ services: - "--validator" - "--alice" - "--tmp" - - "--unsafe-ws-external" - "--unsafe-rpc-external" - "--rpc-cors=all" + - "--rpc-port=9944" - "--node-key=0000000000000000000000000000000000000000000000000000000000000001" deploy: resources: @@ -23,24 +23,16 @@ services: cpus: "1" memory: "2512M" labels: - # WS config - # - "traefik.http.routers.bootnode-ws.rule=(Host(`localhost`) || Host(`devnet.cicd.rootnet.app`)) && PathPrefix(`/`)" - - "traefik.http.routers.bootnode-ws.rule=Host(`devnet.cicd.rootnet.app`) && Path(`/`)" - - "traefik.http.routers.bootnode-ws.entrypoints=substrate-ws" - - "traefik.http.routers.bootnode-ws.service=node-ws-svc" - - "traefik.http.services.node-ws-svc.loadbalancer.server.port=9944" - - "traefik.http.middlewares.bootnode-ws.headers.customrequestheaders.Upgrade=websocket" - - "traefik.http.middlewares.bootnode-ws.headers.customrequestheaders.Connection=Upgrade" - - "traefik.http.routers.bootnode-ws.tls=true" - - "traefik.http.routers.bootnode-ws.tls.certresolver=myresolver" - # HTTP config - # - "traefik.http.routers.bootnode-http.rule=(Host(`localhost`) || Host(`devnet.cicd.rootnet.app`)) && Path(`/http`)" - - "traefik.http.routers.bootnode-http.rule=Host(`devnet.cicd.rootnet.app`) && Path(`/`)" - - "traefik.http.routers.bootnode-http.entrypoints=substrate-http" - - "traefik.http.routers.bootnode-http.service=bootnode-http-svc" - - "traefik.http.services.bootnode-http-svc.loadbalancer.server.port=9933" - - "traefik.http.routers.bootnode-http.tls=true" - - "traefik.http.routers.bootnode-http.tls.certresolver=myresolver" + # RPC config + # - "traefik.http.routers.bootnode-rpc.rule=(Host(`127.0.0.1`) || Host(`devnet.cicd.rootnet.app`)) && PathPrefix(`/`)" + - "traefik.http.routers.bootnode-rpc.rule=Host(`devnet.cicd.rootnet.app`) && Path(`/`)" + - "traefik.http.routers.bootnode-rpc.entrypoints=substrate-rpc" + - "traefik.http.routers.bootnode-rpc.service=node-rpc-svc" + - "traefik.http.services.node-rpc-svc.loadbalancer.server.port=9944" + - "traefik.http.middlewares.bootnode-rpc.headers.customrequestheaders.Upgrade=websocket" + - "traefik.http.middlewares.bootnode-rpc.headers.customrequestheaders.Connection=Upgrade" + - "traefik.http.routers.bootnode-rpc.tls=true" + - "traefik.http.routers.bootnode-rpc.tls.certresolver=myresolver" validator1: image: "ghcr.io/futureversecom/fork-release-state-${NETWORK:-root}" @@ -52,9 +44,9 @@ services: - "--validator" - "--bob" - "--tmp" - - "--unsafe-ws-external" - "--unsafe-rpc-external" - "--rpc-cors=all" + - "--rpc-port=9944" - "--bootnodes=/dns/bootnode/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp" deploy: resources: @@ -67,24 +59,16 @@ services: depends_on: - bootnode labels: - # WS config - # - "traefik.http.routers.validator-1-ws.rule=(Host(`localhost`) || Host(`devnet.cicd.rootnet.app`)) && PathPrefix(`/`)" - - "traefik.http.routers.validator-1-ws.rule=Host(`devnet.cicd.rootnet.app`) && Path(`/`)" - - "traefik.http.routers.validator-1-ws.entrypoints=substrate-ws" - - "traefik.http.routers.validator-1-ws.service=node-ws-svc" - - "traefik.http.services.node-ws-svc.loadbalancer.server.port=9944" - - "traefik.http.middlewares.validator-1-ws.headers.customrequestheaders.Upgrade=websocket" - - "traefik.http.middlewares.validator-1-ws.headers.customrequestheaders.Connection=Upgrade" - - "traefik.http.routers.validator-1-ws.tls=true" - - "traefik.http.routers.validator-1-ws.tls.certresolver=myresolver" - # HTTP config - # - "traefik.http.routers.validator-1-http.rule=(Host(`localhost`) || Host(`devnet.cicd.rootnet.app`)) && Path(`/http`)" - - "traefik.http.routers.validator-1-http.rule=Host(`devnet.cicd.rootnet.app`) && Path(`/`)" - - "traefik.http.routers.validator-1-http.entrypoints=substrate-http" - - "traefik.http.routers.validator-1-http.service=node-http-svc" - - "traefik.http.services.node-http-svc.loadbalancer.server.port=9933" - - "traefik.http.routers.validator-1-http.tls=true" - - "traefik.http.routers.validator-1-http.tls.certresolver=myresolver" + # RPC config + # - "traefik.http.routers.validator-1-rpc.rule=(Host(`127.0.0.1`) || Host(`devnet.cicd.rootnet.app`)) && PathPrefix(`/`)" + - "traefik.http.routers.validator-1-rpc.rule=Host(`devnet.cicd.rootnet.app`) && Path(`/`)" + - "traefik.http.routers.validator-1-rpc.entrypoints=substrate-rpc" + - "traefik.http.routers.validator-1-rpc.service=node-rpc-svc" + - "traefik.http.services.node-rpc-svc.loadbalancer.server.port=9944" + - "traefik.http.middlewares.validator-1-rpc.headers.customrequestheaders.Upgrade=websocket" + - "traefik.http.middlewares.validator-1-rpc.headers.customrequestheaders.Connection=Upgrade" + - "traefik.http.routers.validator-1-rpc.tls=true" + - "traefik.http.routers.validator-1-rpc.tls.certresolver=myresolver" validator2: image: "ghcr.io/futureversecom/fork-release-state-${NETWORK:-root}" @@ -96,9 +80,9 @@ services: - "--validator" - "--charlie" - "--tmp" - - "--unsafe-ws-external" - "--unsafe-rpc-external" - "--rpc-cors=all" + - "--rpc-port=9944" - "--bootnodes=/dns/bootnode/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp" deploy: resources: @@ -111,24 +95,16 @@ services: depends_on: - bootnode labels: - # WS config - # - "traefik.http.routers.validator-2-ws.rule=(Host(`localhost`) || Host(`devnet.cicd.rootnet.app`)) && PathPrefix(`/`)" - - "traefik.http.routers.validator-2-ws.rule=Host(`devnet.cicd.rootnet.app`) && Path(`/`)" - - "traefik.http.routers.validator-2-ws.entrypoints=substrate-ws" - - "traefik.http.routers.validator-2-ws.service=node-ws-svc" - - "traefik.http.services.node-ws-svc.loadbalancer.server.port=9944" - - "traefik.http.middlewares.validator-2-ws.headers.customrequestheaders.Upgrade=websocket" - - "traefik.http.middlewares.validator-2-ws.headers.customrequestheaders.Connection=Upgrade" - - "traefik.http.routers.validator-2-ws.tls=true" - - "traefik.http.routers.validator-2-ws.tls.certresolver=myresolver" - # HTTP config - # - "traefik.http.routers.validator-2-http.rule=(Host(`localhost`) || Host(`devnet.cicd.rootnet.app`)) && Path(`/http`)" - - "traefik.http.routers.validator-2-http.rule=Host(`devnet.cicd.rootnet.app`) && Path(`/`)" - - "traefik.http.routers.validator-2-http.entrypoints=substrate-http" - - "traefik.http.routers.validator-2-http.service=node-http-svc" - - "traefik.http.services.node-http-svc.loadbalancer.server.port=9933" - - "traefik.http.routers.validator-2-http.tls=true" - - "traefik.http.routers.validator-2-http.tls.certresolver=myresolver" + # RPC config + # - "traefik.http.routers.validator-2-rpc.rule=(Host(`127.0.0.1`) || Host(`devnet.cicd.rootnet.app`)) && PathPrefix(`/`)" + - "traefik.http.routers.validator-2-rpc.rule=Host(`devnet.cicd.rootnet.app`) && Path(`/`)" + - "traefik.http.routers.validator-2-rpc.entrypoints=substrate-rpc" + - "traefik.http.routers.validator-2-rpc.service=node-rpc-svc" + - "traefik.http.services.node-rpc-svc.loadbalancer.server.port=9944" + - "traefik.http.middlewares.validator-2-rpc.headers.customrequestheaders.Upgrade=websocket" + - "traefik.http.middlewares.validator-2-rpc.headers.customrequestheaders.Connection=Upgrade" + - "traefik.http.routers.validator-2-rpc.tls=true" + - "traefik.http.routers.validator-2-rpc.tls.certresolver=myresolver" # network already exists - attach to existing traefik network networks: diff --git a/dockerimages/fork-state.Dockerfile b/dockerimages/fork-state.Dockerfile index 4c7d2df1d..3b006cffe 100644 --- a/dockerimages/fork-state.Dockerfile +++ b/dockerimages/fork-state.Dockerfile @@ -44,6 +44,6 @@ RUN apt update -y && apt install curl -y COPY --from=0 /workdir/output /output WORKDIR /output -EXPOSE 30333 9933 9944 +EXPOSE 30333 9944 -CMD /output/binary --chain=/output/fork.json --alice --tmp --unsafe-ws-external --unsafe-rpc-external --rpc-cors=all +CMD /output/binary --chain=/output/fork.json --alice --tmp --unsafe-rpc-external --rpc-port=9944 --rpc-cors=all diff --git a/e2e/README.md b/e2e/README.md index 7ac51a3a8..d42811daa 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -28,7 +28,7 @@ cp .env.example .env - Run node locally ```sh -cargo run -- --dev --unsafe-ws-external --unsafe-rpc-external --rpc-cors=all +cargo run -- --dev --unsafe-rpc-external --rpc-port=9944 --rpc-cors=all ``` - Note: You need to run specific test files, since the suite will not handle startup and shutdown of local node (state diff --git a/e2e/common/index.ts b/e2e/common/index.ts index 0a0fae133..3d4ed98aa 100644 --- a/e2e/common/index.ts +++ b/e2e/common/index.ts @@ -482,6 +482,18 @@ export const futurepassAddress = (nextId: number | string): string => { return web3.utils.toChecksumAddress(`0xFFFFFFFF${fpIdHex}`); }; +// `0xdddddddd` + <4-byte-asset_a-padded> + <4-byte-asset_b-padded> + `0000000000000000` (8 bytes) +export const poolAddress = (assetA: number | string, assetB: number | string): string => { + const assetAHex = (+assetA).toString(16).padStart(8, "0"); + const assetBHex = (+assetB).toString(16).padStart(8, "0"); + + // lower asset id comes first + if (assetA < assetB) { + return web3.utils.toChecksumAddress(`0xDdDddDdD${assetAHex}${assetBHex}0000000000000000`); + } + return web3.utils.toChecksumAddress(`0xDdDddDdD${assetBHex}${assetAHex}0000000000000000`); +}; + /** * Fields of a Polkadotjs event to match on */ diff --git a/e2e/common/node.ts b/e2e/common/node.ts index a8b2ce526..b75763c20 100644 --- a/e2e/common/node.ts +++ b/e2e/common/node.ts @@ -8,8 +8,7 @@ dotenv.config(); export type ConnectionType = "local" | "binary" | "docker"; interface NodeOpts { - httpPort: number; - wsPort: number; + rpcPort: number; dockerOpts: { image: string; pull: boolean; @@ -20,8 +19,7 @@ interface NodeOpts { } const defaultOpts: NodeOpts = { - httpPort: 9933, - wsPort: 9944, + rpcPort: 9944, dockerOpts: { // image: "ghcr.io/futureversecom/seed:latest", image: "seed/pr", @@ -35,8 +33,7 @@ const defaultOpts: NodeOpts = { export interface NodeProcess { id: string; wait: () => Promise; - httpPort: string; - wsPort: string; + rpcPort: string; stop: () => Promise; } @@ -57,13 +54,12 @@ export function startNode( if (type === "local") { // connect to an already running node - const wsPortStr = nodeOptions.wsPort.toString() ?? "9944"; + const rpcPort = nodeOptions.rpcPort.toString() ?? "9944"; return Promise.resolve({ id: "connect", - httpPort: nodeOptions.httpPort.toString() ?? "9933", - wsPort: wsPortStr, + rpcPort: rpcPort, wait: async () => { - await ApiPromise.create({ provider: new WsProvider(`ws://127.0.0.1:${wsPortStr}`) }); + await ApiPromise.create({ provider: new WsProvider(`ws://127.0.0.1:${rpcPort}`) }); }, stop: () => Promise.resolve(), }); @@ -75,7 +71,7 @@ export function startNode( } if (type === "binary") { // TODO integrate startStandaloneNode; path param may be required - // return startBinaryNode(httpPort, wsPort); + // return startBinaryNode(rpcPort); throw new Error(`Unsupported connection type: ${type}`); } @@ -86,7 +82,6 @@ interface DockerInspect { NetworkSettings: { Ports: { "9944/tcp": { HostPort: string }[]; - "9933/tcp": { HostPort: string }[]; }; }; } @@ -97,15 +92,13 @@ async function startStandaloneDockerNode(nodeOpts: NodeOpts): Promise((resolve, reject) => { + const { rpcPort } = await new Promise<{ rpcPort: string }>((resolve, reject) => { // let pollCount = 0; const interval = setInterval(async () => { // console.info(`getting ports for ${id} (${++pollCount})...`); @@ -152,13 +145,13 @@ async function startStandaloneDockerNode(nodeOpts: NodeOpts): Promise 0 && ports["9944/tcp"].length > 0) { - return resolve({ httpPort: ports["9933/tcp"][0].HostPort, wsPort: ports["9944/tcp"][0].HostPort }); + if (ports["9944/tcp"].length > 0) { + return resolve({ rpcPort: ports["9944/tcp"][0].HostPort }); } }); }, 100); }); - // console.info(`Docker node started: ${id} - http: ${httpPort} - ws: ${wsPort}`); + // console.info(`Docker node started: ${id} - rpc: ${rpcPort}`); const stop = () => new Promise((resolve, reject) => { @@ -175,10 +168,9 @@ async function startStandaloneDockerNode(nodeOpts: NodeOpts): Promise { - await ApiPromise.create({ provider: new WsProvider(`ws://127.0.0.1:${wsPort}`) }); + await ApiPromise.create({ provider: new WsProvider(`ws://127.0.0.1:${rpcPort}`) }); }, stop, }; diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index d3952be53..a627cf807 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -1,4 +1,3 @@ -# two node local network (alice + bob validators) version: "3" services: @@ -10,10 +9,8 @@ services: - --validator - --base-path=/mnt/data - --name=validator-0 - - --unsafe-ws-external - --unsafe-rpc-external + - --rpc-port=9944 - --rpc-cors=all ports: - - "9933:9933" - "9944:9944" - - "30333:30333" diff --git a/e2e/hardhat.config.ts b/e2e/hardhat.config.ts index 14dd4f55f..41769cec9 100644 --- a/e2e/hardhat.config.ts +++ b/e2e/hardhat.config.ts @@ -1,22 +1,12 @@ import "@nomicfoundation/hardhat-toolbox"; import * as dotenv from "dotenv"; import { utils } from "ethers"; -import { HardhatUserConfig, task } from "hardhat/config"; +import { HardhatUserConfig } from "hardhat/config"; import { ALITH_PRIVATE_KEY, BOB_PRIVATE_KEY } from "./common"; dotenv.config(); -// This is a sample Hardhat task. To learn how to create your own go to -// https://hardhat.org/guides/create-task.html -task("accounts", "Prints the list of accounts", async (taskArgs, hre) => { - const accounts = await hre.ethers.getSigners(); - - for (const account of accounts) { - console.log(account.address); - } -}); - // You need to export an object to set up your config // Go to https://hardhat.org/config/ to learn more @@ -36,14 +26,11 @@ const config: HardhatUserConfig = { gasPrice: utils.parseUnits("100", "gwei").toNumber(), }, seed: { - url: "http://localhost:9933", + url: "http://127.0.0.1:9944", accounts: [ALITH_PRIVATE_KEY, BOB_PRIVATE_KEY], chainId: 7672, }, }, - etherscan: { - apiKey: process.env.ETHERSCAN_API_KEY, - }, mocha: { timeout: 120_000, // global tests timeout }, diff --git a/e2e/package.json b/e2e/package.json index c616f23bf..02c53d2fb 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -4,6 +4,9 @@ "description": "Integration tests for the Root network", "author": "Futureverse Devs", "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, "scripts": { "clean": "hardhat clean && rm -rf ./cache && hardhat typechain", "format": "prettier --check --config ./.prettierrc.yml \"**/*.{js,json,ts}\"", @@ -19,9 +22,9 @@ "@nomicfoundation/hardhat-toolbox": "^2.0.0", "@nomiclabs/hardhat-ethers": "^2.2.1", "@nomiclabs/hardhat-etherscan": "^3.1.2", - "@polkadot/api": "^9.6.1", - "@polkadot/types": "^9.6.1", - "@polkadot/util": "^10.1.11", + "@polkadot/api": "^11.0.3", + "@polkadot/types": "^11.0.3", + "@polkadot/util": "^12.6.2", "@therootnetwork/doughnut-nodejs": "^0.1.2", "@therootnetwork/pact-nodejs": "^0.0.3", "@trivago/prettier-plugin-sort-imports": "^4.0.0", diff --git a/e2e/test/AssetRPC.test.ts b/e2e/test/AssetRPC.test.ts index e2eba5155..854042f4d 100644 --- a/e2e/test/AssetRPC.test.ts +++ b/e2e/test/AssetRPC.test.ts @@ -16,7 +16,7 @@ describe("RPC", () => { node = await startNode(); await node.wait(); // wait for the node to be ready - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs, rpc: rpcs }); alith = new Keyring({ type: "ethereum" }).addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); const tx1 = api.tx.assets.mint(2, "0x6D1eFDE1BbF146EF88c360AF255D9d54A5D39408", mintAmount); diff --git a/e2e/test/Crowdsale.test.ts b/e2e/test/Crowdsale.test.ts index 851f78864..cd2107fd3 100644 --- a/e2e/test/Crowdsale.test.ts +++ b/e2e/test/Crowdsale.test.ts @@ -28,7 +28,7 @@ describe("Crowdsale pallet", () => { node = await startNode(); // substrate variables - const wsProvider = new WsProvider(`ws://127.0.0.1:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); alith = new Keyring({ type: "ethereum" }).addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); }); @@ -157,7 +157,9 @@ describe("Crowdsale pallet", () => { const txs = [ // fund participants - 50 ROOT per participant to participate - ...participants.map((user) => api.tx.sudo.sudo(api.tx.balances.setBalance(user.address, 50_000_000, 0))), + ...participants.map((user) => + api.tx.sudo.sudo(api.tx.balances.setBalanceDeprecated(user.address, 50_000_000, 0)), + ), // fund participants - 2 XRP (GAS) per participant ...participants.map((user) => api.tx.assets.mint(GAS_TOKEN_ID, user.address, 2_000_000)), @@ -389,9 +391,7 @@ describe("Crowdsale pallet", () => { }) .catch((err) => reject(err)); }); - const { section, name } = dispatchError.registry.findMetaError(dispatchError.asModule); - expect(section).to.equal("assets"); - expect(name).to.equal("BalanceLow"); + expect((dispatchError.toJSON() as any).token).to.equal("FundsUnavailable"); // transfer vouchers from one user to another (to make whole) await finalizeTx( diff --git a/e2e/test/Dex/Dex.TxCosts.test.ts b/e2e/test/Dex/Dex.TxCosts.test.ts index 3335a3132..7005b255f 100644 --- a/e2e/test/Dex/Dex.TxCosts.test.ts +++ b/e2e/test/Dex/Dex.TxCosts.test.ts @@ -53,12 +53,12 @@ describe("Dex Gas Estimation", function () { node = await startNode(); // prepare works for precompile and extrinsic calls - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); alith = new Keyring({ type: "ethereum" }).addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); // setup JSON RPC - jsonProvider = new JsonRpcProvider(`http://localhost:${node.httpPort}`); + jsonProvider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(jsonProvider); bobSigner = new Wallet(BOB_PRIVATE_KEY).connect(jsonProvider); owner = Wallet.createRandom().connect(jsonProvider); diff --git a/e2e/test/Dex/DexPrecompile.test.ts b/e2e/test/Dex/DexPrecompile.test.ts index af7fd07de..08e1acb46 100644 --- a/e2e/test/Dex/DexPrecompile.test.ts +++ b/e2e/test/Dex/DexPrecompile.test.ts @@ -50,8 +50,8 @@ describe("DEX Precompile", function () { /// substrate setup /// - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); - trnJsonProvider = new JsonRpcProvider(`http://localhost:${node.httpPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); + trnJsonProvider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); alith = new Keyring({ type: "ethereum" }).addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(trnJsonProvider); diff --git a/e2e/test/Dex/DexRPC.test.ts b/e2e/test/Dex/DexRPC.test.ts index 2eb1a569c..a2939edc9 100644 --- a/e2e/test/Dex/DexRPC.test.ts +++ b/e2e/test/Dex/DexRPC.test.ts @@ -4,126 +4,38 @@ import axios from "axios"; import { expect } from "chai"; import { utils } from "ethers"; -import { ALITH_PRIVATE_KEY, GAS_TOKEN_ID, NodeProcess, startNode, typedefs } from "../../common"; - -const TOKEN_ID = 1124; - -export const rpc = { - dex: { - quote: { - description: "Returns the amount of output token that can be obtained by swapping an amount of input token", - params: [ - { - name: "amountIn", - type: "u128", - }, - { - name: "reserveIn", - type: "u128", - }, - { - name: "reserveOut", - type: "u128", - }, - ], - type: "Json", - }, - getAmountsOut: { - description: "Returns the amount of output tokens that can be obtained by swapping an amount of inputs token", - params: [ - { - name: "amountIn", - type: "Balance", - }, - { - name: "path", - type: "Vec", - }, - ], - type: "Json", - }, - getAmountsIn: { - description: "Returns the amount of input tokens that can be obtained by swapping an amount of output token", - params: [ - { - name: "amountOut", - type: "Balance", - }, - { - name: "path", - type: "Vec", - }, - ], - type: "Json", - }, - getLPTokenID: { - description: "Returns the LP token ID from the given trading pair", - params: [ - { - name: "assetIdA", - type: "AssetId", - }, - { - name: "assetIdB", - type: "AssetId", - }, - ], - type: "Json", - }, - getLiquidity: { - description: "Returns the liquidity balances of the given trading pair", - params: [ - { - name: "assetIdA", - type: "AssetId", - }, - { - name: "assetIdB", - type: "AssetId", - }, - ], - type: "Json", - }, - getTradingPairStatus: { - description: "Returns the status of the given trading pair", - params: [ - { - name: "assetIdA", - type: "AssetId", - }, - { - name: "assetIdB", - type: "AssetId", - }, - ], - type: "Json", - }, - }, -}; +import { + ALITH_PRIVATE_KEY, + GAS_TOKEN_ID, + NodeProcess, + finalizeTx, + getNextAssetId, + rpcs, + startNode, + typedefs, +} from "../../common"; describe("DexRPC", () => { let node: NodeProcess; let api: ApiPromise; + let tokenId: number; before(async () => { node = await startNode(); - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); - api = await ApiPromise.create({ - provider: wsProvider, - types: typedefs, - rpc, - }); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); + api = await ApiPromise.create({ provider: wsProvider, types: typedefs, rpc: rpcs }); const keyring = new Keyring({ type: "ethereum" }); const alith = keyring.addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); + tokenId = await getNextAssetId(api); const txs = [ api.tx.assetsExt.createAsset("test", "TEST", 18, 1, alith.address), // create asset - api.tx.assets.mint(TOKEN_ID, alith.address, utils.parseEther("1000000").toString()), + api.tx.assets.mint(tokenId, alith.address, utils.parseEther("1000000").toString()), api.tx.dex.addLiquidity( // provide liquidity - TOKEN_ID, + tokenId, GAS_TOKEN_ID, utils.parseEther("1000").toString(), 250_000_000, @@ -134,25 +46,13 @@ describe("DexRPC", () => { ), ]; - await new Promise((resolve, reject) => { - api.tx.utility - .batch(txs) - .signAndSend(alith, ({ status }) => { - if (status.isInBlock) { - console.log(`setup block hash: ${status.asInBlock}`); - resolve(); - } - }) - .catch((err) => reject(err)); - }); - - console.log("done setting up dex liquidity."); + await finalizeTx(alith, api.tx.utility.batch(txs)); }); after(async () => node.stop()); it("quote rpc works [http - axios]", async () => { - const httpResult = await axios.post(`http://localhost:${node.httpPort}`, { + const httpResult = await axios.post(`http://127.0.0.1:${node.rpcPort}`, { id: 1, jsonrpc: "2.0", method: "dex_quote", @@ -171,11 +71,11 @@ describe("DexRPC", () => { }); it("getAmountsOut rpc works [http - axios]", async () => { - const httpResult = await axios.post(`http://localhost:${node.httpPort}`, { + const httpResult = await axios.post(`http://127.0.0.1:${node.rpcPort}`, { id: 1, jsonrpc: "2.0", method: "dex_getAmountsOut", - params: [100, [GAS_TOKEN_ID, TOKEN_ID]], + params: [100, [GAS_TOKEN_ID, tokenId]], }); expect(httpResult.status).to.eql(200); expect(httpResult.data).to.haveOwnProperty("result"); @@ -184,17 +84,17 @@ describe("DexRPC", () => { }); it("getAmountsOut rpc works [library]", async () => { - const result = await (api.rpc as any).dex.getAmountsOut(100, [GAS_TOKEN_ID, TOKEN_ID]); + const result = await (api.rpc as any).dex.getAmountsOut(100, [GAS_TOKEN_ID, tokenId]); expect(result).to.haveOwnProperty("Ok"); expect(result.Ok).to.eqls([100, 398799840958623]); }); it("getAmountsIn rpc works [http - axios]", async () => { - const httpResult = await axios.post(`http://localhost:${node.httpPort}`, { + const httpResult = await axios.post(`http://127.0.0.1:${node.rpcPort}`, { id: 1, jsonrpc: "2.0", method: "dex_getAmountsIn", - params: [100, [TOKEN_ID, GAS_TOKEN_ID]], + params: [100, [tokenId, GAS_TOKEN_ID]], }); expect(httpResult.status).to.eql(200); expect(httpResult.data).to.haveOwnProperty("result"); @@ -203,55 +103,51 @@ describe("DexRPC", () => { }); it("getAmountsIn rpc works [library]", async () => { - const result = await (api.rpc as any).dex.getAmountsIn(100, [TOKEN_ID, GAS_TOKEN_ID]); + const result = await (api.rpc as any).dex.getAmountsIn(100, [tokenId, GAS_TOKEN_ID]); expect(result).to.haveOwnProperty("Ok"); expect(result.Ok).to.eqls([401203771314007, 100]); }); it("getLPTokenID rpc works [http - axios]", async () => { - const httpResult = await axios.post(`http://localhost:${node.httpPort}`, { + const httpResult = await axios.post(`http://127.0.0.1:${node.rpcPort}`, { id: 1, jsonrpc: "2.0", method: "dex_getLPTokenID", - params: [TOKEN_ID, GAS_TOKEN_ID], + params: [tokenId, GAS_TOKEN_ID], }); expect(httpResult.status).to.eql(200); expect(httpResult.data).to.haveOwnProperty("result"); expect(httpResult.data.result).to.haveOwnProperty("Ok"); - expect(httpResult.data.result.Ok).to.eqls(2148); }); it("getLPTokenID rpc works [library]", async () => { - const result = await (api.rpc as any).dex.getLPTokenID(TOKEN_ID, GAS_TOKEN_ID); + const result = await (api.rpc as any).dex.getLPTokenID(tokenId, GAS_TOKEN_ID); expect(result).to.haveOwnProperty("Ok"); - expect(result.Ok).to.eqls(2148); }); it("getLPTokenID with reversed trading pair rpc works [http - axios]", async () => { - const httpResult = await axios.post(`http://localhost:${node.httpPort}`, { + const httpResult = await axios.post(`http://127.0.0.1:${node.rpcPort}`, { id: 1, jsonrpc: "2.0", method: "dex_getLPTokenID", - params: [GAS_TOKEN_ID, TOKEN_ID], + params: [GAS_TOKEN_ID, tokenId], }); expect(httpResult.status).to.eql(200); expect(httpResult.data).to.haveOwnProperty("result"); expect(httpResult.data.result).to.haveOwnProperty("Ok"); - expect(httpResult.data.result.Ok).to.eqls(2148); }); it("getLPTokenID with reversed trading pair rpc works [library]", async () => { - const result = await (api.rpc as any).dex.getLPTokenID(GAS_TOKEN_ID, TOKEN_ID); + const result = await (api.rpc as any).dex.getLPTokenID(GAS_TOKEN_ID, tokenId); expect(result).to.haveOwnProperty("Ok"); - expect(result.Ok).to.eqls(2148); }); it("getLiquidity rpc works [http - axios]", async () => { - const httpResult = await axios.post(`http://localhost:${node.httpPort}`, { + const httpResult = await axios.post(`http://127.0.0.1:${node.rpcPort}`, { id: 1, jsonrpc: "2.0", method: "dex_getLiquidity", - params: [TOKEN_ID, GAS_TOKEN_ID], + params: [tokenId, GAS_TOKEN_ID], }); expect(httpResult.status).to.eql(200); expect(httpResult.data).to.haveOwnProperty("result"); @@ -259,7 +155,7 @@ describe("DexRPC", () => { }); it("getLiquidity rpc works [library]", async () => { - const result = await (api.rpc as any).dex.getLiquidity(TOKEN_ID, GAS_TOKEN_ID); + const result = await (api.rpc as any).dex.getLiquidity(tokenId, GAS_TOKEN_ID); expect(result).to.eqls( new Map([ ["0", 1000000000000000000000], @@ -269,11 +165,11 @@ describe("DexRPC", () => { }); it("getLiquidity with reversed trading pair rpc works [http - axios]", async () => { - const httpResult = await axios.post(`http://localhost:${node.httpPort}`, { + const httpResult = await axios.post(`http://127.0.0.1:${node.rpcPort}`, { id: 1, jsonrpc: "2.0", method: "dex_getLiquidity", - params: [GAS_TOKEN_ID, TOKEN_ID], + params: [GAS_TOKEN_ID, tokenId], }); expect(httpResult.status).to.eql(200); expect(httpResult.data).to.haveOwnProperty("result"); @@ -281,7 +177,7 @@ describe("DexRPC", () => { }); it("getLiquidity with reversed trading pair rpc works [library]", async () => { - const result = await (api.rpc as any).dex.getLiquidity(GAS_TOKEN_ID, TOKEN_ID); + const result = await (api.rpc as any).dex.getLiquidity(GAS_TOKEN_ID, tokenId); expect(result).to.eqls( new Map([ ["0", 250000000], @@ -291,11 +187,11 @@ describe("DexRPC", () => { }); it("getTradingPairStatus rpc works [http - axios]", async () => { - const httpResult = await axios.post(`http://localhost:${node.httpPort}`, { + const httpResult = await axios.post(`http://127.0.0.1:${node.rpcPort}`, { id: 1, jsonrpc: "2.0", method: "dex_getTradingPairStatus", - params: [TOKEN_ID, GAS_TOKEN_ID], + params: [tokenId, GAS_TOKEN_ID], }); expect(httpResult.status).to.eql(200); expect(httpResult.data).to.haveOwnProperty("result"); @@ -303,26 +199,16 @@ describe("DexRPC", () => { }); it("getTradingPairStatus rpc works [library]", async () => { - const result = await (api.rpc as any).dex.getTradingPairStatus(TOKEN_ID, GAS_TOKEN_ID); - expect(result).to.eqls( - new Map([ - ["0", "E"], - ["1", "n"], - ["2", "a"], - ["3", "b"], - ["4", "l"], - ["5", "e"], - ["6", "d"], - ]), - ); + const result = await (api.rpc as any).dex.getTradingPairStatus(tokenId, GAS_TOKEN_ID); + expect(result.toString()).to.eql("Enabled"); }); it("getTradingPairStatus with reversed trading pair rpc works [http - axios]", async () => { - const httpResult = await axios.post(`http://localhost:${node.httpPort}`, { + const httpResult = await axios.post(`http://127.0.0.1:${node.rpcPort}`, { id: 1, jsonrpc: "2.0", method: "dex_getTradingPairStatus", - params: [GAS_TOKEN_ID, TOKEN_ID], + params: [GAS_TOKEN_ID, tokenId], }); expect(httpResult.status).to.eql(200); expect(httpResult.data).to.haveOwnProperty("result"); @@ -330,17 +216,7 @@ describe("DexRPC", () => { }); it("getTradingPairStatus with reversed trading pair rpc works [library]", async () => { - const result = await (api.rpc as any).dex.getTradingPairStatus(GAS_TOKEN_ID, TOKEN_ID); - expect(result).to.eqls( - new Map([ - ["0", "E"], - ["1", "n"], - ["2", "a"], - ["3", "b"], - ["4", "l"], - ["5", "e"], - ["6", "d"], - ]), - ); + const result = await (api.rpc as any).dex.getTradingPairStatus(GAS_TOKEN_ID, tokenId); + expect(result.toString()).to.eql("Enabled"); }); }); diff --git a/e2e/test/Dex/NetworkFee.test.ts b/e2e/test/Dex/NetworkFee.test.ts index 4bcc15f5d..dca67cd74 100644 --- a/e2e/test/Dex/NetworkFee.test.ts +++ b/e2e/test/Dex/NetworkFee.test.ts @@ -27,7 +27,7 @@ describe("NetworkFee", () => { before(async () => { node = await startNode(); - const wsProvider = new WsProvider(`ws://127.0.0.1:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs, diff --git a/e2e/test/Dex/TxCosts.md b/e2e/test/Dex/TxCosts.md index 369082e54..f1fc1db14 100644 --- a/e2e/test/Dex/TxCosts.md +++ b/e2e/test/Dex/TxCosts.md @@ -1,21 +1,22 @@ ## Generated tx costs(Gas) for Dex Precompiles | Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) | -| :----------------------- | :----------: | :------------: | :-----------------------: | -| addLiquidity | 176010 | 102577 | 28021 | -| removeLiquidity | 152430 | 73769 | 23346 | -| swapExactTokensForTokens | 120570 | 53790 | 23342 | -| swapTokensForExactTokens | 120737 | 53838 | 25008 | +|:-------------------------|:------------:|:--------------:|:-------------------------:| +| addLiquidity | 218051 | 113629 | 28025 | +| removeLiquidity | 185060 | 79676 | 23515 | +| swapExactTokensForTokens | 151389 | 60462 | 23510 | +| swapTokensForExactTokens | 151534 | 61539 | 25177 | | quote | 23716 | 22377 | 0 | | getAmountOut | 26047 | 22447 | 0 | | getAmountsOut | 43843 | 42619 | 0 | | getAmountsIn | 44058 | 42611 | 0 | + ## Generated tx costs(fees) for ERC20 Precompiles | Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) | -| :----------------------- | :-------------------: | :---------------------: | :--------------------: | -| addLiquidity | 2261896 | 1479087 | 420318 | -| removeLiquidity | 1722772 | 1043234 | 350197 | -| swapExactTokensForTokens | 1490489 | 804635 | 350130 | -| swapTokensForExactTokens | 1492814 | 805655 | 375130 | +|:-------------------------|:---------------------:|:-----------------------:|:----------------------:| +| addLiquidity | 2971497 | 1665256 | 420375 | +| removeLiquidity | 2387833 | 1148259 | 352731 | +| swapExactTokensForTokens | 2198004 | 906885 | 352664 | +| swapTokensForExactTokens | 2200330 | 922277 | 377668 | diff --git a/e2e/test/Doughnuts.test.ts b/e2e/test/Doughnuts.test.ts index f0113e717..fe8a9001d 100644 --- a/e2e/test/Doughnuts.test.ts +++ b/e2e/test/Doughnuts.test.ts @@ -34,7 +34,7 @@ describe("Doughnuts", () => { before(async () => { node = await startNode(); - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); keyring = new Keyring({ type: "ethereum" }); @@ -800,11 +800,11 @@ describe("Doughnuts", () => { expect(eventData[index].event.data[1].toString()).to.equal("0xDDDDDDdD00000002000004640000000000000000"); expect(eventData[index].event.data[2].toString()).to.equal(futurepassAddress); - // assets Issued [2148,"0x6D6F646c7478666565706F740000000000000000",226] + // assets Issued [7268,"0x6D6F646c7478666565706F740000000000000000",226] index += 1; expect(eventData[index].event.section).to.equal("assets"); expect(eventData[index].event.method).to.equal("Issued"); - expect(eventData[index].event.data[0]).to.equal(2148); + expect(eventData[index].event.data[0]).to.equal(7268); // dex Swap ["0xFfFFFFff00000000000000000000000000000001",[1124,2],907864,905132,"0xFfFFFFff00000000000000000000000000000001"] index += 1; @@ -881,7 +881,7 @@ describe("Doughnuts", () => { expect(userAAssetBalanceAfter).to.be.eq(userAAssetBalanceBefore); // futurepass xrp balance should not be changed since gas was paid using another asset - expect(futurepassXRPBalanceAfter).to.be.eq(futurepassXRPBalanceBefore); + expect(futurepassXRPBalanceAfter).to.be.eq(futurepassXRPBalanceBefore + 1); // 1 existential deposit // futurepass asset balance should be lesser since gas is paid expect(futurepassAssetBalanceAfter).to.be.lessThan(futurepassAssetBalanceBefore); @@ -1021,11 +1021,11 @@ describe("Doughnuts", () => { expect(eventData[index].event.data[1].toString()).to.equal("0xDDDDDDdD00000002000004640000000000000000"); expect(eventData[index].event.data[2].toString()).to.equal(userA.address); - // assets Issued [2148,"0x6D6F646c7478666565706F740000000000000000",213] + // assets Issued [7268,"0x6D6F646c7478666565706F740000000000000000",213] index += 1; expect(eventData[index].event.section).to.equal("assets"); expect(eventData[index].event.method).to.equal("Issued"); - expect(eventData[index].event.data[0]).to.equal(2148); + expect(eventData[index].event.data[0]).to.equal(7268); // dex Swap ["0x3fAc4E88185Add21c375653b3204c1EF7fff9dE9",[1124,2],852669,850089,"0x3fAc4E88185Add21c375653b3204c1EF7fff9dE9"] index += 1; @@ -1082,7 +1082,7 @@ describe("Doughnuts", () => { ((await api.query.assets.account(GAS_TOKEN_ID, holder.address)).toJSON() as any)?.balance ?? 0; // userA xrp balance should be unchanged since the gas was paid using a different asset - expect(userAXRPBalanceAfter).to.be.eq(userAXRPBalanceBefore); + expect(userAXRPBalanceAfter).to.be.eq(userAXRPBalanceBefore + 1); // 1 existential deposit // userA asset balance should be lesser since gas is paid expect(userAAssetBalanceAfter).to.be.lessThan(userAAssetBalanceBefore); diff --git a/e2e/test/ERC1155/ERC1155.TxCosts.test.ts b/e2e/test/ERC1155/ERC1155.TxCosts.test.ts index bf2c80618..c3a540d8b 100644 --- a/e2e/test/ERC1155/ERC1155.TxCosts.test.ts +++ b/e2e/test/ERC1155/ERC1155.TxCosts.test.ts @@ -43,14 +43,14 @@ describe("ERC1155 Gas Estimates", function () { before(async () => { node = await startNode(); - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); // Setup Root api instance and keyring api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); const keyring = new Keyring({ type: "ethereum" }); alith = keyring.addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); - provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); // 'development' seed bobSigner = new Wallet(BOB_PRIVATE_KEY).connect(provider); diff --git a/e2e/test/ERC1155/ERC1155Precompile.test.ts b/e2e/test/ERC1155/ERC1155Precompile.test.ts index b32a2d4bf..7044618be 100644 --- a/e2e/test/ERC1155/ERC1155Precompile.test.ts +++ b/e2e/test/ERC1155/ERC1155Precompile.test.ts @@ -37,14 +37,14 @@ describe("ERC1155 Precompile", function () { before(async () => { node = await startNode(); - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); // Setup Root api instance and keyring api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); const keyring = new Keyring({ type: "ethereum" }); const bob = keyring.addFromSeed(hexToU8a(BOB_PRIVATE_KEY)); - const provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + const provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); // 'development' seed bobSigner = new Wallet(BOB_PRIVATE_KEY).connect(provider); diff --git a/e2e/test/ERC1155/TxCosts.md b/e2e/test/ERC1155/TxCosts.md index 74c8af59c..143016d1a 100644 --- a/e2e/test/ERC1155/TxCosts.md +++ b/e2e/test/ERC1155/TxCosts.md @@ -1,26 +1,27 @@ ## Generated tx costs(Gas) for ERC1155 Precompiles | Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) | -| :-------------------- | :----------: | :------------: | :-----------------------: | +|:----------------------|:------------:|:--------------:|:-------------------------:| | uri | 27560 | 22400 | 0 | | balanceOf | 25957 | 22433 | 0 | | balanceOfBatch | 32585 | 24106 | 0 | -| setApprovalForAll | 47025 | 26460 | 0 | +| setApprovalForAll | 47025 | 26466 | 0 | | isApprovedForAll | 26076 | 23184 | 0 | -| safeTransferFrom | 56523 | 31766 | 23335 | -| safeBatchTransferFrom | 44583 | 32160 | 26668 | -| mint | 31840 | 29278 | 23502 | -| mintBatch | 36913 | 31817 | 26835 | -| burn | 28958 | 26435 | 20001 | -| burnBatch | 35511 | 29291 | 23335 | +| safeTransferFrom | 59163 | 31608 | 23335 | +| safeBatchTransferFrom | 50205 | 35107 | 26669 | +| mint | 33152 | 31645 | 23502 | +| mintBatch | 42210 | 32033 | 26835 | +| burn | 32581 | 26332 | 20002 | +| burnBatch | 38043 | 28962 | 23335 | + ## Generated tx costs(fees) for ERC1155 Precompiles | Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) | -| :-------------------- | :-------------------: | :---------------------: | :--------------------: | -| safeTransferFrom | 838463 | 449594 | 350029 | -| safeBatchTransferFrom | 644104 | 462196 | 400029 | -| mint | 451950 | 438808 | 352533 | -| mintBatch | 547854 | 451230 | 402533 | -| burn | 433648 | 394944 | 300029 | -| burnBatch | 527227 | 439333 | 350029 | +|:----------------------|:---------------------:|:-----------------------:|:----------------------:| +| safeTransferFrom | 880468 | 444524 | 350033 | +| safeBatchTransferFrom | 728112 | 515451 | 400049 | +| mint | 493954 | 445709 | 352539 | +| mintBatch | 589858 | 458130 | 402539 | +| burn | 475652 | 389438 | 300033 | +| burnBatch | 569231 | 433828 | 350033 | diff --git a/e2e/test/ERC20/Erc20.TxCosts.test.ts b/e2e/test/ERC20/Erc20.TxCosts.test.ts index eff012bbf..30b67bd95 100644 --- a/e2e/test/ERC20/Erc20.TxCosts.test.ts +++ b/e2e/test/ERC20/Erc20.TxCosts.test.ts @@ -43,11 +43,11 @@ describe("ERC20 Gas Estimates", function () { node = await startNode(); await node.wait(); // wait for the node to be ready - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); // Setup Root api instance and keyring api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); - provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); // 'development' seed bobSigner = new Wallet(BOB_PRIVATE_KEY).connect(provider); const keyring = new Keyring({ type: "ethereum" }); diff --git a/e2e/test/ERC20/Erc20Precompile.test.ts b/e2e/test/ERC20/Erc20Precompile.test.ts index 6c855c1ef..ea6b913ee 100644 --- a/e2e/test/ERC20/Erc20Precompile.test.ts +++ b/e2e/test/ERC20/Erc20Precompile.test.ts @@ -23,7 +23,7 @@ describe("ERC20 Precompile", function () { await node.wait(); // wait for the node to be ready // Setup JSON RPC - jsonProvider = new JsonRpcProvider(`http://localhost:${node.httpPort}`); + jsonProvider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); seedSigner = new Wallet(BOB_PRIVATE_KEY).connect(jsonProvider); // 'development' seed xrpToken = new Contract(xrpTokenAddress, ERC20_ABI, seedSigner); @@ -52,7 +52,7 @@ describe("ERC20 Precompile", function () { expect(await xrpToken.balanceOf(receiverAddress)).to.be.equal(transferAmount); // Account should be decremented by the sent amount + fees - expect(await xrpToken.balanceOf(seedSigner.address)).to.be.lessThan(startingAmount - transferAmount); + expect(await xrpToken.balanceOf(seedSigner.address)).to.be.lessThan(startingAmount.sub(transferAmount)); }); it("XRP transfer amounts via EVM", async () => { diff --git a/e2e/test/ERC20/TxCosts.md b/e2e/test/ERC20/TxCosts.md index c1ddf5270..607fcff50 100644 --- a/e2e/test/ERC20/TxCosts.md +++ b/e2e/test/ERC20/TxCosts.md @@ -1,21 +1,22 @@ ## Generated tx costs(Gas) for ERC20 Precompiles | Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) | -| :------------ | :----------: | :------------: | :-----------------------: | +|:--------------|:------------:|:--------------:|:-------------------------:| | totalSupply | 23717 | 22388 | 0 | | balanceOf | 25860 | 23974 | 0 | | allowance | 26064 | 23273 | 0 | -| approval | 47152 | 26359 | 19503 | -| transfer | 50730 | 23241 | 19505 | -| transferFrom | 35302 | 32411 | 22673 | +| approval | 47152 | 26364 | 20170 | +| transfer | 52698 | 44134 | 20173 | +| transferFrom | 44716 | 51794 | 23174 | | name | 25926 | 22388 | 0 | | decimals | 22354 | 22388 | 0 | | symbol | 25945 | 22388 | 0 | + ## Generated tx costs(fees) for ERC20 Precompiles | Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) | -| :------------ | :-------------------: | :---------------------: | :--------------------: | -| approval | 702835 | 390894 | 292552 | -| transfer | 739318 | 344249 | 292588 | -| transferFrom | 521152 | 470172 | 340107 | +|:--------------|:---------------------:|:-----------------------:|:----------------------:| +| approval | 702835 | 391134 | 302559 | +| transfer | 781323 | 633958 | 302595 | +| transferFrom | 647164 | 761966 | 347616 | diff --git a/e2e/test/ERC721/ERC721Precompile.test.ts b/e2e/test/ERC721/ERC721Precompile.test.ts index 81af85ca3..40aa78ebf 100644 --- a/e2e/test/ERC721/ERC721Precompile.test.ts +++ b/e2e/test/ERC721/ERC721Precompile.test.ts @@ -38,14 +38,14 @@ describe("ERC721 Precompile", function () { before(async () => { node = await startNode(); - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); // Setup Root api instance and keyring api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); const keyring = new Keyring({ type: "ethereum" }); const bob = keyring.addFromSeed(hexToU8a(BOB_PRIVATE_KEY)); - const provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + const provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); // 'development' seed bobSigner = new Wallet(BOB_PRIVATE_KEY).connect(provider); diff --git a/e2e/test/ERC721/Erc721.TxCosts.test.ts b/e2e/test/ERC721/Erc721.TxCosts.test.ts index 0f7ccf8b3..2ae6b3fef 100644 --- a/e2e/test/ERC721/Erc721.TxCosts.test.ts +++ b/e2e/test/ERC721/Erc721.TxCosts.test.ts @@ -50,10 +50,10 @@ describe("ERC721 Gas Estimates", function () { node = await startNode(); await node.wait(); // wait for the node to be ready - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); // Setup Root api instance and keyring api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); - provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); // 'development' seed bobSigner = new Wallet(BOB_PRIVATE_KEY).connect(provider); const keyring = new Keyring({ type: "ethereum" }); diff --git a/e2e/test/ERC721/TxCosts.md b/e2e/test/ERC721/TxCosts.md index 19e4ec5e5..0515906ca 100644 --- a/e2e/test/ERC721/TxCosts.md +++ b/e2e/test/ERC721/TxCosts.md @@ -1,32 +1,33 @@ ## Generated tx costs(Gas) for ERC721 Precompiles | Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) | -| :---------------- | :----------: | :------------: | :-----------------------: | +|:------------------|:------------:|:--------------:|:-------------------------:| | balanceOf | 25895 | 23274 | 0 | | ownerOf | 25847 | 23242 | 0 | | getApproved | 27395 | 23242 | 0 | | isApprovedForAll | 26082 | 23973 | 0 | -| mint | 53211 | 31937 | 17335 | -| burn | 37888 | 36617 | 17170 | -| approve | 50740 | 28914 | 23835 | -| setApprovalForAll | 47011 | 27438 | 23335 | -| safetransferFrom | 67203 | 36832 | 0 | -| transferFrom | 66861 | 35757 | 20670 | +| mint | 53193 | 28898 | 17335 | +| burn | 37870 | 35114 | 17169 | +| approve | 50740 | 27831 | 23835 | +| setApprovalForAll | 47011 | 26360 | 23335 | +| safetransferFrom | 67181 | 35303 | 0 | +| transferFrom | 66839 | 34917 | 20669 | | name | 25932 | 22388 | 0 | | symbol | 25938 | 22388 | 0 | | tokenURI | 25964 | 23242 | 0 | | owner | 23728 | 22388 | 0 | -| transferOwnership | 29147 | 28901 | 19835 | -| renounceOwnership | 30272 | 28520 | 19835 | +| transferOwnership | 29147 | 27675 | 19835 | +| renounceOwnership | 30272 | 27559 | 19668 | + ## Generated tx costs(fees) for ERC721 Precompiles | Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) | -| :---------------- | :-------------------: | :---------------------: | :--------------------: | -| mint | 792274 | 455055 | 260038 | -| burn | 491074 | 539618 | 257550 | -| approve | 739543 | 431848 | 357534 | -| setApprovalForAll | 699609 | 399384 | 350025 | -| transferFrom | 884878 | 534383 | 310050 | -| transferOwnership | 436153 | 431293 | 297533 | -| renounceOwnership | 352310 | 425952 | 297533 | +|:------------------|:---------------------:|:-----------------------:|:----------------------:| +| mint | 791884 | 431188 | 260036 | +| burn | 490684 | 515676 | 257548 | +| approve | 739543 | 417326 | 357535 | +| setApprovalForAll | 699609 | 390954 | 350028 | +| transferFrom | 884488 | 509930 | 310049 | +| transferOwnership | 436153 | 410231 | 297532 | +| renounceOwnership | 352310 | 404890 | 295032 | diff --git a/e2e/test/EVMGasCosts.test.ts b/e2e/test/EVMGasCosts.test.ts index 8e35ae663..d92a8f6ae 100644 --- a/e2e/test/EVMGasCosts.test.ts +++ b/e2e/test/EVMGasCosts.test.ts @@ -32,7 +32,7 @@ describe("EVM gas costs", () => { node = await startNode(); // Substrate variables - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs, @@ -53,7 +53,7 @@ describe("EVM gas costs", () => { console.log("Created and minted asset:", FIRST_ASSET_ID); // EVM variables - provider = new JsonRpcProvider(`http://localhost:${node.httpPort}`); + provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); bobSigner = new Wallet(BOB_PRIVATE_KEY).connect(provider); }); @@ -156,8 +156,8 @@ describe("EVM gas costs", () => { // assert XRP used const xrpCost6DP = actualCost.div(10 ** 12).toNumber(); const xrpCostScaled = +utils.formatEther(actualCost); - expect(xrpCost6DP).to.eql(21803760); - expect(+xrpCostScaled.toFixed(6)).to.eql(21.80376); + expect(xrpCost6DP).to.eql(21810720); + expect(+xrpCostScaled.toFixed(6)).to.eql(21.81072); }); it("gas cost for token mint", async () => { diff --git a/e2e/test/FeePreferences/FeePreferences.test.ts b/e2e/test/FeePreferences.test.ts similarity index 88% rename from e2e/test/FeePreferences/FeePreferences.test.ts rename to e2e/test/FeePreferences.test.ts index fbfbad962..7f80095f3 100644 --- a/e2e/test/FeePreferences/FeePreferences.test.ts +++ b/e2e/test/FeePreferences.test.ts @@ -22,19 +22,19 @@ import { XRP_PRECOMPILE_ADDRESS, assetIdToERC20ContractAddress, finalizeTx, + getNextAssetId, rpcs, startNode, typedefs, -} from "../../common"; -import { ERC20 } from "../../typechain-types"; - -const FEE_TOKEN_ASSET_ID = 1124; +} from "../common"; +import { ERC20 } from "../typechain-types"; // Call an EVM transaction with fee preferences for an account that has zero native token balance, // ensuring that the preferred asset with liquidity is spent instead describe("Fee Preferences", function () { let node: NodeProcess; + let feeTokenAssetId: number; let api: ApiPromise; let alith: KeyringPair; let bob: KeyringPair; @@ -47,25 +47,26 @@ describe("Fee Preferences", function () { node = await startNode(); // Setup PolkadotJS rpc provider - const wsProvider = new WsProvider(`ws://127.0.0.1:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs, rpc: rpcs }); const keyring = new Keyring({ type: "ethereum" }); alith = keyring.addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); bob = keyring.addFromSeed(hexToU8a(BOB_PRIVATE_KEY)); // Setup JSON RPC provider - provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + feeTokenAssetId = await getNextAssetId(api); + provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); emptyAccountSigner = Wallet.createRandom().connect(provider); xrpERC20Precompile = new Contract(XRP_PRECOMPILE_ADDRESS, ERC20_ABI, emptyAccountSigner); - feeToken = new Contract(assetIdToERC20ContractAddress(FEE_TOKEN_ASSET_ID), ERC20_ABI, emptyAccountSigner) as ERC20; + feeToken = new Contract(assetIdToERC20ContractAddress(feeTokenAssetId), ERC20_ABI, emptyAccountSigner) as ERC20; // add liquidity for XRP<->token - const txes = [ + const txs = [ api.tx.assetsExt.createAsset("test", "TEST", 18, 1, alith.address), - api.tx.assets.mint(FEE_TOKEN_ASSET_ID, alith.address, 2_000_000_000_000_000), - api.tx.assets.mint(FEE_TOKEN_ASSET_ID, emptyAccountSigner.address, 2_000_000_000_000_000), + api.tx.assets.mint(feeTokenAssetId, alith.address, 2_000_000_000_000_000), + api.tx.assets.mint(feeTokenAssetId, emptyAccountSigner.address, 2_000_000_000_000_000), api.tx.dex.addLiquidity( - FEE_TOKEN_ASSET_ID, + feeTokenAssetId, GAS_TOKEN_ID, 100_000_000_000, 100_000_000_000, @@ -75,7 +76,7 @@ describe("Fee Preferences", function () { null, ), ]; - await finalizeTx(alith, api.tx.utility.batch(txes)); + await finalizeTx(alith, api.tx.utility.batch(txs)); }); after(async () => await node.stop()); @@ -145,7 +146,7 @@ describe("Fee Preferences", function () { const transferInput = iface.encodeFunctionData("transfer", [bob.address, transferAmount]); const feeProxy = new Contract(FEE_PROXY_ADDRESS, FEE_PROXY_ABI_DEPRECATED, emptyAccountSigner); const gasEstimate = await feeToken.estimateGas.transfer(bob.address, transferAmount); - const { tokenCost, gasOverrides } = await calcPaymentAmounts(provider, FEE_TOKEN_ASSET_ID, gasEstimate); // default to min payment + const { tokenCost, gasOverrides } = await calcPaymentAmounts(provider, feeTokenAssetId, gasEstimate); // default to min payment const tx = await feeProxy .connect(emptyAccountSigner) .callWithFeePreferences(feeToken.address, 0, feeToken.address, transferInput, gasOverrides); @@ -182,7 +183,7 @@ describe("Fee Preferences", function () { const gasEstimate = await feeToken.estimateGas.transfer(bob.address, transferAmount); const { tokenCost, gasOverrides } = await calcPaymentAmounts( provider, - FEE_TOKEN_ASSET_ID, + feeTokenAssetId, gasEstimate, fees.maxFeePerGas!, // adding priority fee to maxFeePerGas ); @@ -222,7 +223,7 @@ describe("Fee Preferences", function () { const gasEstimate = await feeToken.estimateGas.transfer(bob.address, transferAmount); const { tokenCost, gasOverrides } = await calcPaymentAmounts( provider, - FEE_TOKEN_ASSET_ID, + feeTokenAssetId, gasEstimate, fees.lastBaseFeePerGas!.add(1), // adding priority fee to maxFeePerGas ); @@ -261,7 +262,7 @@ describe("Fee Preferences", function () { const transferInput = iface.encodeFunctionData("transfer", [bob.address, transferAmount]); const feeProxy = new Contract(FEE_PROXY_ADDRESS, FEE_PROXY_ABI, emptyAccountSigner); const gasEstimate = await feeToken.estimateGas.transfer(bob.address, transferAmount); - const { tokenCost, gasOverrides } = await calcPaymentAmounts(provider, FEE_TOKEN_ASSET_ID, gasEstimate); // default to min payment + const { tokenCost, gasOverrides } = await calcPaymentAmounts(provider, feeTokenAssetId, gasEstimate); // default to min payment const tx = await feeProxy .connect(emptyAccountSigner) .callWithFeePreferences(feeToken.address, feeToken.address, transferInput, gasOverrides); @@ -298,7 +299,7 @@ describe("Fee Preferences", function () { const gasEstimate = await feeToken.estimateGas.transfer(bob.address, transferAmount); const { tokenCost, gasOverrides } = await calcPaymentAmounts( provider, - FEE_TOKEN_ASSET_ID, + feeTokenAssetId, gasEstimate, fees.maxFeePerGas!, // adding priority fee to maxFeePerGas ); @@ -338,7 +339,7 @@ describe("Fee Preferences", function () { const gasEstimate = await feeToken.estimateGas.transfer(bob.address, transferAmount); const { tokenCost, gasOverrides } = await calcPaymentAmounts( provider, - FEE_TOKEN_ASSET_ID, + feeTokenAssetId, gasEstimate, fees.lastBaseFeePerGas!.add(1), // adding priority fee to maxFeePerGas ); @@ -379,7 +380,7 @@ describe("Fee Preferences", function () { const gasEstimate = await feeToken.estimateGas.transfer(bob.address, transferAmount); const { tokenCost, gasOverrides } = await calcPaymentAmounts( provider, - FEE_TOKEN_ASSET_ID, + feeTokenAssetId, gasEstimate, fees.lastBaseFeePerGas!.add(500_000), // adding priority fee to maxFeePerGas BigNumber.from(500_000), @@ -416,7 +417,7 @@ describe("Fee Preferences", function () { const { gasOverrides } = await calcPaymentAmounts( provider, - FEE_TOKEN_ASSET_ID, + feeTokenAssetId, gasEstimate, fees.lastBaseFeePerGas!.add(500_000), // adding priority fee to maxFeePerGas BigNumber.from(600_000), // (base + priority fee) exceeds maxFeePerGas @@ -449,7 +450,7 @@ describe("Fee Preferences", function () { const feeProxy = new Contract(FEE_PROXY_ADDRESS, FEE_PROXY_ABI, newAccount); const gasEstimate = await feeToken.estimateGas.transfer(bob.address, transferAmount); - const { gasOverrides } = await calcPaymentAmounts(provider, FEE_TOKEN_ASSET_ID, gasEstimate); // default to min payment + const { gasOverrides } = await calcPaymentAmounts(provider, feeTokenAssetId, gasEstimate); // default to min payment const unsignedTx = { type: 2, from: newAccount.address, @@ -468,6 +469,46 @@ describe("Fee Preferences", function () { expect(error.reason).to.be.eq("insufficient funds for intrinsic transaction cost"); }); + it("Fails to pay fees in non-native token if insufficient liquidity", async () => { + // this is a new account which has no token balance + const newAccount = Wallet.createRandom().connect(provider); + + const paymentAssetId = await getNextAssetId(api); + const txs = [ + api.tx.assetsExt.createAsset("test", "TEST", 18, 1, alith.address), + api.tx.assets.mint(paymentAssetId, alith.address, 2_000_000_000_000_000), + api.tx.assets.mint(paymentAssetId, newAccount.address, 2_000_000_000_000_000), + api.tx.dex.addLiquidity(paymentAssetId, GAS_TOKEN_ID, 100_000, 100_000, 100_000, 100_000, null, null), + ]; + await finalizeTx(alith, api.tx.utility.batch(txs)); + + const paymentToken = new Contract(assetIdToERC20ContractAddress(paymentAssetId), ERC20_ABI, newAccount) as ERC20; + + const transferAmount = 1; + const iface = new utils.Interface(ERC20_ABI); + const transferInput = iface.encodeFunctionData("transfer", [bob.address, transferAmount]); + + const feeProxy = new Contract(FEE_PROXY_ADDRESS, FEE_PROXY_ABI, newAccount); + const gasEstimate = await paymentToken.estimateGas.transfer(bob.address, transferAmount); + const { gasOverrides } = await calcPaymentAmounts(provider, feeTokenAssetId, gasEstimate); // default to min payment + const unsignedTx = { + type: 2, + from: newAccount.address, + to: FEE_PROXY_ADDRESS, + nonce: await newAccount.getTransactionCount(), + data: feeProxy.interface.encodeFunctionData("callWithFeePreferences", [ + paymentToken.address, + paymentToken.address, + transferInput, + ]), + ...gasOverrides, + }; + + const error = await newAccount.sendTransaction(unsignedTx).catch((e) => e); + expect(error.code).to.be.eq("INSUFFICIENT_FUNDS"); + expect(error.reason).to.be.eq("insufficient funds for intrinsic transaction cost"); + }); + it("Fails to pay fees in non-native token with gasLimit 0", async () => { // call `transfer` on erc20 token - via `callWithFeePreferences` precompile function const transferAmount = 1; @@ -516,8 +557,8 @@ describe("Fee Preferences", function () { await finalizeTx( alith, api.tx.utility.batch([ - api.tx.assets.mint(FEE_TOKEN_ASSET_ID, owner.address, 2_000_000_000), - api.tx.assets.mint(FEE_TOKEN_ASSET_ID, futurepass.address, 1), + api.tx.assets.mint(feeTokenAssetId, owner.address, 2_000_000_000), + api.tx.assets.mint(feeTokenAssetId, futurepass.address, 1), ]), ); @@ -551,7 +592,7 @@ describe("Fee Preferences", function () { .connect(owner) .estimateGas.proxyCall(callTxType, feeToken.address, ethers.constants.Zero, transferCallData); - const { tokenCost, gasOverrides } = await calcPaymentAmounts(provider, FEE_TOKEN_ASSET_ID, gasEstimate); // default to min payment + const { tokenCost, gasOverrides } = await calcPaymentAmounts(provider, feeTokenAssetId, gasEstimate); // default to min payment tx = await feeProxy .connect(owner) @@ -600,7 +641,7 @@ describe("Fee Preferences", function () { const feeProxy = new Contract(FEE_PROXY_ADDRESS, FEE_PROXY_ABI, emptyAccountSigner); const gasEstimate = await feeToken.estimateGas.transfer(bob.address, transferAmount); - const { tokenCost, gasOverrides } = await calcPaymentAmounts(provider, FEE_TOKEN_ASSET_ID, gasEstimate); // default to min payment + const { tokenCost, gasOverrides } = await calcPaymentAmounts(provider, feeTokenAssetId, gasEstimate); // default to min payment const nonce = await emptyAccountSigner.getTransactionCount(); const unsignedTx = { @@ -643,37 +684,37 @@ describe("Fee Preferences", function () { const futurepassAddress = (await api.query.futurepass.holders(user.address)).toString(); // mint fee tokens to futurepass - await finalizeTx(alith, api.tx.assets.mint(FEE_TOKEN_ASSET_ID, futurepassAddress, 2_000_000_000_000)); + await finalizeTx(alith, api.tx.assets.mint(feeTokenAssetId, futurepassAddress, 2_000_000_000_000)); const eoaXRPBalanceBefore = ((await api.query.assets.account(GAS_TOKEN_ID, user.address)).toJSON() as any)?.balance ?? 0; const eoaTokenBalanceBefore = - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, user.address)).toJSON() as any)?.balance ?? 0; + ((await api.query.assets.account(feeTokenAssetId, user.address)).toJSON() as any)?.balance ?? 0; const fpXRPBalanceBefore = ((await api.query.assets.account(GAS_TOKEN_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0; const fpTokenBalanceBefore = - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0; + ((await api.query.assets.account(feeTokenAssetId, futurepassAddress)).toJSON() as any)?.balance ?? 0; // console.table({ eoaXRPBalanceBefore, eoaTokenBalanceBefore, fpXRPBalanceBefore, fpTokenBalanceBefore }); const innerCall = api.tx.system.remark("sup"); const proxyExtrinsic = api.tx.futurepass.proxyExtrinsic(futurepassAddress, innerCall); - const feeproxiedCall = api.tx.feeProxy.callWithFeePreferences(FEE_TOKEN_ASSET_ID, 1000000, proxyExtrinsic); + const feeproxiedCall = api.tx.feeProxy.callWithFeePreferences(feeTokenAssetId, 1000000, proxyExtrinsic); await finalizeTx(userKeyring, feeproxiedCall); const eoaXRPBalanceAfter = ((await api.query.assets.account(GAS_TOKEN_ID, user.address)).toJSON() as any)?.balance ?? 0; const eoaTokenBalanceAfter = - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, user.address)).toJSON() as any)?.balance ?? 0; + ((await api.query.assets.account(feeTokenAssetId, user.address)).toJSON() as any)?.balance ?? 0; const fpXRPBalanceAfter = ((await api.query.assets.account(GAS_TOKEN_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0; const fpTokenBalanceAfter = - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0; + ((await api.query.assets.account(feeTokenAssetId, futurepassAddress)).toJSON() as any)?.balance ?? 0; // futurepass should only fee lose tokens expect(eoaXRPBalanceBefore).to.be.eq(eoaXRPBalanceAfter); expect(eoaTokenBalanceBefore).to.be.eq(eoaTokenBalanceAfter); - expect(fpXRPBalanceBefore).to.be.eq(fpXRPBalanceAfter); + expect(fpXRPBalanceBefore + 1).to.be.eq(fpXRPBalanceAfter); // 1 existential deposit expect(fpTokenBalanceAfter).to.be.lessThan(fpTokenBalanceBefore); }); @@ -685,19 +726,19 @@ describe("Fee Preferences", function () { const futurepassAddress = (await api.query.futurepass.holders(user.address)).toString(); // mint fee tokens to futurepass - await finalizeTx(alith, api.tx.assets.mint(FEE_TOKEN_ASSET_ID, futurepassAddress, 2_000_000_000_000)); + await finalizeTx(alith, api.tx.assets.mint(feeTokenAssetId, futurepassAddress, 2_000_000_000_000)); const eoaXRPBalanceBefore = ((await api.query.assets.account(GAS_TOKEN_ID, user.address)).toJSON() as any)?.balance ?? 0; const eoaTokenBalanceBefore = - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, user.address)).toJSON() as any)?.balance ?? 0; + ((await api.query.assets.account(feeTokenAssetId, user.address)).toJSON() as any)?.balance ?? 0; const fpXRPBalanceBefore = ((await api.query.assets.account(GAS_TOKEN_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0; const fpTokenBalanceBefore = - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0; + ((await api.query.assets.account(feeTokenAssetId, futurepassAddress)).toJSON() as any)?.balance ?? 0; // call `transfer` on erc20 token - via `callWithFeePreferences` precompile function - const erc20PrecompileAddress = assetIdToERC20ContractAddress(FEE_TOKEN_ASSET_ID); + const erc20PrecompileAddress = assetIdToERC20ContractAddress(feeTokenAssetId); const sender = futurepassAddress; const value = 0; //eth const gasLimit = 42953; @@ -722,7 +763,7 @@ describe("Fee Preferences", function () { // record bob's token balance const bobTokenBalanceBefore = - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, bob.address)).toJSON() as any)?.balance ?? 0; + ((await api.query.assets.account(feeTokenAssetId, bob.address)).toJSON() as any)?.balance ?? 0; const evmCallGasEstimate = await evmCall.paymentInfo(sender); const evmCallGasEstimateinXRP = evmCallGasEstimate.partialFee; @@ -732,7 +773,7 @@ describe("Fee Preferences", function () { // Find estimate cost for feeProxy call const extrinsicInfo = await api.tx.feeProxy .callWithFeePreferences( - FEE_TOKEN_ASSET_ID, + feeTokenAssetId, utils.parseEther("1").toString(), // 10e18 proxyExtrinsic, ) @@ -742,14 +783,14 @@ describe("Fee Preferences", function () { // cost for fee proxy with proxy_extrinsic + cost for evm call, but the actual cost will be lesser than this value. const estimatedTotalGasCost = evmCallGasEstimateinXRP.toNumber() + feeProxyGasEstimateinXRP.toNumber(); - // convert estimatedTotalGasCost to FEE_TOKEN_ASSET_ID amount + // convert estimatedTotalGasCost to feeTokenAssetId amount const { Ok: [estimatedTokenTxCost], - } = await (api.rpc as any).dex.getAmountsIn(estimatedTotalGasCost, [FEE_TOKEN_ASSET_ID, GAS_TOKEN_ID]); + } = await (api.rpc as any).dex.getAmountsIn(estimatedTotalGasCost, [feeTokenAssetId, GAS_TOKEN_ID]); // Now call the callWithFeePreferences with sufficient max_payment of estimatedTokenTxCost const feeproxiedCall = api.tx.feeProxy.callWithFeePreferences( - FEE_TOKEN_ASSET_ID, + feeTokenAssetId, estimatedTokenTxCost, proxyExtrinsic, ); @@ -758,13 +799,13 @@ describe("Fee Preferences", function () { const eoaXRPBalanceAfter = ((await api.query.assets.account(GAS_TOKEN_ID, user.address)).toJSON() as any)?.balance ?? 0; const eoaTokenBalanceAfter = - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, user.address)).toJSON() as any)?.balance ?? 0; + ((await api.query.assets.account(feeTokenAssetId, user.address)).toJSON() as any)?.balance ?? 0; const fpXRPBalanceAfter = ((await api.query.assets.account(GAS_TOKEN_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0; const fpTokenBalanceAfter = - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0; + ((await api.query.assets.account(feeTokenAssetId, futurepassAddress)).toJSON() as any)?.balance ?? 0; const bobTokenBalanceAfter = - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, bob.address)).toJSON() as any)?.balance ?? 0; + ((await api.query.assets.account(feeTokenAssetId, bob.address)).toJSON() as any)?.balance ?? 0; // eoa token and XRP balance should remain untouched. expect(eoaXRPBalanceBefore).to.be.eq(eoaXRPBalanceAfter); @@ -778,7 +819,7 @@ describe("Fee Preferences", function () { }); it("Pays fees in non-native token with extrinsic - check maxPayment works fine", async () => { - const erc20PrecompileAddress = assetIdToERC20ContractAddress(FEE_TOKEN_ASSET_ID); + const erc20PrecompileAddress = assetIdToERC20ContractAddress(feeTokenAssetId); const sender = alith.address; const value = 0; //eth const gasLimit = 22953; @@ -809,7 +850,7 @@ describe("Fee Preferences", function () { // Find estimate cost for feeProxy call const extrinsicInfo = await api.tx.feeProxy .callWithFeePreferences( - FEE_TOKEN_ASSET_ID, + feeTokenAssetId, utils.parseEther("1").toString(), // 10e18 api.createType("Call", evmCall).toHex(), ) @@ -821,12 +862,12 @@ describe("Fee Preferences", function () { const { Ok: [estimatedTokenTxCost], - } = await (api.rpc as any).dex.getAmountsIn(estimatedTotalGasCost, [FEE_TOKEN_ASSET_ID, GAS_TOKEN_ID]); + } = await (api.rpc as any).dex.getAmountsIn(estimatedTotalGasCost, [feeTokenAssetId, GAS_TOKEN_ID]); const eventData = await new Promise((resolve, reject) => { api.tx.feeProxy .callWithFeePreferences( - FEE_TOKEN_ASSET_ID, + feeTokenAssetId, estimatedTokenTxCost.toString(), api.createType("Call", evmCall).toHex(), ) @@ -843,7 +884,7 @@ describe("Fee Preferences", function () { }); expect(eventData).to.exist; const [from, paymentAsset, maxPayment] = eventData; - expect(paymentAsset.toString()).to.equal(FEE_TOKEN_ASSET_ID.toString()); + expect(paymentAsset.toString()).to.equal(feeTokenAssetId.toString()); expect(from.toString()).to.equal(alith.address.toString()); expect(maxPayment.toString()).to.equal(estimatedTokenTxCost.toString()); }); diff --git a/e2e/test/FeePreferences/LowLiquidity.test.ts b/e2e/test/FeePreferences/LowLiquidity.test.ts deleted file mode 100644 index 5ca1066a0..000000000 --- a/e2e/test/FeePreferences/LowLiquidity.test.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { JsonRpcProvider } from "@ethersproject/providers"; -import { ApiPromise, Keyring, WsProvider } from "@polkadot/api"; -import { KeyringPair } from "@polkadot/keyring/types"; -import { hexToU8a } from "@polkadot/util"; -import { expect } from "chai"; -import { Contract, Wallet, utils } from "ethers"; - -import { - ALITH_PRIVATE_KEY, - BOB_PRIVATE_KEY, - ERC20_ABI, - FEE_PROXY_ABI, - FEE_PROXY_ADDRESS, - GAS_TOKEN_ID, - NodeProcess, - assetIdToERC20ContractAddress, - startNode, - typedefs, -} from "../../common"; - -const feeTokenAssetId = 1124; -const EMPTY_ACCT_PRIVATE_KEY = "0xf8d74108dbe199c4a6e4ef457046db37c325ba3f709b14cabfa1885663e4c589"; - -describe("Fee Preferences under low token pair liquidity", function () { - let node: NodeProcess; - - let bob: KeyringPair; - let emptyAccountSigner: Wallet; - let feeToken: Contract; - let alithSigner: Wallet; - - before(async () => { - node = await startNode(); - - // Setup PolkadotJS rpc provider - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); - const api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); - - const keyring = new Keyring({ type: "ethereum" }); - bob = keyring.addFromSeed(hexToU8a(BOB_PRIVATE_KEY)); - const alith = keyring.addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); - const emptyAcct = keyring.addFromSeed(hexToU8a(EMPTY_ACCT_PRIVATE_KEY)); - - const txes = [ - api.tx.assetsExt.createAsset("test", "TEST", 18, 1, alith.address), - api.tx.assets.mint(feeTokenAssetId, alith.address, 2_000_000_000_000_000), - api.tx.assets.mint(feeTokenAssetId, emptyAcct.address, 2_000_000_000_000_000), - api.tx.dex.addLiquidity(feeTokenAssetId, GAS_TOKEN_ID, 100_000, 100_000, 100_000, 100_000, null, null), - ]; - await new Promise((resolve) => { - api.tx.utility.batch(txes).signAndSend(alith, ({ status }) => { - if (status.isInBlock) { - console.log(`setup block hash: ${status.asInBlock}`); - resolve(); - } - }); - }); - - // Setup JSON RPC provider - const jsonProvider = new JsonRpcProvider(`http://localhost:${node.httpPort}`); - emptyAccountSigner = new Wallet(EMPTY_ACCT_PRIVATE_KEY).connect(jsonProvider); - alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(jsonProvider); - feeToken = new Contract(assetIdToERC20ContractAddress(feeTokenAssetId), ERC20_ABI, alithSigner); - }); - - after(async () => await node.stop()); - - it("Fails to pay fees in non-native token if insufficient liquidity", async () => { - // call `transfer` on erc20 token - via `callWithFeePreferences` precompile function - const transferAmount = 1; - const iface = new utils.Interface(ERC20_ABI); - const transferInput = iface.encodeFunctionData("transfer", [bob.address, transferAmount]); - - const feeProxy = new Contract(FEE_PROXY_ADDRESS, FEE_PROXY_ABI, emptyAccountSigner); - const nonce = await emptyAccountSigner.getTransactionCount(); - const chainId = 7672; - const maxPriorityFeePerGas = 0; // 1_500_000_000 = '0x59682f00' - const gasLimit = 23316; // '0x5b14' = 23316; - const maxFeePerGas = 30_001_500_000_0000; // 30_001_500_000_000 = '0x1b4944c00f00' - const unsignedTx = { - // eip1559 tx - type: 2, - from: emptyAccountSigner.address, - to: FEE_PROXY_ADDRESS, - nonce, - data: feeProxy.interface.encodeFunctionData("callWithFeePreferences", [ - feeToken.address, - feeToken.address, - transferInput, - ]), - gasLimit, - maxFeePerGas, - maxPriorityFeePerGas, - chainId, - }; - - // assert error from tx - const error = await emptyAccountSigner.sendTransaction(unsignedTx).catch((e) => e); - expect(error.code).to.be.eq("INSUFFICIENT_FUNDS"); - expect(error.reason).to.be.eq("insufficient funds for intrinsic transaction cost"); - }); -}); diff --git a/e2e/test/Futurepass/Futurepass.TxCosts.test.ts b/e2e/test/Futurepass/Futurepass.TxCosts.test.ts index f32bce856..801310f06 100644 --- a/e2e/test/Futurepass/Futurepass.TxCosts.test.ts +++ b/e2e/test/Futurepass/Futurepass.TxCosts.test.ts @@ -58,7 +58,7 @@ describe("Futurepass Precompile", function () { node = await startNode(); // Substrate variables - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs, @@ -67,7 +67,7 @@ describe("Futurepass Precompile", function () { alithKeyring = keyring.addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); // Ethereum variables - provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); futurepassRegistrar = new Contract( diff --git a/e2e/test/Futurepass/FuturepassPrecompile.test.ts b/e2e/test/Futurepass/FuturepassPrecompile.test.ts index 167f3489a..cec617a2f 100644 --- a/e2e/test/Futurepass/FuturepassPrecompile.test.ts +++ b/e2e/test/Futurepass/FuturepassPrecompile.test.ts @@ -50,7 +50,7 @@ describe("Futurepass Precompile", function () { node = await startNode(); // Substrate variables - const wsProvider = new WsProvider(`ws://127.0.0.1:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs, @@ -60,7 +60,7 @@ describe("Futurepass Precompile", function () { alithKeyring = keyring.addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); // Ethereum variables - provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); futurepassRegistrar = new Contract( @@ -919,7 +919,7 @@ describe("Futurepass Precompile", function () { // fund the FP, FP_DELEGATE_RESERVE amount of Root for the delegate reserve await fundAccount(api, alithKeyring, futurepassPrecompile.address, FP_DELEGATE_RESERVE); const fpBalance: any = (await api.query.system.account(futurepassPrecompile.address)).toJSON(); - expect(fpBalance.data.free).to.equal(FP_DELEGATE_RESERVE); + expect(fpBalance.data.free).to.equal(FP_DELEGATE_RESERVE + 1); // 1 existential deposit const deadline = (await provider.getBlockNumber()) + 20; const message = ethers.utils @@ -957,7 +957,7 @@ describe("Futurepass Precompile", function () { // fund the FP, FP_DELEGATE_RESERVE amount of Root for the delegate reserve await fundAccount(api, alithKeyring, futurepassPrecompile.address, FP_DELEGATE_RESERVE); const fpBalance: any = (await api.query.system.account(futurepassPrecompile.address)).toJSON(); - expect(fpBalance.data.free).to.equal(FP_DELEGATE_RESERVE); + expect(fpBalance.data.free).to.equal(FP_DELEGATE_RESERVE + 1); // 1 existential deposit const deadline = (await provider.getBlockNumber()) + 20; const message = ethers.utils @@ -1007,7 +1007,7 @@ describe("Futurepass Precompile", function () { // fund the FP, FP_DELEGATE_RESERVE amount of Root for the delegate reserve await fundAccount(api, alithKeyring, futurepassPrecompile.address, FP_DELEGATE_RESERVE); const fpBalance: any = (await api.query.system.account(futurepassPrecompile.address)).toJSON(); - expect(fpBalance.data.free).to.equal(FP_DELEGATE_RESERVE); + expect(fpBalance.data.free).to.equal(FP_DELEGATE_RESERVE + 1); // 1 existential deposit const deadline = (await provider.getBlockNumber()) + 20; const message = ethers.utils @@ -1049,7 +1049,7 @@ describe("Futurepass Precompile", function () { // fund the FP, FP_DELEGATE_RESERVE amount of Root for the delegate reserve await fundAccount(api, alithKeyring, futurepassPrecompile.address, FP_DELEGATE_RESERVE); const fpBalance: any = (await api.query.system.account(futurepassPrecompile.address)).toJSON(); - expect(fpBalance.data.free).to.equal(FP_DELEGATE_RESERVE); + expect(fpBalance.data.free).to.equal(FP_DELEGATE_RESERVE + 1); // 1 existential deposit // create() not allowed let callData = futurepassRegistrar.interface.encodeFunctionData("create", [other.address]); diff --git a/e2e/test/Futurepass/FuturepassRegistrarPrecompile.test.ts b/e2e/test/Futurepass/FuturepassRegistrarPrecompile.test.ts index 2508a4d21..52e13779e 100644 --- a/e2e/test/Futurepass/FuturepassRegistrarPrecompile.test.ts +++ b/e2e/test/Futurepass/FuturepassRegistrarPrecompile.test.ts @@ -24,14 +24,14 @@ describe("Futurepass Precompile", function () { node = await startNode(); // Substrate variables - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); await ApiPromise.create({ provider: wsProvider, types: typedefs, }); // Ethereum variables - provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); futurepassRegistrarProxy = new Contract( diff --git a/e2e/test/Futurepass/TxCosts.md b/e2e/test/Futurepass/TxCosts.md index 16097b6f8..711adb490 100644 --- a/e2e/test/Futurepass/TxCosts.md +++ b/e2e/test/Futurepass/TxCosts.md @@ -1,19 +1,20 @@ ## Generated tx costs(Gas) for Futurepass Precompiles | Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) | -| :---------------------------- | :----------: | :------------: | :-----------------------: | -| create | 0 | 42815 | 19005 | -| registerDelegateWithSignature | 0 | 43044 | 34005 | -| unregisterDelegate | 0 | 37143 | 22337 | -| transferOwnership | 0 | 46053 | 22506 | -| proxyCall | 0 | 65694 | 23507 | +|:------------------------------|:------------:|:--------------:|:-------------------------:| +| create | 0 | 42795 | 19172 | +| registerDelegateWithSignature | 0 | 42933 | 34005 | +| unregisterDelegate | 0 | 38078 | 22338 | +| transferOwnership | 0 | 46431 | 22507 | +| proxyCall | 0 | 65694 | 24008 | + ## Generated tx costs(fees) for Futurepass Precompiles | Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) | -| :---------------------------- | :-------------------: | :---------------------: | :--------------------: | -| create | 0 | 603705 | 285083 | -| registerDelegateWithSignature | 0 | 608940 | 510075 | -| unregisterDelegate | 0 | 554260 | 335069 | -| transferOwnership | 0 | 677737 | 337602 | -| proxyCall | 0 | 899654 | 352610 | +|:------------------------------|:---------------------:|:-----------------------:|:----------------------:| +| create | 0 | 603255 | 287587 | +| registerDelegateWithSignature | 0 | 606405 | 510080 | +| unregisterDelegate | 0 | 570177 | 335078 | +| transferOwnership | 0 | 686378 | 337609 | +| proxyCall | 0 | 899654 | 360130 | diff --git a/e2e/test/MarketPlace/MarketPlacePrecompile.test.ts b/e2e/test/MarketPlace/MarketPlacePrecompile.test.ts index 45c8b528b..c3c3aa814 100644 --- a/e2e/test/MarketPlace/MarketPlacePrecompile.test.ts +++ b/e2e/test/MarketPlace/MarketPlacePrecompile.test.ts @@ -37,14 +37,14 @@ describe("Marketplace Precompile", function () { before(async () => { node = await startNode(); - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); // Setup Root api instance and keyring api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); const keyring = new Keyring({ type: "ethereum" }); const bob = keyring.addFromSeed(hexToU8a(BOB_PRIVATE_KEY)); - const provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + const provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); // 'development' seed bobSigner = new Wallet(BOB_PRIVATE_KEY).connect(provider); diff --git a/e2e/test/MarketPlace/Marketplace.TxCosts.test.ts b/e2e/test/MarketPlace/Marketplace.TxCosts.test.ts index 86c2925a0..249afe758 100644 --- a/e2e/test/MarketPlace/Marketplace.TxCosts.test.ts +++ b/e2e/test/MarketPlace/Marketplace.TxCosts.test.ts @@ -49,7 +49,7 @@ describe("Marketplace Precompile Gas Estimates", function () { before(async () => { node = await startNode(); - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); // Setup Root api instance and keyring api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); @@ -57,7 +57,7 @@ describe("Marketplace Precompile Gas Estimates", function () { bobKeyring = keyring.addFromSeed(hexToU8a(BOB_PRIVATE_KEY)); alithKeyring = keyring.addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); - provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); // 'development' seed bobSigner = new Wallet(BOB_PRIVATE_KEY).connect(provider); diff --git a/e2e/test/MarketPlace/TxCosts.md b/e2e/test/MarketPlace/TxCosts.md index 86b8ac57a..bbf42549f 100644 --- a/e2e/test/MarketPlace/TxCosts.md +++ b/e2e/test/MarketPlace/TxCosts.md @@ -2,29 +2,29 @@ | Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) | |:--------------------|:------------:|:--------------:|:-------------------------:| -| registerMarketplace | 0 | 32492 | 19836 | -| sellNft | 0 | 46114 | 27006 | -| auctionNft | 0 | 46030 | 23506 | -| makeSimpleOffer | 0 | 59796 | 27844 | -| buy | 0 | 23244 | 85010 | -| bid | 0 | 69927 | 687678 | -| cancelSale | 0 | 37754 | 18338 | -| updateFixedPrice | 0 | 32045 | 21002 | -| acceptOffer | 0 | 68258 | 17004 | -| cancelOffer | 0 | 53726 | 17002 | +| registerMarketplace | 0 | 31852 | 20003 | +| sellNft | 0 | 52474 | 27175 | +| auctionNft | 0 | 52664 | 23675 | +| makeSimpleOffer | 0 | 56998 | 28010 | +| buy | 0 | 46376 | 85174 | +| bid | 0 | 57868 | 687843 | +| cancelSale | 0 | 37001 | 18504 | +| updateFixedPrice | 0 | 28397 | 21168 | +| acceptOffer | 0 | 69853 | 17172 | +| cancelOffer | 0 | 52566 | 17168 | ## Generated tx costs(fees) for Marketplace Precompiles | Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) | |:--------------------|:---------------------:|:-----------------------:|:----------------------:| -| registerMarketplace | 0 | 472817 | 297544 | -| sellNft | 0 | 679117 | 405092 | -| auctionNft | 0 | 677197 | 352593 | -| makeSimpleOffer | 0 | 993339 | 417660 | -| buy | 0 | 1344434 | 1275160 | -| bid | 0 | 10974932 | 10315183 | -| cancelSale | 0 | 561356 | 275070 | -| updateFixedPrice | 0 | 458505 | 315032 | -| acceptOffer | 0 | 945144 | 255074 | -| cancelOffer | 0 | 803155 | 255036 | +| registerMarketplace | 0 | 452340 | 300045 | +| sellNft | 0 | 776537 | 407628 | +| auctionNft | 0 | 780588 | 355127 | +| makeSimpleOffer | 0 | 948289 | 420154 | +| buy | 0 | 1685118 | 1277610 | +| bid | 0 | 10866246 | 10317659 | +| cancelSale | 0 | 550330 | 277571 | +| updateFixedPrice | 0 | 420702 | 317532 | +| acceptOffer | 0 | 973497 | 257587 | +| cancelOffer | 0 | 778402 | 257534 | diff --git a/e2e/test/NFTPrecompile.test.ts b/e2e/test/NFTPrecompile.test.ts index 0692fb3cc..e68b3ac25 100644 --- a/e2e/test/NFTPrecompile.test.ts +++ b/e2e/test/NFTPrecompile.test.ts @@ -28,14 +28,14 @@ describe("NFT Precompile", function () { node = await startNode(); // Substrate variables - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs, }); // Ethereum variables - const provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + const provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); // 'development' seed bobSigner = new Wallet(BOB_PRIVATE_KEY).connect(provider); diff --git a/e2e/test/PegPrecompile.test.ts b/e2e/test/PegPrecompile.test.ts index 5538af5ec..0f651c2f2 100644 --- a/e2e/test/PegPrecompile.test.ts +++ b/e2e/test/PegPrecompile.test.ts @@ -36,7 +36,7 @@ describe("Peg Precompile", function () { node = await startNode(); // Substrate variables - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs, @@ -44,7 +44,7 @@ describe("Peg Precompile", function () { const keyring = new Keyring({ type: "ethereum" }); // Ethereum variables - const provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + const provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); // 'development' seed bobSigner = new Wallet(BOB_PRIVATE_KEY).connect(provider); alith = keyring.addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); diff --git a/e2e/test/SftRPC.test.ts b/e2e/test/SftRPC.test.ts index 5fe2526aa..566cf6713 100644 --- a/e2e/test/SftRPC.test.ts +++ b/e2e/test/SftRPC.test.ts @@ -28,7 +28,7 @@ describe("SftRPC", () => { before(async () => { node = await startNode(); - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs, @@ -72,7 +72,7 @@ describe("SftRPC", () => { after(async () => node.stop()); it("token_uri rpc works [http - axios]", async () => { - const httpResult = await axios.post(`http://localhost:${node.httpPort}`, { + const httpResult = await axios.post(`http://127.0.0.1:${node.rpcPort}`, { id: 1, jsonrpc: "2.0", method: "sft_tokenUri", diff --git a/e2e/test/TestCall.GasEstimates.test.ts b/e2e/test/TestCall.GasEstimates.test.ts index 7c384b113..b4aefbfdc 100644 --- a/e2e/test/TestCall.GasEstimates.test.ts +++ b/e2e/test/TestCall.GasEstimates.test.ts @@ -19,7 +19,7 @@ describe("TestCall", () => { await node.wait(); // wait for the node to be ready - provider = new JsonRpcProvider(`http://127.0.0.1:${node.httpPort}`); + provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); const TestFactory = await ethers.getContractFactory("TestCall"); diff --git a/e2e/test/TxFeePotFeeAccruel.test.ts b/e2e/test/TxFeePotFeeAccruel.test.ts index 102642ad8..a037ded00 100644 --- a/e2e/test/TxFeePotFeeAccruel.test.ts +++ b/e2e/test/TxFeePotFeeAccruel.test.ts @@ -28,11 +28,8 @@ describe("TxFeePot fees accruel", () => { node = await startNode(); // Substrate variables - const wsProvider = new WsProvider(`ws://localhost:${node.wsPort}`); - api = await ApiPromise.create({ - provider: wsProvider, - types: typedefs, - }); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); + api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); const keyring = new Keyring({ type: "ethereum" }); alith = keyring.addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); @@ -44,7 +41,7 @@ describe("TxFeePot fees accruel", () => { }); // EVM variables - provider = new JsonRpcProvider(`http://localhost:${node.httpPort}`); + provider = new JsonRpcProvider(`http://127.0.0.1:${node.rpcPort}`); alithSigner = new Wallet(ALITH_PRIVATE_KEY).connect(provider); xrpInitialIssuance = +(await api.query.balances.totalIssuance()).toString(); diff --git a/e2e/test/Vortex.test.ts b/e2e/test/Vortex.test.ts index 574bed9cc..81e069d91 100644 --- a/e2e/test/Vortex.test.ts +++ b/e2e/test/Vortex.test.ts @@ -35,7 +35,7 @@ describe("Vortex Distribution", () => { before(async () => { node = await startNode(); - const wsProvider = new WsProvider(`ws://127.0.0.1:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); // const wsProvider = new WsProvider(`wss://archive.morel.micklelab.xyz/ws`); api = await ApiPromise.create({ provider: wsProvider, diff --git a/e2e/test/XRPL.test.ts b/e2e/test/XRPL.test.ts index 72cdcf076..9c4ea8892 100644 --- a/e2e/test/XRPL.test.ts +++ b/e2e/test/XRPL.test.ts @@ -11,7 +11,17 @@ import { deriveAddress, sign } from "ripple-keypairs"; import Web3 from "web3"; import * as AccountLib from "xrpl-accountlib"; -import { ALITH_PRIVATE_KEY, GAS_TOKEN_ID, NodeProcess, finalizeTx, startNode, stringToHex, typedefs } from "../common"; +import { + ALITH_PRIVATE_KEY, + GAS_TOKEN_ID, + NodeProcess, + finalizeTx, + getNextAssetId, + poolAddress, + startNode, + stringToHex, + typedefs, +} from "../common"; describe("XRPL pallet", () => { let node: NodeProcess; @@ -24,7 +34,7 @@ describe("XRPL pallet", () => { node = await startNode(); // substrate variables - const wsProvider = new WsProvider(`ws://127.0.0.1:${node.wsPort}`); + const wsProvider = new WsProvider(`ws://127.0.0.1:${node.rpcPort}`); api = await ApiPromise.create({ provider: wsProvider, types: typedefs }); alith = new Keyring({ type: "ethereum" }).addFromSeed(hexToU8a(ALITH_PRIVATE_KEY)); genesisHash = api.genesisHash.toHex().slice(2); @@ -439,8 +449,8 @@ describe("XRPL pallet", () => { ((await api.query.assets.account(GAS_TOKEN_ID, user.address)).toJSON() as any)?.balance ?? 0; expect(xrpBalanceAfter).to.be.lessThan(xrpBalanceBefore); expect(xrpBalanceBefore - xrpBalanceAfter) - .to.be.greaterThan(865_000) - .and.lessThan(880_000); + .to.be.greaterThan(870_000) + .and.lessThan(885_000); }); it("can submit fee-proxy extrinsic", async () => { @@ -586,7 +596,7 @@ describe("XRPL pallet", () => { // user xrp balance should not change since tx fees paid in asset const xrpUserBalanceAfter = ((await api.query.assets.account(GAS_TOKEN_ID, user.address)).toJSON() as any)?.balance ?? 0; - expect(xrpUserBalanceAfter).to.be.eq(xrpUserBalanceBefore); + expect(xrpUserBalanceAfter).to.be.eq(xrpUserBalanceBefore + 1); // 1 is existential deposit // assert token balance after < balance before (tx fee must be paid in asset) const assetUserBalanceAfter = BigNumber.from( @@ -714,8 +724,8 @@ describe("XRPL pallet", () => { ((await api.query.assets.account(GAS_TOKEN_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0; expect(xrpFPBalanceAfter).to.be.lessThan(xrpFPBalanceBefore); expect(xrpFPBalanceBefore - xrpFPBalanceAfter) - .to.be.greaterThan(920_000) - .and.lessThan(935_000); + .to.be.greaterThan(925_000) + .and.lessThan(940_000); }); it("can submit futurepass fee-proxy proxy-extrinsic", async () => { @@ -728,13 +738,13 @@ describe("XRPL pallet", () => { const futurepassAddress = (await api.query.futurepass.holders(user.address)).toString(); // add liquidity for XRP<->token; fund the futurepass account with tokens - const FEE_TOKEN_ASSET_ID = 1124; + const paymentToken = await getNextAssetId(api); const txs = [ api.tx.assetsExt.createAsset("test", "TEST", 18, 1, alith.address), - api.tx.assets.mint(FEE_TOKEN_ASSET_ID, alith.address, 2_000_000_000_000_000), - api.tx.assets.mint(FEE_TOKEN_ASSET_ID, futurepassAddress, 2_000_000_000_000_000), + api.tx.assets.mint(paymentToken, alith.address, 2_000_000_000_000_000), + api.tx.assets.mint(paymentToken, futurepassAddress, 2_000_000_000_000_000), api.tx.dex.addLiquidity( - FEE_TOKEN_ASSET_ID, + paymentToken, GAS_TOKEN_ID, 100_000_000_000, 100_000_000_000, @@ -750,7 +760,7 @@ describe("XRPL pallet", () => { const innerCall = api.tx.system.remark("sup"); const futurepassCall = api.tx.futurepass.proxyExtrinsic(futurepassAddress, innerCall); const maxTokenPayment = 5_000_000; - const extrinsic = api.tx.feeProxy.callWithFeePreferences(FEE_TOKEN_ASSET_ID, maxTokenPayment, futurepassCall); + const extrinsic = api.tx.feeProxy.callWithFeePreferences(paymentToken, maxTokenPayment, futurepassCall); const hashedExtrinsicWithoutPrefix = blake256(extrinsic.toHex().slice(6)).toString(); const nonce = ((await api.query.system.account(user.address)).toJSON() as any)?.nonce; const maxBlockNumber = +(await api.query.system.number()).toString() + 5; @@ -760,10 +770,10 @@ describe("XRPL pallet", () => { const xrpFPBalanceBefore = ((await api.query.assets.account(GAS_TOKEN_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0; const assetUserBalanceBefore = BigNumber.from( - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, user.address)).toJSON() as any)?.balance ?? 0, + ((await api.query.assets.account(paymentToken, user.address)).toJSON() as any)?.balance ?? 0, ); const assetFPBalanceBefore = BigNumber.from( - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0, + ((await api.query.assets.account(paymentToken, futurepassAddress)).toJSON() as any)?.balance ?? 0, ); const xamanJsonTx = { @@ -805,7 +815,7 @@ describe("XRPL pallet", () => { // assets Transferred [1124,"0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac","0xDDDDDDdD00000002000004640000000000000000",727237] expect(events[index].event.section).to.equal("assets"); expect(events[index].event.method).to.equal("Transferred"); - expect(events[index].event.data[0]).to.equal(FEE_TOKEN_ASSET_ID); + expect(events[index].event.data[0]).to.equal(paymentToken); expect(events[index].event.data[1].toString()).to.equal(futurepassAddress); // assets Transferred [2,"0xDDDDDDdD00000002000004640000000000000000","0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac",725039] @@ -813,21 +823,21 @@ describe("XRPL pallet", () => { expect(events[index].event.section).to.equal("assets"); expect(events[index].event.method).to.equal("Transferred"); expect(events[index].event.data[0]).to.equal(GAS_TOKEN_ID); - expect(events[index].event.data[1].toString()).to.equal("0xDDDDDDdD00000002000004640000000000000000"); + expect(events[index].event.data[1].toString().toLowerCase()).to.equal(poolAddress(paymentToken, GAS_TOKEN_ID).toLocaleLowerCase()); expect(events[index].event.data[2].toString()).to.equal(futurepassAddress); // assets Issued [2148,"0x6D6F646c7478666565706F740000000000000000",181] index += 1; expect(events[index].event.section).to.equal("assets"); expect(events[index].event.method).to.equal("Issued"); - expect(events[index].event.data[0]).to.equal(2148); + // expect(events[index].event.data[0]).to.equal(paymentToken); // pool token // dex Swap ["0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac",[1124,2],727237,725039,"0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"] index += 1; expect(events[index].event.section).to.equal("dex"); expect(events[index].event.method).to.equal("Swap"); expect(events[index].event.data[0].toString()).to.equal(futurepassAddress); - expect(events[index].event.data[1].toString()).to.equal(`[${FEE_TOKEN_ASSET_ID}, ${GAS_TOKEN_ID}]`); + expect(events[index].event.data[1].toString()).to.equal(`[${paymentToken}, ${GAS_TOKEN_ID}]`); // assetsExt InternalWithdraw [2,"0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac",725039] index += 1; @@ -852,7 +862,7 @@ describe("XRPL pallet", () => { expect(events[index].event.section).to.equal("feeProxy"); expect(events[index].event.method).to.equal("CallWithFeePreferences"); expect(events[index].event.data[0].toString()).to.equal(user.address); // TODO: should be futurepass address - expect(events[index].event.data[1]).to.equal(FEE_TOKEN_ASSET_ID); + expect(events[index].event.data[1]).to.equal(paymentToken); expect(events[index].event.data[2]).to.equal(maxTokenPayment); // xrpl XRPLExtrinsicExecuted ["0x02509540919faacf9ab52146c9aa40db68172d83777250b28e4679176e49ccdd9f","0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac","rDyqBotBNJeXv8PBHY18ABjyw6FQuWXQnu",{"callIndex":"0x1f00","args":{"payment_asset":1124,"max_payment":2000000,"call":{"callIndex":"0x0001","args":{"remark":"0x737570"}}}}] @@ -887,18 +897,18 @@ describe("XRPL pallet", () => { // user asset balance should not change since tx fees paid by futurepass in asset const assetUserBalanceAfter = BigNumber.from( - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, user.address)).toJSON() as any)?.balance ?? 0, + ((await api.query.assets.account(paymentToken, user.address)).toJSON() as any)?.balance ?? 0, ); expect(assetUserBalanceAfter).to.be.eq(assetUserBalanceBefore); // futurepass xrp balance should not change since tx fees paid by futurepass in asset const xrpFPBalanceAfter = ((await api.query.assets.account(GAS_TOKEN_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0; - expect(xrpFPBalanceAfter).to.be.eq(xrpFPBalanceBefore); + expect(xrpFPBalanceAfter).to.be.eq(xrpFPBalanceBefore + 1); // 1 is existential deposit // assert futurepass token balance after < balance before (tx fee must be paid in asset by futurepass) const assetFPBalanceAfter = BigNumber.from( - ((await api.query.assets.account(FEE_TOKEN_ASSET_ID, futurepassAddress)).toJSON() as any)?.balance ?? 0, + ((await api.query.assets.account(paymentToken, futurepassAddress)).toJSON() as any)?.balance ?? 0, ); expect(assetFPBalanceAfter).to.be.lessThan(assetFPBalanceBefore); }); diff --git a/e2e/yarn.lock b/e2e/yarn.lock index d0c303ac0..154bc119b 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -85,13 +85,6 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.9.tgz#7b903b6149b0f8fa7ad564af646c4c38a77fc44b" integrity sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA== -"@babel/runtime@^7.20.13", "@babel/runtime@^7.20.6": - version "7.23.9" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.9.tgz#47791a15e4603bb5f905bc0753801cf21d6345f7" - integrity sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw== - dependencies: - regenerator-runtime "^0.14.0" - "@babel/template@^7.22.15": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.23.9.tgz#f881d0487cba2828d3259dcb9ef5005a9731011a" @@ -663,6 +656,13 @@ dependencies: "@noble/hashes" "1.3.3" +"@noble/curves@^1.3.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.0.tgz#f05771ef64da724997f69ee1261b2417a49522d6" + integrity sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg== + dependencies: + "@noble/hashes" "1.4.0" + "@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" @@ -673,7 +673,7 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== -"@noble/hashes@^1.2.0": +"@noble/hashes@1.4.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.3.3": version "1.4.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== @@ -953,336 +953,383 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.5.tgz#1eed23d4844c861a1835b5d33507c1017fa98de8" integrity sha512-ZK+W5mVhRppff9BE6YdR8CC52C8zAvsVAiWhEtQ5+oNxFE6h1WdeWo+FJSF8KKvtxxVYZ7MTP/5KoVpAU3aSWg== -"@polkadot/api-augment@9.14.2": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-9.14.2.tgz#2c49cdcfdf7057523db1dc8d7b0801391a8a2e69" - integrity sha512-19MmW8AHEcLkdcUIo3LLk0eCQgREWqNSxkUyOeWn7UiNMY1AhDOOwMStUBNCvrIDK6VL6GGc1sY7rkPCLMuKSw== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/api-base" "9.14.2" - "@polkadot/rpc-augment" "9.14.2" - "@polkadot/types" "9.14.2" - "@polkadot/types-augment" "9.14.2" - "@polkadot/types-codec" "9.14.2" - "@polkadot/util" "^10.4.2" - -"@polkadot/api-base@9.14.2": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-9.14.2.tgz#605b44e3692a125bd8d97eed9cea8af9d0c454e2" - integrity sha512-ky9fmzG1Tnrjr/SBZ0aBB21l0TFr+CIyQenQczoUyVgiuxVaI/2Bp6R2SFrHhG28P+PW2/RcYhn2oIAR2Z2fZQ== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/rpc-core" "9.14.2" - "@polkadot/types" "9.14.2" - "@polkadot/util" "^10.4.2" - rxjs "^7.8.0" - -"@polkadot/api-derive@9.14.2": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-9.14.2.tgz#e8fcd4ee3f2b80b9fe34d4dec96169c3bdb4214d" - integrity sha512-yw9OXucmeggmFqBTMgza0uZwhNjPxS7MaT7lSCUIRKckl1GejdV+qMhL3XFxPFeYzXwzFpdPG11zWf+qJlalqw== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/api" "9.14.2" - "@polkadot/api-augment" "9.14.2" - "@polkadot/api-base" "9.14.2" - "@polkadot/rpc-core" "9.14.2" - "@polkadot/types" "9.14.2" - "@polkadot/types-codec" "9.14.2" - "@polkadot/util" "^10.4.2" - "@polkadot/util-crypto" "^10.4.2" - rxjs "^7.8.0" - -"@polkadot/api@9.14.2", "@polkadot/api@^9.6.1": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-9.14.2.tgz#d5cee02236654c6063d7c4b70c78c290db5aba8d" - integrity sha512-R3eYFj2JgY1zRb+OCYQxNlJXCs2FA+AU4uIEiVcXnVLmR3M55tkRNEwYAZmiFxx0pQmegGgPMc33q7TWGdw24A== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/api-augment" "9.14.2" - "@polkadot/api-base" "9.14.2" - "@polkadot/api-derive" "9.14.2" - "@polkadot/keyring" "^10.4.2" - "@polkadot/rpc-augment" "9.14.2" - "@polkadot/rpc-core" "9.14.2" - "@polkadot/rpc-provider" "9.14.2" - "@polkadot/types" "9.14.2" - "@polkadot/types-augment" "9.14.2" - "@polkadot/types-codec" "9.14.2" - "@polkadot/types-create" "9.14.2" - "@polkadot/types-known" "9.14.2" - "@polkadot/util" "^10.4.2" - "@polkadot/util-crypto" "^10.4.2" - eventemitter3 "^5.0.0" - rxjs "^7.8.0" - -"@polkadot/keyring@^10.4.2": - version "10.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.4.2.tgz#793377fdb9076df0af771df11388faa6be03c70d" - integrity sha512-7iHhJuXaHrRTG6cJDbZE9G+c1ts1dujp0qbO4RfAPmT7YUvphHvAtCKueN9UKPz5+TYDL+rP/jDEaSKU8jl/qQ== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/util" "10.4.2" - "@polkadot/util-crypto" "10.4.2" - -"@polkadot/networks@10.4.2", "@polkadot/networks@^10.4.2": - version "10.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.4.2.tgz#d7878c6aad8173c800a21140bfe5459261724456" - integrity sha512-FAh/znrEvWBiA/LbcT5GXHsCFUl//y9KqxLghSr/CreAmAergiJNT0MVUezC7Y36nkATgmsr4ylFwIxhVtuuCw== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/util" "10.4.2" - "@substrate/ss58-registry" "^1.38.0" - -"@polkadot/rpc-augment@9.14.2": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-9.14.2.tgz#eb70d5511463dab8d995faeb77d4edfe4952fe26" - integrity sha512-mOubRm3qbKZTbP9H01XRrfTk7k5it9WyzaWAg72DJBQBYdgPUUkGSgpPD/Srkk5/5GAQTWVWL1I2UIBKJ4TJjQ== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/rpc-core" "9.14.2" - "@polkadot/types" "9.14.2" - "@polkadot/types-codec" "9.14.2" - "@polkadot/util" "^10.4.2" - -"@polkadot/rpc-core@9.14.2": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-9.14.2.tgz#26d4f00ac7abbf880f8280e9b96235880d35794b" - integrity sha512-krA/mtQ5t9nUQEsEVC1sjkttLuzN6z6gyJxK2IlpMS3S5ncy/R6w4FOpy+Q0H18Dn83JBo0p7ZtY7Y6XkK48Kw== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/rpc-augment" "9.14.2" - "@polkadot/rpc-provider" "9.14.2" - "@polkadot/types" "9.14.2" - "@polkadot/util" "^10.4.2" - rxjs "^7.8.0" - -"@polkadot/rpc-provider@9.14.2": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-9.14.2.tgz#0dea667f3a03bf530f202cba5cd360df19b32e30" - integrity sha512-YTSywjD5PF01V47Ru5tln2LlpUwJiSOdz6rlJXPpMaY53hUp7+xMU01FVAQ1bllSBNisSD1Msv/mYHq84Oai2g== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/keyring" "^10.4.2" - "@polkadot/types" "9.14.2" - "@polkadot/types-support" "9.14.2" - "@polkadot/util" "^10.4.2" - "@polkadot/util-crypto" "^10.4.2" - "@polkadot/x-fetch" "^10.4.2" - "@polkadot/x-global" "^10.4.2" - "@polkadot/x-ws" "^10.4.2" - eventemitter3 "^5.0.0" - mock-socket "^9.2.1" - nock "^13.3.0" - optionalDependencies: - "@substrate/connect" "0.7.19" - -"@polkadot/types-augment@9.14.2": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-9.14.2.tgz#1a478e18e713b04038f3e171287ee5abe908f0aa" - integrity sha512-WO9d7RJufUeY3iFgt2Wz762kOu1tjEiGBR5TT4AHtpEchVHUeosVTrN9eycC+BhleqYu52CocKz6u3qCT/jKLg== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/types" "9.14.2" - "@polkadot/types-codec" "9.14.2" - "@polkadot/util" "^10.4.2" - -"@polkadot/types-codec@9.14.2": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-9.14.2.tgz#d625c80495d7a68237b3d5c0a60ff10d206131fa" - integrity sha512-AJ4XF7W1no4PENLBRU955V6gDxJw0h++EN3YoDgThozZ0sj3OxyFupKgNBZcZb2V23H8JxQozzIad8k+nJbO1w== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/util" "^10.4.2" - "@polkadot/x-bigint" "^10.4.2" - -"@polkadot/types-create@9.14.2": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-9.14.2.tgz#aec515a2d3bc7e7b7802095cdd35ece48dc442bc" - integrity sha512-nSnKpBierlmGBQT8r6/SHf6uamBIzk4WmdMsAsR4uJKJF1PtbIqx2W5PY91xWSiMSNMzjkbCppHkwaDAMwLGaw== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/types-codec" "9.14.2" - "@polkadot/util" "^10.4.2" - -"@polkadot/types-known@9.14.2": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-9.14.2.tgz#17fe5034a5b907bd006093a687f112b07edadf10" - integrity sha512-iM8WOCgguzJ3TLMqlm4K1gKQEwWm2zxEKT1HZZ1irs/lAbBk9MquDWDvebryiw3XsLB8xgrp3RTIBn2Q4FjB2A== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/networks" "^10.4.2" - "@polkadot/types" "9.14.2" - "@polkadot/types-codec" "9.14.2" - "@polkadot/types-create" "9.14.2" - "@polkadot/util" "^10.4.2" - -"@polkadot/types-support@9.14.2": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-9.14.2.tgz#d25e8d4e5ec3deef914cb55fc8bc5448431ddd18" - integrity sha512-VWCOPgXDK3XtXT7wMLyIWeNDZxUbNcw/8Pn6n6vMogs7o/n4h6WGbGMeTIQhPWyn831/RmkVs5+2DUC+2LlOhw== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/util" "^10.4.2" - -"@polkadot/types@9.14.2", "@polkadot/types@^9.6.1": - version "9.14.2" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-9.14.2.tgz#5105f41eb9e8ea29938188d21497cbf1753268b8" - integrity sha512-hGLddTiJbvowhhUZJ3k+olmmBc1KAjWIQxujIUIYASih8FQ3/YJDKxaofGOzh0VygOKW3jxQBN2VZPofyDP9KQ== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/keyring" "^10.4.2" - "@polkadot/types-augment" "9.14.2" - "@polkadot/types-codec" "9.14.2" - "@polkadot/types-create" "9.14.2" - "@polkadot/util" "^10.4.2" - "@polkadot/util-crypto" "^10.4.2" - rxjs "^7.8.0" - -"@polkadot/util-crypto@10.4.2", "@polkadot/util-crypto@^10.4.2": - version "10.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.4.2.tgz#871fb69c65768bd48c57bb5c1f76a85d979fb8b5" - integrity sha512-RxZvF7C4+EF3fzQv8hZOLrYCBq5+wA+2LWv98nECkroChY3C2ZZvyWDqn8+aonNULt4dCVTWDZM0QIY6y4LUAQ== - dependencies: - "@babel/runtime" "^7.20.13" - "@noble/hashes" "1.2.0" - "@noble/secp256k1" "1.7.1" - "@polkadot/networks" "10.4.2" - "@polkadot/util" "10.4.2" - "@polkadot/wasm-crypto" "^6.4.1" - "@polkadot/x-bigint" "10.4.2" - "@polkadot/x-randomvalues" "10.4.2" - "@scure/base" "1.1.1" - ed2curve "^0.3.0" - tweetnacl "^1.0.3" +"@polkadot-api/json-rpc-provider-proxy@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/json-rpc-provider-proxy/-/json-rpc-provider-proxy-0.0.1.tgz#bb5c943642cdf0ec7bc48c0a2647558b9fcd7bdb" + integrity sha512-gmVDUP8LpCH0BXewbzqXF2sdHddq1H1q+XrAW2of+KZj4woQkIGBRGTJHeBEVHe30EB+UejR1N2dT4PO/RvDdg== + +"@polkadot-api/json-rpc-provider@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/json-rpc-provider/-/json-rpc-provider-0.0.1.tgz#333645d40ccd9bccfd1f32503f17e4e63e76e297" + integrity sha512-/SMC/l7foRjpykLTUTacIH05H3mr9ip8b5xxfwXlVezXrNVLp3Cv0GX6uItkKd+ZjzVPf3PFrDF2B2/HLSNESA== -"@polkadot/util@10.4.2", "@polkadot/util@^10.1.11", "@polkadot/util@^10.4.2": - version "10.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.4.2.tgz#df41805cb27f46b2b4dad24c371fa2a68761baa1" - integrity sha512-0r5MGICYiaCdWnx+7Axlpvzisy/bi1wZGXgCSw5+ZTyPTOqvsYRqM2X879yxvMsGfibxzWqNzaiVjToz1jvUaA== +"@polkadot-api/metadata-builders@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/metadata-builders/-/metadata-builders-0.0.1.tgz#a76b48febef9ea72be8273d889e2677101045a05" + integrity sha512-GCI78BHDzXAF/L2pZD6Aod/yl82adqQ7ftNmKg51ixRL02JpWUA+SpUKTJE5MY1p8kiJJIo09P2um24SiJHxNA== dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/x-bigint" "10.4.2" - "@polkadot/x-global" "10.4.2" - "@polkadot/x-textdecoder" "10.4.2" - "@polkadot/x-textencoder" "10.4.2" - "@types/bn.js" "^5.1.1" - bn.js "^5.2.1" + "@polkadot-api/substrate-bindings" "0.0.1" + "@polkadot-api/utils" "0.0.1" -"@polkadot/wasm-bridge@6.4.1": - version "6.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-6.4.1.tgz#e97915dd67ba543ec3381299c2a5b9330686e27e" - integrity sha512-QZDvz6dsUlbYsaMV5biZgZWkYH9BC5AfhT0f0/knv8+LrbAoQdP3Asbvddw8vyU9sbpuCHXrd4bDLBwUCRfrBQ== +"@polkadot-api/observable-client@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@polkadot-api/observable-client/-/observable-client-0.1.0.tgz#472045ea06a2bc4bccdc2db5c063eadcbf6f5351" + integrity sha512-GBCGDRztKorTLna/unjl/9SWZcRmvV58o9jwU2Y038VuPXZcr01jcw/1O3x+yeAuwyGzbucI/mLTDa1QoEml3A== dependencies: - "@babel/runtime" "^7.20.6" - -"@polkadot/wasm-crypto-asmjs@6.4.1": - version "6.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-6.4.1.tgz#3cc76bbda5ea4a7a860982c64f9565907b312253" - integrity sha512-UxZTwuBZlnODGIQdCsE2Sn/jU0O2xrNQ/TkhRFELfkZXEXTNu4lw6NpaKq7Iey4L+wKd8h4lT3VPVkMcPBLOvA== - dependencies: - "@babel/runtime" "^7.20.6" - -"@polkadot/wasm-crypto-init@6.4.1": - version "6.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-6.4.1.tgz#4d9ab0030db52cf177bf707ef8e77aa4ca721668" - integrity sha512-1ALagSi/nfkyFaH6JDYfy/QbicVbSn99K8PV9rctDUfxc7P06R7CoqbjGQ4OMPX6w1WYVPU7B4jPHGLYBlVuMw== - dependencies: - "@babel/runtime" "^7.20.6" - "@polkadot/wasm-bridge" "6.4.1" - "@polkadot/wasm-crypto-asmjs" "6.4.1" - "@polkadot/wasm-crypto-wasm" "6.4.1" - -"@polkadot/wasm-crypto-wasm@6.4.1": - version "6.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-6.4.1.tgz#97180f80583b18f6a13c1054fa5f7e8da40b1028" - integrity sha512-3VV9ZGzh0ZY3SmkkSw+0TRXxIpiO0nB8lFwlRgcwaCihwrvLfRnH9GI8WE12mKsHVjWTEVR3ogzILJxccAUjDA== - dependencies: - "@babel/runtime" "^7.20.6" - "@polkadot/wasm-util" "6.4.1" - -"@polkadot/wasm-crypto@^6.4.1": - version "6.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-6.4.1.tgz#79310e23ad1ca62362ba893db6a8567154c2536a" - integrity sha512-FH+dcDPdhSLJvwL0pMLtn/LIPd62QDPODZRCmDyw+pFjLOMaRBc7raomWUOqyRWJTnqVf/iscc2rLVLNMyt7ag== - dependencies: - "@babel/runtime" "^7.20.6" - "@polkadot/wasm-bridge" "6.4.1" - "@polkadot/wasm-crypto-asmjs" "6.4.1" - "@polkadot/wasm-crypto-init" "6.4.1" - "@polkadot/wasm-crypto-wasm" "6.4.1" - "@polkadot/wasm-util" "6.4.1" - -"@polkadot/wasm-util@6.4.1": - version "6.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-6.4.1.tgz#74aecc85bec427a9225d9874685944ea3dc3ab76" - integrity sha512-Uwo+WpEsDmFExWC5kTNvsVhvqXMZEKf4gUHXFn4c6Xz4lmieRT5g+1bO1KJ21pl4msuIgdV3Bksfs/oiqMFqlw== - dependencies: - "@babel/runtime" "^7.20.6" - -"@polkadot/x-bigint@10.4.2", "@polkadot/x-bigint@^10.4.2": - version "10.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.4.2.tgz#7eb2ec732259df48b5a00f07879a1331e05606ec" - integrity sha512-awRiox+/XSReLzimAU94fPldowiwnnMUkQJe8AebYhNocAj6SJU00GNoj6j6tAho6yleOwrTJXZaWFBaQVJQNg== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/x-global" "10.4.2" - -"@polkadot/x-fetch@^10.4.2": - version "10.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.4.2.tgz#bc6ba70de71a252472fbe36180511ed920e05f05" - integrity sha512-Ubb64yaM4qwhogNP+4mZ3ibRghEg5UuCYRMNaCFoPgNAY8tQXuDKrHzeks3+frlmeH9YRd89o8wXLtWouwZIcw== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/x-global" "10.4.2" - "@types/node-fetch" "^2.6.2" - node-fetch "^3.3.0" - -"@polkadot/x-global@10.4.2", "@polkadot/x-global@^10.4.2": - version "10.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.4.2.tgz#5662366e3deda0b4c8f024b2d902fa838f9e60a4" - integrity sha512-g6GXHD/ykZvHap3M6wh19dO70Zm43l4jEhlxf5LtTo5/0/UporFCXr2YJYZqfbn9JbQwl1AU+NroYio+vtJdiA== - dependencies: - "@babel/runtime" "^7.20.13" - -"@polkadot/x-randomvalues@10.4.2": - version "10.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.4.2.tgz#895f1220d5a4522a83d8d5014e3c1e03b129893e" - integrity sha512-mf1Wbpe7pRZHO0V3V89isPLqZOy5XGX2bCqsfUWHgb1NvV1MMx5TjVjdaYyNlGTiOkAmJKlOHshcfPU2sYWpNg== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/x-global" "10.4.2" - -"@polkadot/x-textdecoder@10.4.2": - version "10.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.4.2.tgz#93202f3e5ad0e7f75a3fa02d2b8a3343091b341b" - integrity sha512-d3ADduOKUTU+cliz839+KCFmi23pxTlabH7qh7Vs1GZQvXOELWdqFOqakdiAjtMn68n1KVF4O14Y+OUm7gp/zA== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/x-global" "10.4.2" - -"@polkadot/x-textencoder@10.4.2": - version "10.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.4.2.tgz#cd2e6c8a66b0b400a73f0164e99c510fb5c83501" - integrity sha512-mxcQuA1exnyv74Kasl5vxBq01QwckG088lYjc3KwmND6+pPrW2OWagbxFX5VFoDLDAE+UJtnUHsjdWyOTDhpQA== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/x-global" "10.4.2" - -"@polkadot/x-ws@^10.4.2": - version "10.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.4.2.tgz#4e9d88f37717570ccf942c6f4f63b06260f45025" - integrity sha512-3gHSTXAWQu1EMcMVTF5QDKHhEHzKxhAArweEyDXE7VsgKUP/ixxw4hVZBrkX122iI5l5mjSiooRSnp/Zl3xqDQ== - dependencies: - "@babel/runtime" "^7.20.13" - "@polkadot/x-global" "10.4.2" - "@types/websocket" "^1.0.5" - websocket "^1.0.34" + "@polkadot-api/metadata-builders" "0.0.1" + "@polkadot-api/substrate-bindings" "0.0.1" + "@polkadot-api/substrate-client" "0.0.1" + "@polkadot-api/utils" "0.0.1" -"@scure/base@1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" - integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== +"@polkadot-api/substrate-bindings@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/substrate-bindings/-/substrate-bindings-0.0.1.tgz#c4b7f4d6c3672d2c15cbc6c02964f014b73cbb0b" + integrity sha512-bAe7a5bOPnuFVmpv7y4BBMRpNTnMmE0jtTqRUw/+D8ZlEHNVEJQGr4wu3QQCl7k1GnSV1wfv3mzIbYjErEBocg== + dependencies: + "@noble/hashes" "^1.3.1" + "@polkadot-api/utils" "0.0.1" + "@scure/base" "^1.1.1" + scale-ts "^1.6.0" + +"@polkadot-api/substrate-client@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/substrate-client/-/substrate-client-0.0.1.tgz#0e8010a0abe2fb47d6fa7ab94e45e1d0de083314" + integrity sha512-9Bg9SGc3AwE+wXONQoW8GC00N3v6lCZLW74HQzqB6ROdcm5VAHM4CB/xRzWSUF9CXL78ugiwtHx3wBcpx4H4Wg== + +"@polkadot-api/utils@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/utils/-/utils-0.0.1.tgz#908b22becac705149d7cc946532143d0fb003bfc" + integrity sha512-3j+pRmlF9SgiYDabSdZsBSsN5XHbpXOAce1lWj56IEEaFZVjsiCaxDOA7C9nCcgfVXuvnbxqqEGQvnY+QfBAUw== + +"@polkadot/api-augment@11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-11.0.3.tgz#bb2a7304ec5e4e7deb19f14c5002e82de7d555a6" + integrity sha512-O1QEUXiHpPJqVe398EQ+tywZLj1vDNZALzh2TKsyFSqEjT4N/EschCck9aFXpB0Bp0K2lm7+fKJf6eWPShNfFQ== + dependencies: + "@polkadot/api-base" "11.0.3" + "@polkadot/rpc-augment" "11.0.3" + "@polkadot/types" "11.0.3" + "@polkadot/types-augment" "11.0.3" + "@polkadot/types-codec" "11.0.3" + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/api-base@11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-11.0.3.tgz#d1232af45df8da459e263a13a43d7a0b161d268a" + integrity sha512-e/KSsDcFIG17SPw+buBXAq5NnBOMMOWljTljazDF7Nq3Sz6P+SFqOSb3kdICtp1fYAxg5my/uTs2OOARxJRXKA== + dependencies: + "@polkadot/rpc-core" "11.0.3" + "@polkadot/types" "11.0.3" + "@polkadot/util" "^12.6.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/api-derive@11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-11.0.3.tgz#6e03fc7affeaf423216f50e05dab882c4f7e56d9" + integrity sha512-WJriPWX0WnDhHAETAYkgCxIhkKmnRPqSsBKUHZxq+GgMJByOA4wgo3gzq5aQLXgkcCLV3wM4a6hALodYz0urSw== + dependencies: + "@polkadot/api" "11.0.3" + "@polkadot/api-augment" "11.0.3" + "@polkadot/api-base" "11.0.3" + "@polkadot/rpc-core" "11.0.3" + "@polkadot/types" "11.0.3" + "@polkadot/types-codec" "11.0.3" + "@polkadot/util" "^12.6.2" + "@polkadot/util-crypto" "^12.6.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/api@11.0.3", "@polkadot/api@^11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-11.0.3.tgz#6a7b316e0e219ad1c1b9530b1e5f643150b79b63" + integrity sha512-VYuS42s5MiUOLo/PP1deYsddelGP4/mb1KFonXyWk69XowsfihGbVjsjh+DA4jPXvoNJqdGnDdu3SeppTY9MZQ== + dependencies: + "@polkadot/api-augment" "11.0.3" + "@polkadot/api-base" "11.0.3" + "@polkadot/api-derive" "11.0.3" + "@polkadot/keyring" "^12.6.2" + "@polkadot/rpc-augment" "11.0.3" + "@polkadot/rpc-core" "11.0.3" + "@polkadot/rpc-provider" "11.0.3" + "@polkadot/types" "11.0.3" + "@polkadot/types-augment" "11.0.3" + "@polkadot/types-codec" "11.0.3" + "@polkadot/types-create" "11.0.3" + "@polkadot/types-known" "11.0.3" + "@polkadot/util" "^12.6.2" + "@polkadot/util-crypto" "^12.6.2" + eventemitter3 "^5.0.1" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/keyring@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-12.6.2.tgz#6067e6294fee23728b008ac116e7e9db05cecb9b" + integrity sha512-O3Q7GVmRYm8q7HuB3S0+Yf/q/EB2egKRRU3fv9b3B7V+A52tKzA+vIwEmNVaD1g5FKW9oB97rmpggs0zaKFqHw== + dependencies: + "@polkadot/util" "12.6.2" + "@polkadot/util-crypto" "12.6.2" + tslib "^2.6.2" + +"@polkadot/networks@12.6.2", "@polkadot/networks@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-12.6.2.tgz#791779fee1d86cc5b6cd371858eea9b7c3f8720d" + integrity sha512-1oWtZm1IvPWqvMrldVH6NI2gBoCndl5GEwx7lAuQWGr7eNL+6Bdc5K3Z9T0MzFvDGoi2/CBqjX9dRKo39pDC/w== + dependencies: + "@polkadot/util" "12.6.2" + "@substrate/ss58-registry" "^1.44.0" + tslib "^2.6.2" + +"@polkadot/rpc-augment@11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-11.0.3.tgz#a94eca4511406879ebeb438c82618f7d484294ba" + integrity sha512-Yuiv6EPwdRXMZmleKE0u/qVc20Ut+9O5mLoxKM6jCplg+aWvc51pbS2XOpXEpvWRIWWzCSpqzVc6WcMMYU6MTA== + dependencies: + "@polkadot/rpc-core" "11.0.3" + "@polkadot/types" "11.0.3" + "@polkadot/types-codec" "11.0.3" + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/rpc-core@11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-11.0.3.tgz#e991459629d38501891c25fa57bccf2ab2b3da67" + integrity sha512-DhMUoAVxRw1Cv49lkVQ889eLbrfXZbNCFBTEMyauNUQFZUyIDE8w/FLPiOsyhiXwUww5wTMWte9UnWxvBlppvQ== + dependencies: + "@polkadot/rpc-augment" "11.0.3" + "@polkadot/rpc-provider" "11.0.3" + "@polkadot/types" "11.0.3" + "@polkadot/util" "^12.6.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/rpc-provider@11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-11.0.3.tgz#d6366afd6add7a79e6c4620e9969ed27b28ee508" + integrity sha512-xgfHOF4y9jAD9aDDX/i9WUCRw8N6duRs0P/ysw2AafGKUGSBA/pqP/WXN61dQqq+DzZYfzL/FsMyTcUirsEkJA== + dependencies: + "@polkadot/keyring" "^12.6.2" + "@polkadot/types" "11.0.3" + "@polkadot/types-support" "11.0.3" + "@polkadot/util" "^12.6.2" + "@polkadot/util-crypto" "^12.6.2" + "@polkadot/x-fetch" "^12.6.2" + "@polkadot/x-global" "^12.6.2" + "@polkadot/x-ws" "^12.6.2" + eventemitter3 "^5.0.1" + mock-socket "^9.3.1" + nock "^13.5.0" + tslib "^2.6.2" + optionalDependencies: + "@substrate/connect" "0.8.10" + +"@polkadot/types-augment@11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-11.0.3.tgz#7ddc14c17fe41f921b05d7be10db364a40f41ee8" + integrity sha512-/LXP/LDDr59ZigfeYXtYWrIr4qttYwlkEV7EMUnse5zYWAGH8mkras0Um7gX7kd/GndJAHvXAbbSdrduhg/uNA== + dependencies: + "@polkadot/types" "11.0.3" + "@polkadot/types-codec" "11.0.3" + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/types-codec@11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-11.0.3.tgz#b399ddf0e14461fd74cdfc6675ab3b28b4834929" + integrity sha512-WSYmacSfUnnspKpLbagng8zo84eXLOztCYSppmqLoCrwtQE0zg5P/jF18qIeozvmPh+I/HMordXKt34JPgI/6w== + dependencies: + "@polkadot/util" "^12.6.2" + "@polkadot/x-bigint" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/types-create@11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-11.0.3.tgz#70e9b6a692b721cb848be9e0ad5033e51c6ea811" + integrity sha512-/uK9BCaivd5kcqZZCeIOlN0pSFyIELk9VGVOM3HsitE6IQrOlYPrYe0RqrQhoU/kjNC5BHaWviYV3Hu3TlOJuw== + dependencies: + "@polkadot/types-codec" "11.0.3" + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/types-known@11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-11.0.3.tgz#2d5b2884ef1a7a721b91967b1633da874f997b3e" + integrity sha512-nuv/a32QYtZYCD7IMj+WKgcblgMJse2t3RuWO+ZtT/uscOmR7TjctkS2ayzSJDQ5wWCPGet1eIwYpJYfGFOPkw== + dependencies: + "@polkadot/networks" "^12.6.2" + "@polkadot/types" "11.0.3" + "@polkadot/types-codec" "11.0.3" + "@polkadot/types-create" "11.0.3" + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/types-support@11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-11.0.3.tgz#c7b916870c8c79225453747155506ca0b984434a" + integrity sha512-U9EG48zbbx5Q8B3GgHav8+/8hNYDOTijvSnEhUWsshh8U0Z7sNCmjfD4y0zfEzxoJyP7PTad62lJXfhQtehEsQ== + dependencies: + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/types@11.0.3", "@polkadot/types@^11.0.3": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-11.0.3.tgz#6c3dbe2a7eb919758ecdcd238e97a1717a96fc52" + integrity sha512-7AGUaObaGKZntOzHX4IRKj+K1AjZpYBgrivnY73tqGCp7biByn8Ht6a74xFngGfay1yRrx7eS3NOeIpp4nKhrw== + dependencies: + "@polkadot/keyring" "^12.6.2" + "@polkadot/types-augment" "11.0.3" + "@polkadot/types-codec" "11.0.3" + "@polkadot/types-create" "11.0.3" + "@polkadot/util" "^12.6.2" + "@polkadot/util-crypto" "^12.6.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/util-crypto@12.6.2", "@polkadot/util-crypto@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-12.6.2.tgz#d2d51010e8e8ca88951b7d864add797dad18bbfc" + integrity sha512-FEWI/dJ7wDMNN1WOzZAjQoIcCP/3vz3wvAp5QQm+lOrzOLj0iDmaIGIcBkz8HVm3ErfSe/uKP0KS4jgV/ib+Mg== + dependencies: + "@noble/curves" "^1.3.0" + "@noble/hashes" "^1.3.3" + "@polkadot/networks" "12.6.2" + "@polkadot/util" "12.6.2" + "@polkadot/wasm-crypto" "^7.3.2" + "@polkadot/wasm-util" "^7.3.2" + "@polkadot/x-bigint" "12.6.2" + "@polkadot/x-randomvalues" "12.6.2" + "@scure/base" "^1.1.5" + tslib "^2.6.2" + +"@polkadot/util@12.6.2", "@polkadot/util@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-12.6.2.tgz#9396eff491221e1f0fd28feac55fc16ecd61a8dc" + integrity sha512-l8TubR7CLEY47240uki0TQzFvtnxFIO7uI/0GoWzpYD/O62EIAMRsuY01N4DuwgKq2ZWD59WhzsLYmA5K6ksdw== + dependencies: + "@polkadot/x-bigint" "12.6.2" + "@polkadot/x-global" "12.6.2" + "@polkadot/x-textdecoder" "12.6.2" + "@polkadot/x-textencoder" "12.6.2" + "@types/bn.js" "^5.1.5" + bn.js "^5.2.1" + tslib "^2.6.2" + +"@polkadot/wasm-bridge@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-7.3.2.tgz#e1b01906b19e06cbca3d94f10f5666f2ae0baadc" + integrity sha512-AJEXChcf/nKXd5Q/YLEV5dXQMle3UNT7jcXYmIffZAo/KI394a+/24PaISyQjoNC0fkzS1Q8T5pnGGHmXiVz2g== + dependencies: + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-crypto-asmjs@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-7.3.2.tgz#c6d41bc4b48b5359d57a24ca3066d239f2d70a34" + integrity sha512-QP5eiUqUFur/2UoF2KKKYJcesc71fXhQFLT3D4ZjG28Mfk2ZPI0QNRUfpcxVQmIUpV5USHg4geCBNuCYsMm20Q== + dependencies: + tslib "^2.6.2" + +"@polkadot/wasm-crypto-init@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-7.3.2.tgz#7e1fe79ba978fb0a4a0f74a92d976299d38bc4b8" + integrity sha512-FPq73zGmvZtnuJaFV44brze3Lkrki3b4PebxCy9Fplw8nTmisKo9Xxtfew08r0njyYh+uiJRAxPCXadkC9sc8g== + dependencies: + "@polkadot/wasm-bridge" "7.3.2" + "@polkadot/wasm-crypto-asmjs" "7.3.2" + "@polkadot/wasm-crypto-wasm" "7.3.2" + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-crypto-wasm@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-7.3.2.tgz#44e08ed5cf6499ce4a3aa7247071a5d01f6a74f4" + integrity sha512-15wd0EMv9IXs5Abp1ZKpKKAVyZPhATIAHfKsyoWCEFDLSOA0/K0QGOxzrAlsrdUkiKZOq7uzSIgIDgW8okx2Mw== + dependencies: + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-crypto@^7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-7.3.2.tgz#61bbcd9e591500705c8c591e6aff7654bdc8afc9" + integrity sha512-+neIDLSJ6jjVXsjyZ5oLSv16oIpwp+PxFqTUaZdZDoA2EyFRQB8pP7+qLsMNk+WJuhuJ4qXil/7XiOnZYZ+wxw== + dependencies: + "@polkadot/wasm-bridge" "7.3.2" + "@polkadot/wasm-crypto-asmjs" "7.3.2" + "@polkadot/wasm-crypto-init" "7.3.2" + "@polkadot/wasm-crypto-wasm" "7.3.2" + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-util@7.3.2", "@polkadot/wasm-util@^7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-7.3.2.tgz#4fe6370d2b029679b41a5c02cd7ebf42f9b28de1" + integrity sha512-bmD+Dxo1lTZyZNxbyPE380wd82QsX+43mgCm40boyKrRppXEyQmWT98v/Poc7chLuskYb6X8IQ6lvvK2bGR4Tg== + dependencies: + tslib "^2.6.2" + +"@polkadot/x-bigint@12.6.2", "@polkadot/x-bigint@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-12.6.2.tgz#59b7a615f205ae65e1ac67194aefde94d3344580" + integrity sha512-HSIk60uFPX4GOFZSnIF7VYJz7WZA7tpFJsne7SzxOooRwMTWEtw3fUpFy5cYYOeLh17/kHH1Y7SVcuxzVLc74Q== + dependencies: + "@polkadot/x-global" "12.6.2" + tslib "^2.6.2" + +"@polkadot/x-fetch@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-12.6.2.tgz#b1bca028db90263bafbad2636c18d838d842d439" + integrity sha512-8wM/Z9JJPWN1pzSpU7XxTI1ldj/AfC8hKioBlUahZ8gUiJaOF7K9XEFCrCDLis/A1BoOu7Ne6WMx/vsJJIbDWw== + dependencies: + "@polkadot/x-global" "12.6.2" + node-fetch "^3.3.2" + tslib "^2.6.2" + +"@polkadot/x-global@12.6.2", "@polkadot/x-global@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-12.6.2.tgz#31d4de1c3d4c44e4be3219555a6d91091decc4ec" + integrity sha512-a8d6m+PW98jmsYDtAWp88qS4dl8DyqUBsd0S+WgyfSMtpEXu6v9nXDgPZgwF5xdDvXhm+P0ZfVkVTnIGrScb5g== + dependencies: + tslib "^2.6.2" + +"@polkadot/x-randomvalues@12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-12.6.2.tgz#13fe3619368b8bf5cb73781554859b5ff9d900a2" + integrity sha512-Vr8uG7rH2IcNJwtyf5ebdODMcr0XjoCpUbI91Zv6AlKVYOGKZlKLYJHIwpTaKKB+7KPWyQrk4Mlym/rS7v9feg== + dependencies: + "@polkadot/x-global" "12.6.2" + tslib "^2.6.2" + +"@polkadot/x-textdecoder@12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-12.6.2.tgz#b86da0f8e8178f1ca31a7158257e92aea90b10e4" + integrity sha512-M1Bir7tYvNappfpFWXOJcnxUhBUFWkUFIdJSyH0zs5LmFtFdbKAeiDXxSp2Swp5ddOZdZgPac294/o2TnQKN1w== + dependencies: + "@polkadot/x-global" "12.6.2" + tslib "^2.6.2" + +"@polkadot/x-textencoder@12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-12.6.2.tgz#81d23bd904a2c36137a395c865c5fefa21abfb44" + integrity sha512-4N+3UVCpI489tUJ6cv3uf0PjOHvgGp9Dl+SZRLgFGt9mvxnvpW/7+XBADRMtlG4xi5gaRK7bgl5bmY6OMDsNdw== + dependencies: + "@polkadot/x-global" "12.6.2" + tslib "^2.6.2" + +"@polkadot/x-ws@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-12.6.2.tgz#b99094d8e53a03be1de903d13ba59adaaabc767a" + integrity sha512-cGZWo7K5eRRQCRl2LrcyCYsrc3lRbTlixZh3AzgU8uX4wASVGRlNWi/Hf4TtHNe1ExCDmxabJzdIsABIfrr7xw== + dependencies: + "@polkadot/x-global" "12.6.2" + tslib "^2.6.2" + ws "^8.15.1" + +"@scure/base@^1.1.1", "@scure/base@^1.1.5": + version "1.1.6" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.6.tgz#8ce5d304b436e4c84f896e0550c83e4d88cb917d" + integrity sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g== "@scure/base@~1.1.0", "@scure/base@~1.1.4": version "1.1.5" @@ -1410,32 +1457,43 @@ dependencies: antlr4ts "^0.5.0-alpha.4" -"@substrate/connect-extension-protocol@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-1.0.1.tgz#fa5738039586c648013caa6a0c95c43265dbe77d" - integrity sha512-161JhCC1csjH3GE5mPLEd7HbWtwNSPJBg3p1Ksz9SFlTzj/bgEwudiRN2y5i0MoLGCIJRYKyKGMxVnd29PzNjg== +"@substrate/connect-extension-protocol@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-2.0.0.tgz#badaa6e6b5f7c7d56987d778f4944ddb83cd9ea7" + integrity sha512-nKu8pDrE3LNCEgJjZe1iGXzaD6OSIDD4Xzz/yo4KO9mQ6LBvf49BVrt4qxBFGL6++NneLiWUZGoh+VSd4PyVIg== -"@substrate/connect@0.7.19": - version "0.7.19" - resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.19.tgz#7c879cb275bc7ac2fe9edbf797572d4ff8d8b86a" - integrity sha512-+DDRadc466gCmDU71sHrYOt1HcI2Cbhm7zdCFjZfFVHXhC/E8tOdrVSglAH2HDEHR0x2SiHRxtxOGC7ak2Zjog== - dependencies: - "@substrate/connect-extension-protocol" "^1.0.1" - "@substrate/smoldot-light" "0.7.9" - eventemitter3 "^4.0.7" +"@substrate/connect-known-chains@^1.1.4": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@substrate/connect-known-chains/-/connect-known-chains-1.1.4.tgz#1b0b4b19c7bd0c1b3ed6f567a22e9fb9c42b8e64" + integrity sha512-iT+BdKqvKl/uBLd8BAJysFM1BaMZXRkaXBP2B7V7ob/EyNs5h0EMhTVbO6MJxV/IEOg5OKsyl6FUqQK7pKnqyw== -"@substrate/smoldot-light@0.7.9": - version "0.7.9" - resolved "https://registry.yarnpkg.com/@substrate/smoldot-light/-/smoldot-light-0.7.9.tgz#68449873a25558e547e9468289686ee228a9930f" - integrity sha512-HP8iP7sFYlpSgjjbo0lqHyU+gu9lL2hbDNce6dWk5/10mFFF9jKIFGfui4zCecUY808o/Go9pan/31kMJoLbug== +"@substrate/connect@0.8.10": + version "0.8.10" + resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.8.10.tgz#810b6589f848828aa840c731a1f36b84fe0e5956" + integrity sha512-DIyQ13DDlXqVFnLV+S6/JDgiGowVRRrh18kahieJxhgvzcWicw5eLc6jpfQ0moVVLBYkO7rctB5Wreldwpva8w== dependencies: - pako "^2.0.4" - ws "^8.8.1" + "@substrate/connect-extension-protocol" "^2.0.0" + "@substrate/connect-known-chains" "^1.1.4" + "@substrate/light-client-extension-helpers" "^0.0.6" + smoldot "2.0.22" -"@substrate/ss58-registry@^1.38.0": - version "1.46.0" - resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.46.0.tgz#bfe3e6a30d39929f57ecc178acde4e74a773e2b6" - integrity sha512-rBvWnlrBeFTd5LVG7oX3rOHzR16yqyffOFHKmUiVcblpXI3D89CXOvAljW9tWlA1H/2/FegaZnHPhdObPsvi+w== +"@substrate/light-client-extension-helpers@^0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@substrate/light-client-extension-helpers/-/light-client-extension-helpers-0.0.6.tgz#bec1c7997241226db50b44ad85a992b4348d21c3" + integrity sha512-girltEuxQ1BvkJWmc8JJlk4ZxnlGXc/wkLcNguhY+UoDEMBK0LsdtfzQKIfrIehi4QdeSBlFEFBoI4RqPmsZzA== + dependencies: + "@polkadot-api/json-rpc-provider" "0.0.1" + "@polkadot-api/json-rpc-provider-proxy" "0.0.1" + "@polkadot-api/observable-client" "0.1.0" + "@polkadot-api/substrate-client" "0.0.1" + "@substrate/connect-extension-protocol" "^2.0.0" + "@substrate/connect-known-chains" "^1.1.4" + rxjs "^7.8.1" + +"@substrate/ss58-registry@^1.44.0": + version "1.47.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.47.0.tgz#99b11fd3c16657f5eae483b3df7c545ca756d1fc" + integrity sha512-6kuIJedRcisUJS2pgksEH2jZf3hfSIVzqtFzs/AyjTW3ETbMg5q1Bb7VWa0WYaT6dTrEXp/6UoXM5B9pSIUmcw== "@szmarczak/http-timer@^4.0.5": version "4.0.6" @@ -1515,7 +1573,7 @@ dependencies: "@types/node" "*" -"@types/bn.js@^5.1.0", "@types/bn.js@^5.1.1": +"@types/bn.js@^5.1.0", "@types/bn.js@^5.1.1", "@types/bn.js@^5.1.5": version "5.1.5" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.5.tgz#2e0dacdcce2c0f16b905d20ff87aedbc6f7b4bf0" integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A== @@ -1605,14 +1663,6 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.6.tgz#818551d39113081048bdddbef96701b4e8bb9d1b" integrity sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg== -"@types/node-fetch@^2.6.2": - version "2.6.11" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.11.tgz#9b39b78665dae0e82a08f02f4967d62c66f95d24" - integrity sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g== - dependencies: - "@types/node" "*" - form-data "^4.0.0" - "@types/node@*": version "20.11.7" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.7.tgz#cb49aedd758c978c30806d0c38b520ed2a3df6e0" @@ -1684,13 +1734,6 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339" integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A== -"@types/websocket@^1.0.5": - version "1.0.10" - resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.10.tgz#804b1a02780da522f5742bc184a6d16a2eb78c7c" - integrity sha512-svjGZvPB7EzuYS94cI7a+qhwgGU1y89wUgjT6E2wVUfmAGIvRfT7obBvRtnhXCSsoMdlG4gBFGE7MfkIXZLoww== - dependencies: - "@types/node" "*" - "@typescript-eslint/eslint-plugin@^5.44.0": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz#aeef0328d172b9e37d9bab6dbc13b87ed88977db" @@ -2938,13 +2981,6 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -ed2curve@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/ed2curve/-/ed2curve-0.3.0.tgz#322b575152a45305429d546b071823a93129a05d" - integrity sha512-8w2fmmq3hv9rCrcI7g9hms2pMunQr1JINfcjwR9tAyZqhtyaMN991lF/ZfHfr5tzZQ8c7y7aBgZbjfbd0fjFwQ== - dependencies: - tweetnacl "1.x.x" - ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -3381,12 +3417,7 @@ eventemitter3@4.0.4: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" integrity sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ== -eventemitter3@^4.0.7: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -eventemitter3@^5.0.0: +eventemitter3@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== @@ -4895,7 +4926,7 @@ mock-fs@^4.1.0: resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.14.0.tgz#ce5124d2c601421255985e6e94da80a7357b1b18" integrity sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw== -mock-socket@^9.2.1: +mock-socket@^9.3.1: version "9.3.1" resolved "https://registry.yarnpkg.com/mock-socket/-/mock-socket-9.3.1.tgz#24fb00c2f573c84812aa4a24181bb025de80cc8e" integrity sha512-qxBgB7Qa2sEQgHFjj0dSigq7fX4k6Saisd5Nelwp2q8mlbAFh5dHV9JTTlF8viYJLSSWgMCZFUom8PJcMNBoJw== @@ -5005,10 +5036,10 @@ next-tick@^1.1.0: resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== -nock@^13.3.0: - version "13.5.0" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.5.0.tgz#82cd33b0dba6095d3f5a28d0ff2edac970fa05ec" - integrity sha512-9hc1eCS2HtOz+sE9W7JQw/tXJktg0zoPSu48s/pYe73e25JW9ywiowbqnUSd7iZPeVawLcVpPZeZS312fwSY+g== +nock@^13.5.0: + version "13.5.4" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.5.4.tgz#8918f0addc70a63736170fef7106a9721e0dc479" + integrity sha512-yAyTfdeNJGGBFxWdzSKCBYxs5FxLbCg5X5Q4ets974hcQzG1+qCxvIyOo4j2Ry6MUlhWVMX4OoYDefAIIwupjw== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1" @@ -5038,7 +5069,7 @@ node-fetch@^2.6.12: dependencies: whatwg-url "^5.0.0" -node-fetch@^3.3.0: +node-fetch@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== @@ -5235,11 +5266,6 @@ p-try@^1.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== -pako@^2.0.4: - version "2.1.0" - resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" - integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -5519,11 +5545,6 @@ reduce-flatten@^2.0.0: resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== -regenerator-runtime@^0.14.0: - version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" - integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== - req-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/req-cwd/-/req-cwd-2.0.0.tgz#d4082b4d44598036640fb73ddea01ed53db49ebc" @@ -5709,7 +5730,7 @@ rustbn.js@~0.2.0: resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== -rxjs@^7.8.0: +rxjs@^7.8.1: version "7.8.1" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== @@ -5751,6 +5772,11 @@ sc-istanbul@^0.4.5: which "^1.1.1" wordwrap "^1.0.0" +scale-ts@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/scale-ts/-/scale-ts-1.6.0.tgz#e9641093c5a9e50f964ddb1607139034e3e932e9" + integrity sha512-Ja5VCjNZR8TGKhUumy9clVVxcDpM+YFjAnkMuwQy68Hixio3VRRvWdE3g8T/yC+HXA0ZDQl2TGyUmtmbcVl40Q== + scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" @@ -5936,6 +5962,13 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" +smoldot@2.0.22: + version "2.0.22" + resolved "https://registry.yarnpkg.com/smoldot/-/smoldot-2.0.22.tgz#1e924d2011a31c57416e79a2b97a460f462a31c7" + integrity sha512-B50vRgTY6v3baYH6uCgL15tfaag5tcS2o/P5q1OiXcKGv1axZDfz2dzzMuIkVpyMR2ug11F6EAtQlmYBQd292g== + dependencies: + ws "^8.8.1" + solc@0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" @@ -6315,7 +6348,7 @@ tslib@^1.8.1, tslib@^1.9.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.1.0: +tslib@^2.1.0, tslib@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== @@ -6344,16 +6377,16 @@ tweetnacl-util@^0.15.1: resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== -tweetnacl@1.x.x, tweetnacl@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== +tweetnacl@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -6923,6 +6956,11 @@ ws@^7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== +ws@^8.15.1: + version "8.17.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.0.tgz#d145d18eca2ed25aaf791a183903f7be5e295fea" + integrity sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow== + ws@^8.8.1: version "8.16.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4" diff --git a/pallet/assets-ext/rpc/README.md b/pallet/assets-ext/rpc/README.md index e1953bb1b..b1c0ce26f 100644 --- a/pallet/assets-ext/rpc/README.md +++ b/pallet/assets-ext/rpc/README.md @@ -38,7 +38,7 @@ Returns the free balance of asset and user. curl -X POST \ -H "Content-Type: application/json" \ -d '{"id":1, "jsonrpc":"2.0", "method":"assetsExt_freeBalance", "params":[2, "0x25451A4de12dcCc2D166922fA938E900fCc4ED24"]}' \ - http://localhost:9933 + http://127.0.0.1:9944 ``` **_Response (successful)_** @@ -57,7 +57,7 @@ For ROOT curl -X POST \ -H "Content-Type: application/json" \ -d '{"id":1, "jsonrpc":"2.0", "method":"assetsExt_freeBalance", "params":[1, "0xE04CC55ebEE1cBCE552f250e85c57B70B2E2625b"]}' \ - http://localhost:9933 + http://127.0.0.1:9944 ``` **_Response (successful)_** diff --git a/pallet/dex/rpc/README.md b/pallet/dex/rpc/README.md index ca41146ac..284f51e13 100644 --- a/pallet/dex/rpc/README.md +++ b/pallet/dex/rpc/README.md @@ -46,7 +46,7 @@ Returns the amount of output token that can be obtained by swapping an amount of curl -X POST \ -H "Content-Type: application/json" \ -d '{"id":1, "jsonrpc":"2.0", "method":"dex_quote", "params":[ 1, 5, 10 ]}' \ - http://localhost:9933 + http://127.0.0.1:9944 ``` **_Response (successful)_** @@ -95,7 +95,7 @@ Returns the amount of output tokens that you would receive if you sent an amount curl -X POST \ -H "Content-Type: application/json" \ -d '{"id":1, "jsonrpc":"2.0", "method": "dex_getAmountsOut", "params": [1000000000000, [2, 1124]]}' \ - http://localhost:9933 + http://127.0.0.1:9944 ``` **_Response (error)_** @@ -152,7 +152,7 @@ Returns the amount of input token that you would need to send to the DEX in orde curl -X POST \ -H "Content-Type: application/json" \ -d '{"id":1, "jsonrpc":"2.0", "method": "dex_getAmountsIn", "params": [1000000000000, [2, 1124]]}' \ - http://localhost:9933 + http://127.0.0.1:9944 ``` **_Response (error)_** @@ -207,7 +207,7 @@ Returns the LP token ID from the given trading pair. curl -X POST \ -H "Content-Type: application/json" \ -d '{"id":1, "jsonrpc":"2.0", "method": "dex_getLPTokenID", "params": [2, 1124]}' \ - http://localhost:9933 + http://127.0.0.1:9944 ``` **_Response (successful)_** @@ -254,7 +254,7 @@ Returns the liquidity balances of the given trading pair. curl -X POST \ -H "Content-Type: application/json" \ -d '{"id":1, "jsonrpc":"2.0", "method": "dex_getLiquidity", "params": [2, 1124]}' \ - http://localhost:9933 + http://127.0.0.1:9944 ``` **_Response (successful)_** @@ -301,7 +301,7 @@ Returns the status of the given trading pair. curl -X POST \ -H "Content-Type: application/json" \ -d '{"id":1, "jsonrpc":"2.0", "method": "dex_getTradingPairStatus", "params": [2, 1124]}' \ - http://localhost:9933 + http://127.0.0.1:9944 ``` **_Response (successful)_** diff --git a/pallet/dex/src/types.rs b/pallet/dex/src/types.rs index 1edc334eb..9aedbd00a 100644 --- a/pallet/dex/src/types.rs +++ b/pallet/dex/src/types.rs @@ -44,7 +44,8 @@ impl TradingPair { /// Returns the pool address for this trading pair /// Spec: - /// `0xdddddddd` + <8-byte-asset_a-padded> + `00000000` + `dddddddd` + <8-byte-asset_b-padded> + /// `0xdddddddd` + <4-byte-asset_a-padded> + <4-byte-asset_b-padded> + `0000000000000000` (8 + /// bytes) pub fn pool_address>(&self) -> AccountId { let asset_a_bytes = self.0.to_be_bytes(); let asset_b_bytes = self.1.to_be_bytes(); diff --git a/pallet/ethy/src/ethereum_http_cli.rs b/pallet/ethy/src/ethereum_http_cli.rs index 654bb7f12..3153dec95 100644 --- a/pallet/ethy/src/ethereum_http_cli.rs +++ b/pallet/ethy/src/ethereum_http_cli.rs @@ -107,7 +107,7 @@ impl EthereumRpcClient { fn query_eth_client(request_body: R) -> Result, BridgeRpcError> { // Load eth http URI from offchain storage // this should have been configured on start up by passing e.g. `--eth-http` - // e.g. `--eth-http=http://localhost:8545` + // e.g. `--eth-http=http://127.0.0.1:8545` let eth_http_uri = if let Some(value) = sp_io::offchain::local_storage_get(StorageKind::PERSISTENT, Ð_HTTP_URI) {