From a25b21a0d2a9515c0fa73e986581e49f1f08185a Mon Sep 17 00:00:00 2001 From: Boldizsar Mezei Date: Tue, 10 Oct 2023 22:34:08 +0200 Subject: [PATCH] TargetAddress on token trade otr Fixes Fixes --- ...ions_tangle-online-unit-tests_emulator.yml | 453 ++++++++++++------ .../workflows/functions_tangle-unit-tests.yml | 360 ++++++++------ packages/api/package.json | 3 +- packages/functions/package.json | 2 +- .../token-trading/token-trade.controller.ts | 1 + .../token/TokenTradeTangleRequestSchema.ts | 3 + .../token/token-trade.service.ts | 31 +- .../services/payment/token/token-service.ts | 5 +- .../src/services/wallet/IotaWalletService.ts | 4 +- .../functions/src/services/wallet/wallet.ts | 2 +- .../token-trading/match-base-token.ts | 7 +- .../token-trading/match-minted-token.ts | 30 +- .../base-token-trading_11_a.spec.ts | 96 ++++ ...pec.ts => base-token-trading_11_b.spec.ts} | 169 +++---- .../base-token-trading_11_c.spec.ts | 94 ++++ .../base-token-trading_11_d.spec.ts | 103 ++++ .../base-token-trading_12.spec.ts | 51 +- .../base-token-trading_13.spec.ts | 93 ++++ ...y.spec.ts => base-token-trading_8.spec.ts} | 3 - ...y.spec.ts => base-token-trading_9.spec.ts} | 3 - .../metadata-nft/mint-metadata-nft_3.spec.ts | 192 ++++---- .../mint-metadata-nft_3_b.spec.ts | 129 +++++ .../minted-token-airdrop_1_a.spec.ts | 198 ++++++++ ...ec.ts => minted-token-airdrop_1_b.spec.ts} | 86 +--- .../minted-token-airdrop_1_c.spec.ts | 116 +++++ .../minted-token-trade_19.spec.ts | 111 +++++ .../src/api/tangle/TokenTradeTangleRequest.ts | 4 + packages/interfaces/src/errors.ts | 1 + packages/interfaces/src/models/token.ts | 4 + .../src/models/transaction/payload.ts | 2 + 30 files changed, 1697 insertions(+), 659 deletions(-) create mode 100644 packages/functions/test-tangle/base-token-trading/base-token-trading_11_a.spec.ts rename packages/functions/test-tangle/base-token-trading/{base-token-trading_11.only.spec.ts => base-token-trading_11_b.spec.ts} (63%) create mode 100644 packages/functions/test-tangle/base-token-trading/base-token-trading_11_c.spec.ts create mode 100644 packages/functions/test-tangle/base-token-trading/base-token-trading_11_d.spec.ts create mode 100644 packages/functions/test-tangle/base-token-trading/base-token-trading_13.spec.ts rename packages/functions/test-tangle/base-token-trading/{base-token-trading_8.only.spec.ts => base-token-trading_8.spec.ts} (94%) rename packages/functions/test-tangle/base-token-trading/{base-token-trading_9.only.spec.ts => base-token-trading_9.spec.ts} (94%) create mode 100644 packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3_b.spec.ts create mode 100644 packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_a.spec.ts rename packages/functions/test-tangle/minted-token-airdrop/{minted-token-airdrop_1.spec.ts => minted-token-airdrop_1_b.spec.ts} (68%) create mode 100644 packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.spec.ts create mode 100644 packages/functions/test-tangle/minted-token-trade/minted-token-trade_19.spec.ts diff --git a/.github/workflows/functions_tangle-online-unit-tests_emulator.yml b/.github/workflows/functions_tangle-online-unit-tests_emulator.yml index 7404a520dd..d7f8860ca1 100644 --- a/.github/workflows/functions_tangle-online-unit-tests_emulator.yml +++ b/.github/workflows/functions_tangle-online-unit-tests_emulator.yml @@ -278,7 +278,7 @@ jobs: firebase emulators:exec " npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_1.spec.ts && npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_10.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_12.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_11_a.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -313,9 +313,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_3.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_4.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_11_b.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_11_c.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_11_d.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -350,9 +350,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_5.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_6.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_7.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_12.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_13.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -387,9 +387,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_1.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_10.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_11.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_4.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -424,9 +424,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_12.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_3.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_6.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_7.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_8.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -461,9 +461,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_5.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_6.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_9.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_1.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_10.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -498,9 +498,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_7.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_8.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_9.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_11.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_12.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -535,9 +535,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_1_b.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_1.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_2.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -572,9 +572,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_4.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_5_b.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_6.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_7.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_8.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -609,9 +609,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_5.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_6.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_7.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_9.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_1_b.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_1.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -646,9 +646,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_1_b.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_1.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_10.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_3_b.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -683,9 +683,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_3.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_4.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_4.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_5_b.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -720,9 +720,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_5.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_6.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_7.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_6.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_7.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_1_b.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -757,9 +757,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_8.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_1.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_2.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_1.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_10.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -794,9 +794,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_4.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_5.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_1.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_4.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -831,9 +831,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_3.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_4.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_6.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_7.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_8.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -868,9 +868,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_5.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_6.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_7.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_1_a.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_1_b.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -905,9 +905,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_1.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_10.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_11.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_4.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -942,9 +942,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_12_b.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_12.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_13.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_1.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_3.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -979,9 +979,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_14_b.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_14.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_16.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_4.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_5.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_6.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1016,9 +1016,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_17.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_18.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_2.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_7.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_1.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_10.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1053,9 +1053,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_3.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_4.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_5.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_11.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_12_b.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_12.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1090,9 +1090,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_6.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_7.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_8.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_13.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_14_b.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_14.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1127,9 +1127,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_9.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_1.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_2.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_16.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_17.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_18.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1164,9 +1164,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_3.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_4.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_1.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_19.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_3.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1201,9 +1201,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_3.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_1.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_4.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_5.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_6.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1238,9 +1238,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_2_b.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_3.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_7.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_8.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_9.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1275,9 +1275,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_4.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_5.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_6.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_1.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_3.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1312,9 +1312,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_7.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_8.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.approval.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_4.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_1.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1349,9 +1349,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.create.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.simple.vote.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.stake.voting.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_1.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_2_b.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1386,9 +1386,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.token.voting.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.accept.member.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.block.member.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_4.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1423,9 +1423,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.create.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.decline.member.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.edit.guardian.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_5.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_6.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_7.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1460,9 +1460,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.join.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.leave.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_1.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_8.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.approval.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.create.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1497,9 +1497,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_3.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_4.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.simple.vote.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.stake.voting.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.token.voting.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1534,9 +1534,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_5.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/tangleRequest/simple.token.trade.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/tangleRequest/tangle-request.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.accept.member.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.block.member.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.create.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1571,9 +1571,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token-import/token.import_1.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token-import/token.import_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/stake.voting.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.decline.member.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.edit.guardian.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.join.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1608,9 +1608,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_1.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_3.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.leave.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_1.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1645,9 +1645,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_4.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_5.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_1.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_4.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1682,9 +1682,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_3.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_4.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/tangleRequest/simple.token.trade.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/tangleRequest/tangle-request.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token-import/token.import_1.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1719,9 +1719,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/trade-base-token-order.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/tran.match.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_1.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token-import/token.import_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/stake.voting.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_1.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1756,9 +1756,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_10.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_11.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_12.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_4.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1793,9 +1793,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_13.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_3.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_5.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_1.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1830,9 +1830,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_4.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_5.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_6.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_4.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/trade-base-token-order.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1867,9 +1867,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_7.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_8.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_9.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/tran.match.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_1.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_10.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1904,9 +1904,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_1.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_3.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_11.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_12.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_13.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1941,9 +1941,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_a.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_b.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_c.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_4.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1978,9 +1978,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_1.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_3.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_5.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_6.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_7.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2015,9 +2015,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_11.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_a.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_b.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_8.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_9.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_1.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2052,9 +2052,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_13.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_14.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_2.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_a.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2089,9 +2089,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4_b.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_5.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_b.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_c.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_1.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2126,9 +2126,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_6.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_7.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_8.spec.ts + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_11.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2163,7 +2163,154 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_9.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_a.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_b.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_13.spec.ts + " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data + - name: Archive firestore data + uses: actions/upload-artifact@v3 + if: ${{ failure() }} + with: + name: firestore-data-test-tangle-online-chunk_57 + path: ./packages/functions/firestore-data/ + retention-days: 1 + chunk_58: + needs: npm-install + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - uses: actions/cache@v3 + with: + path: | + node_modules + packages/functions/node_modules + packages/interfaces/node_modules + key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }} + - name: Init + run: | + npm run build:functions + npm install -g firebase-tools + - name: Test + working-directory: packages/functions + run: | + export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" + npm run milestone-sync & + firebase emulators:exec " + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_14.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4_b.spec.ts + " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data + - name: Archive firestore data + uses: actions/upload-artifact@v3 + if: ${{ failure() }} + with: + name: firestore-data-test-tangle-online-chunk_58 + path: ./packages/functions/firestore-data/ + retention-days: 1 + chunk_59: + needs: npm-install + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - uses: actions/cache@v3 + with: + path: | + node_modules + packages/functions/node_modules + packages/interfaces/node_modules + key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }} + - name: Init + run: | + npm run build:functions + npm install -g firebase-tools + - name: Test + working-directory: packages/functions + run: | + export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" + npm run milestone-sync & + firebase emulators:exec " + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_5.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_6.spec.ts + " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data + - name: Archive firestore data + uses: actions/upload-artifact@v3 + if: ${{ failure() }} + with: + name: firestore-data-test-tangle-online-chunk_59 + path: ./packages/functions/firestore-data/ + retention-days: 1 + chunk_60: + needs: npm-install + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - uses: actions/cache@v3 + with: + path: | + node_modules + packages/functions/node_modules + packages/interfaces/node_modules + key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }} + - name: Init + run: | + npm run build:functions + npm install -g firebase-tools + - name: Test + working-directory: packages/functions + run: | + export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" + npm run milestone-sync & + firebase emulators:exec " + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_7.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_8.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_9.spec.ts + " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data + - name: Archive firestore data + uses: actions/upload-artifact@v3 + if: ${{ failure() }} + with: + name: firestore-data-test-tangle-online-chunk_60 + path: ./packages/functions/firestore-data/ + retention-days: 1 + chunk_61: + needs: npm-install + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - uses: actions/cache@v3 + with: + path: | + node_modules + packages/functions/node_modules + packages/interfaces/node_modules + key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }} + - name: Init + run: | + npm run build:functions + npm install -g firebase-tools + - name: Test + working-directory: packages/functions + run: | + export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" + npm run milestone-sync & + firebase emulators:exec " npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/workflow-online.spec.ts && npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/workflow.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data @@ -2171,6 +2318,6 @@ jobs: uses: actions/upload-artifact@v3 if: ${{ failure() }} with: - name: firestore-data-test-tangle-online-chunk_57 + name: firestore-data-test-tangle-online-chunk_61 path: ./packages/functions/firestore-data/ retention-days: 1 diff --git a/.github/workflows/functions_tangle-unit-tests.yml b/.github/workflows/functions_tangle-unit-tests.yml index e2a1a7b15c..6829acb82f 100644 --- a/.github/workflows/functions_tangle-unit-tests.yml +++ b/.github/workflows/functions_tangle-unit-tests.yml @@ -276,7 +276,7 @@ jobs: firebase emulators:exec " npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_1.spec.ts && npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_10.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_12.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_11_a.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -311,9 +311,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_3.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_4.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_11_b.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_11_c.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_11_d.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -348,9 +348,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_5.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_6.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_7.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_12.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_13.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -385,9 +385,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_1.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_10.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_11.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_4.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -422,9 +422,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_12.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_3.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_6.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_7.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_8.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -459,9 +459,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_5.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_6.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_9.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_1.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_10.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -496,9 +496,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_7.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_8.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_9.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_11.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_12.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -533,9 +533,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_1_b.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_1.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_2.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -570,9 +570,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_4.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_5_b.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_6.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_7.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_8.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -607,9 +607,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_5.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_6.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_7.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_9.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_1_b.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_1.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -644,9 +644,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_1_b.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_1.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_10.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_3_b.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -681,9 +681,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_3.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_4.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_4.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_5_b.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -718,9 +718,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_5.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_6.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_7.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_6.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/metadata-nft/mint-metadata-nft_7.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_1_b.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -755,9 +755,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_8.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_1.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_2.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_1.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_10.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -792,9 +792,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_4.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_5.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_1.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_4.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -829,9 +829,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_3.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_4.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_6.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_7.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_8.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -866,9 +866,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_5.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_6.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_7.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_1_a.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_1_b.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -903,9 +903,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_1.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_10.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_11.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_4.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -940,9 +940,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_12_b.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_12.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_13.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_1.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_3.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -977,9 +977,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_14_b.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_14.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_16.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_4.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_5.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_6.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1014,9 +1014,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_17.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_18.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_2.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-claim/token.claim.minted_7.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_1.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_10.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1051,9 +1051,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_3.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_4.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_5.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_11.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_12_b.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_12.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1088,9 +1088,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_6.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_7.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_8.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_13.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_14_b.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_14.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1125,9 +1125,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_9.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_1.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_2.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_16.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_17.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_18.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1162,9 +1162,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_3.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_4.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_1.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_19.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_3.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1199,9 +1199,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_3.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_1.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_4.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_5.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_6.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1236,9 +1236,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_2_b.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_3.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_7.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_8.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_9.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1273,9 +1273,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_4.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_5.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_6.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_1.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_3.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1310,9 +1310,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_7.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_8.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.approval.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-bid/nft-bid.otr_4.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_1.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1347,9 +1347,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.create.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.simple.vote.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.stake.voting.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-set-for-sale/nft-set-for-sale_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_1.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_2_b.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1384,9 +1384,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.token.voting.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.accept.member.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.block.member.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_4.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1421,9 +1421,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.create.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.decline.member.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.edit.guardian.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_5.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_6.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_7.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1458,9 +1458,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.join.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.leave.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_1.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/nft-staking/nft-staking_8.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.approval.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.create.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1495,9 +1495,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_3.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_4.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.simple.vote.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.stake.voting.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.token.voting.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1532,9 +1532,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_5.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/tangleRequest/simple.token.trade.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/tangleRequest/tangle-request.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.accept.member.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.block.member.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.create.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1569,9 +1569,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token-import/token.import_1.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token-import/token.import_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/stake.voting.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.decline.member.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.edit.guardian.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.join.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1606,9 +1606,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_1.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_3.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.leave.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_1.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1643,9 +1643,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_4.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_5.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_1.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_4.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_5.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1680,9 +1680,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_3.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_4.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/tangleRequest/simple.token.trade.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/tangleRequest/tangle-request.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token-import/token.import_1.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1717,9 +1717,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/trade-base-token-order.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/tran.match.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_1.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token-import/token.import_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/stake.voting.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_1.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1754,9 +1754,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_10.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_11.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_12.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_4.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1791,9 +1791,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_13.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_3.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_5.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_1.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_2.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1828,9 +1828,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_4.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_5.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_6.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_4.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/trade-base-token-order.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1865,9 +1865,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_7.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_8.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_9.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/tran.match.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_1.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_10.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1902,9 +1902,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_1.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_3.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_11.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_12.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_13.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1939,9 +1939,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_a.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_b.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_c.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_4.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -1976,9 +1976,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_1.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_3.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_5.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_6.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_7.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2013,9 +2013,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_11.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_a.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_b.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_8.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/transaction-trigger/transaction-trigger_9.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_1.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2050,9 +2050,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_13.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_14.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_2.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/web3/web3_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_a.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2087,9 +2087,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4_b.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_5.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_b.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_1_c.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_1.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2124,9 +2124,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_6.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_7.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_8.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_10_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_11.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2161,9 +2161,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_9.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/workflow-online.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/workflow.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_a.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_12_b.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_13.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2198,7 +2198,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_11.only.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_14.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4_b.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2233,7 +2235,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_8.only.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_4.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_5.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_6.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2268,7 +2272,9 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_9.only.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_7.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_8.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/withdraw-deposit-nft/deposit-withraw-nft_9.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2303,7 +2309,8 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_11.only.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/workflow-online.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/workflow.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2338,7 +2345,7 @@ jobs: export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" npm run milestone-sync & firebase emulators:exec " - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_15.only.spec.ts + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-nft-trading/minted-nft-trading_11.only.spec.ts " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2347,3 +2354,38 @@ jobs: name: firestore-data-test-tangle-chunk_62 path: ./packages/functions/firestore-data/ retention-days: 1 + chunk_63: + needs: npm-install + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - uses: actions/cache@v3 + with: + path: | + node_modules + packages/functions/node_modules + packages/interfaces/node_modules + key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }} + - name: Init + run: | + npm run build:functions + npm install -g firebase-tools + - name: Test + working-directory: packages/functions + run: | + export GOOGLE_APPLICATION_CREDENTIALS="./test-service-account-key.json" + npm run milestone-sync & + firebase emulators:exec " + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_15.only.spec.ts + " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data + - name: Archive firestore data + uses: actions/upload-artifact@v3 + if: ${{ failure() }} + with: + name: firestore-data-test-tangle-chunk_63 + path: ./packages/functions/firestore-data/ + retention-days: 1 diff --git a/packages/api/package.json b/packages/api/package.json index a477a141e7..e4380e4130 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -26,12 +26,13 @@ "cors": "^2.8.5", "dayjs": "^1.11.9", "express": "^4.18.2", - "joi": "17.10.2", + "joi": "17.11.0", "lodash": "^4.17.21", "rxjs": "^7.8.1", "ws": "^8.13.0" }, "devDependencies": { + "@types/cors": "^2.8.14", "@types/express": "^4.17.17", "@types/lodash": "^4.14.197", "@types/ws": "^8.5.5", diff --git a/packages/functions/package.json b/packages/functions/package.json index 70f91c4997..30ddaab18b 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -92,7 +92,7 @@ "glob": "8.0.3", "interfaces": "^0.0.3", "is-ipfs": "8.0.1", - "joi": "17.10.2", + "joi": "17.11.0", "js-big-decimal": "1.4.1", "jsonwebtoken": "9.0.0", "lodash": "4.17.21", diff --git a/packages/functions/src/controls/token-trading/token-trade.controller.ts b/packages/functions/src/controls/token-trading/token-trade.controller.ts index cf659f943b..462b04758b 100644 --- a/packages/functions/src/controls/token-trading/token-trade.controller.ts +++ b/packages/functions/src/controls/token-trading/token-trade.controller.ts @@ -35,6 +35,7 @@ export const tradeTokenControl = async ( params.type as TokenTradeOrderType, params.count, params.price, + '', customParams?.ip as string | undefined, ); if (tradeOrder) { diff --git a/packages/functions/src/services/payment/tangle-service/token/TokenTradeTangleRequestSchema.ts b/packages/functions/src/services/payment/tangle-service/token/TokenTradeTangleRequestSchema.ts index 21dd055647..a710bdb985 100644 --- a/packages/functions/src/services/payment/tangle-service/token/TokenTradeTangleRequestSchema.ts +++ b/packages/functions/src/services/payment/tangle-service/token/TokenTradeTangleRequestSchema.ts @@ -39,6 +39,9 @@ export const tradeMintedTokenSchema = toJoiObject({ .equal(TokenTradeOrderType.SELL, TokenTradeOrderType.BUY) .required() .description('Direction of the trade.'), + targetAddress: CommonJoi.uid(false).description( + 'Funds will be sent here in case of a successfull trade.', + ), }) .description('Tangle request object to trade a token.') .meta({ diff --git a/packages/functions/src/services/payment/tangle-service/token/token-trade.service.ts b/packages/functions/src/services/payment/tangle-service/token/token-trade.service.ts index cd168d3772..a930c06623 100644 --- a/packages/functions/src/services/payment/tangle-service/token/token-trade.service.ts +++ b/packages/functions/src/services/payment/tangle-service/token/token-trade.service.ts @@ -77,6 +77,7 @@ export class TangleTokenTradeService { params.type as TokenTradeOrderType, params.count || 0, params.price, + params.targetAddress, '', [TokenStatus.BASE, TokenStatus.MINTED], ); @@ -94,19 +95,6 @@ export class TangleTokenTradeService { action: 'set', }); - if (params.type === TokenTradeOrderType.SELL && token?.status === TokenStatus.BASE) { - this.transactionService.createTangleCredit( - payment, - match, - { - amount: tradeOrderTransaction.payload.amount, - address: tradeOrderTransaction.payload.targetAddress, - }, - tranEntry.outputId!, - ); - return; - } - this.transactionService.createUnlockTransaction( tradeOrderTransaction, tran, @@ -133,6 +121,7 @@ export const createTokenTradeOrder = async ( type: TokenTradeOrderType, count: number, price: number, + targetAddress = '', ip = '', acceptedTokenStatuses = ACCEPTED_TOKEN_STATUSES, ) => { @@ -146,7 +135,13 @@ export const createTokenTradeOrder = async ( const [sourceNetwork, targetNetwork] = getSourceAndTargetNetwork(token, isSell); const member = await build5Db().doc(`${COL.MEMBER}/${owner}`).get(); assertMemberHasValidAddress(member, sourceNetwork); - assertMemberHasValidAddress(member, targetNetwork); + if (targetAddress) { + if (!targetAddress.startsWith(targetNetwork === Network.ATOI ? 'rms' : targetNetwork)) { + throw invalidArgument(WenError.invalid_target_address); + } + } else { + assertMemberHasValidAddress(member, targetNetwork); + } if ([TokenStatus.BASE, TokenStatus.MINTED].includes(token.status) || !isSell) { const tradeOrderTransaction = await createTradeOrderTransaction( @@ -156,6 +151,7 @@ export const createTokenTradeOrder = async ( isSell, Number(count), Number(price), + targetAddress, ); return { tradeOrderTransaction, tradeOrder: undefined, distribution: undefined }; @@ -218,11 +214,12 @@ const createTradeOrderTransaction = async ( isSell: boolean, count: number, price: number, + tokenTradeOderTargetAddress = '', ): Promise => { const wallet = await WalletService.newWallet(network); const targetAddress = await wallet.getNewIotaAddressDetails(); const isMinted = token.status === TokenStatus.MINTED; - return { + const order: Transaction = { type: TransactionType.ORDER, uid: getRandomEthAddress(), member, @@ -245,6 +242,10 @@ const createTradeOrderTransaction = async ( }, linkedTransactions: [], }; + if (tokenTradeOderTargetAddress) { + set(order, 'payload.tokenTradeOderTargetAddress', tokenTradeOderTargetAddress); + } + return order; }; const getAmount = async (token: Token, count: number, price: number, isSell: boolean) => { diff --git a/packages/functions/src/services/payment/token/token-service.ts b/packages/functions/src/services/payment/token/token-service.ts index ce050faab2..5b779cb7e5 100644 --- a/packages/functions/src/services/payment/token/token-service.ts +++ b/packages/functions/src/services/payment/token/token-service.ts @@ -19,7 +19,7 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import bigDecimal from 'js-big-decimal'; -import { get, head, last } from 'lodash'; +import { get, head, last, set } from 'lodash'; import { build5Db, getSnapshot } from '../../../firebase/firestore/build5Db'; import { dateToTimestamp } from '../../../utils/dateTime.utils'; import { getBoughtByMemberDiff, getTotalPublicSupply } from '../../../utils/token.utils'; @@ -159,6 +159,9 @@ export class TokenService { sourceNetwork: network, targetNetwork: token.status === TokenStatus.BASE ? getNetworkPair(network) : network, }; + if (order.payload.tokenTradeOderTargetAddress) { + set(data, 'targetAddress', order.payload.tokenTradeOderTargetAddress); + } const ref = build5Db().doc(`${COL.TOKEN_MARKET}/${data.uid}`); this.transactionService.push({ ref, data, action: 'set' }); diff --git a/packages/functions/src/services/wallet/IotaWalletService.ts b/packages/functions/src/services/wallet/IotaWalletService.ts index dc852f0064..c396775f71 100644 --- a/packages/functions/src/services/wallet/IotaWalletService.ts +++ b/packages/functions/src/services/wallet/IotaWalletService.ts @@ -38,12 +38,12 @@ export class IotaWallet extends Wallet { ).items; const outputs = await this.client.getOutputs(outputIds); let totalAmount = BigInt(0); - const totalNativeTokens: { [id: string]: bigint } = {}; + const totalNativeTokens: { [id: string]: number } = {}; for (const outputResponse of outputs) { const output = outputResponse.output; if (output instanceof CommonOutput) { (output as CommonOutput).getNativeTokens()?.forEach((token) => { - totalNativeTokens[token.id] = (totalNativeTokens[token.id] || BigInt(0)) + token.amount; + totalNativeTokens[token.id] = (totalNativeTokens[token.id] || 0) + Number(token.amount); }); } totalAmount += output.getAmount(); diff --git a/packages/functions/src/services/wallet/wallet.ts b/packages/functions/src/services/wallet/wallet.ts index 84cc0f8fda..e43ff9dce9 100644 --- a/packages/functions/src/services/wallet/wallet.ts +++ b/packages/functions/src/services/wallet/wallet.ts @@ -17,7 +17,7 @@ export interface WalletParams { export abstract class Wallet { public abstract getBalance: ( addressBech32: string, - ) => Promise<{ amount: number; nativeTokens: { [id: string]: bigint } }>; + ) => Promise<{ amount: number; nativeTokens: { [id: string]: number } }>; public abstract getNewIotaAddressDetails: (saveMnemonic?: boolean) => Promise; public abstract getIotaAddressDetails: (mnemonic: string) => Promise; public abstract getAddressDetails: (bech32: string) => Promise; diff --git a/packages/functions/src/triggers/token-trading/match-base-token.ts b/packages/functions/src/triggers/token-trading/match-base-token.ts index 1f90e5da3b..a4ac30cb9e 100644 --- a/packages/functions/src/triggers/token-trading/match-base-token.ts +++ b/packages/functions/src/triggers/token-trading/match-base-token.ts @@ -28,6 +28,7 @@ import { getMemberTier, getTokenTradingFee } from './token-trade-order.trigger'; const createIotaPayments = async ( token: Token, sell: TokenTradeOrder, + buy: TokenTradeOrder, seller: Member, buyer: Member, count: number, @@ -52,7 +53,7 @@ const createIotaPayments = async ( type: TransactionPayloadType.BASE_TOKEN_TRADE, amount: count, sourceAddress: sellOrder!.payload.targetAddress, - targetAddress: getAddress(buyer, sell.sourceNetwork!), + targetAddress: buy.targetAddress || getAddress(buyer, sell.sourceNetwork!), previousOwnerEntity: Entity.MEMBER, previousOwner: seller.uid, ownerEntity: Entity.MEMBER, @@ -193,7 +194,7 @@ const createSmrPayments = async ( type: TransactionPayloadType.BASE_TOKEN_TRADE, amount: salePrice, sourceAddress: buyOrder!.payload.targetAddress, - targetAddress: getAddress(seller, buy.sourceNetwork!), + targetAddress: sell.targetAddress || getAddress(seller, buy.sourceNetwork!), previousOwnerEntity: Entity.MEMBER, previousOwner: buy.owner, ownerEntity: Entity.MEMBER, @@ -247,7 +248,7 @@ export const matchBaseToken = async ( const seller = await build5Db().doc(`${COL.MEMBER}/${sell.owner}`).get(); const buyer = await build5Db().doc(`${COL.MEMBER}/${buy.owner}`).get(); - const iotaPayments = await createIotaPayments(token, sell, seller!, buyer!, tokensToTrade); + const iotaPayments = await createIotaPayments(token, sell, buy, seller!, buyer!, tokensToTrade); const smrPayments = await createSmrPayments( token, sell, diff --git a/packages/functions/src/triggers/token-trading/match-minted-token.ts b/packages/functions/src/triggers/token-trading/match-minted-token.ts index 40d4147999..40d1339826 100644 --- a/packages/functions/src/triggers/token-trading/match-minted-token.ts +++ b/packages/functions/src/triggers/token-trading/match-minted-token.ts @@ -83,17 +83,19 @@ const createBillPaymentToSeller = async ( buyer: Member, seller: Member, buyOrderTran: Transaction, + sell: TokenTradeOrder, buy: TokenTradeOrder, salePrice: number, ) => { - const sellerAddress = getAddress(seller, token.mintingData?.network!); + const network = token.mintingData?.network!; + const sellerAddress = sell.targetAddress || getAddress(seller, network); const output = await packBasicOutput(wallet, sellerAddress, salePrice, {}); return { type: TransactionType.BILL_PAYMENT, uid: getRandomEthAddress(), space: token.space, member: buyer.uid, - network: token.mintingData?.network!, + network, payload: { type: TransactionPayloadType.MINTED_TOKEN_TRADE, amount: Number(output.amount), @@ -123,8 +125,9 @@ const createBillPaymentWithNativeTokens = async ( sell: TokenTradeOrder, tokensToSell: number, ): Promise => { - const sellerAddress = getAddress(seller, token.mintingData?.network!); - const buyerAddress = getAddress(buyer, token.mintingData?.network!); + const network = token.mintingData?.network!; + const sellerAddress = getAddress(seller, network); + const buyerAddress = buy.targetAddress || getAddress(buyer, network); const output = await packBasicOutput(wallet, buyerAddress, 0, { nativeTokens: [{ id: token.mintingData?.tokenId!, amount: BigInt(tokensToSell) }], storageDepositReturnAddress: sellerAddress, @@ -134,7 +137,7 @@ const createBillPaymentWithNativeTokens = async ( uid: getRandomEthAddress(), space: token.space, member: seller.uid, - network: token.mintingData?.network!, + network, payload: { type: TransactionPayloadType.MINTED_TOKEN_TRADE, amount: Number(output.amount), @@ -164,9 +167,8 @@ const createCreditToSeller = ( seller: Member, sell: TokenTradeOrder, sellOrderTran: Transaction, -) => { - const sellerAddress = getAddress(seller, token.mintingData?.network!); - return { +) => + { type: TransactionType.CREDIT, uid: getRandomEthAddress(), space: token.space, @@ -177,7 +179,7 @@ const createCreditToSeller = ( dependsOnBillPayment: true, amount: sellOrderTran.payload.amount, sourceAddress: sellOrderTran.payload.targetAddress, - targetAddress: sellerAddress, + targetAddress: getAddress(seller, token.mintingData?.network!), previousOwnerEntity: Entity.MEMBER, previousOwner: seller.uid, ownerEntity: Entity.MEMBER, @@ -189,7 +191,6 @@ const createCreditToSeller = ( tokenSymbol: token.symbol, }, }; -}; const createCreditToBuyer = ( token: Token, @@ -197,9 +198,8 @@ const createCreditToBuyer = ( buy: TokenTradeOrder, buyOrderTran: Transaction, amount: number, -) => { - const buyerAddress = getAddress(buyer, token.mintingData?.network!); - return { +) => + { type: TransactionType.CREDIT, uid: getRandomEthAddress(), space: token.space, @@ -210,7 +210,7 @@ const createCreditToBuyer = ( dependsOnBillPayment: true, amount, sourceAddress: buyOrderTran.payload.targetAddress, - targetAddress: buyerAddress, + targetAddress: getAddress(buyer, token.mintingData?.network!), previousOwnerEntity: Entity.MEMBER, previousOwner: buyer.uid, ownerEntity: Entity.MEMBER, @@ -222,7 +222,6 @@ const createCreditToBuyer = ( tokenSymbol: token.symbol, }, }; -}; export const matchMintedToken = async ( transaction: ITransaction, @@ -298,6 +297,7 @@ export const matchMintedToken = async ( buyer, seller, buyOrderTran, + sell, buy, salePrice, ); diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_11_a.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_a.spec.ts new file mode 100644 index 0000000000..4ba443aab5 --- /dev/null +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_a.spec.ts @@ -0,0 +1,96 @@ +import { + COL, + MIN_IOTA_AMOUNT, + SYSTEM_CONFIG_DOC_ID, + TokenPurchase, + TokenTradeOrderType, + Transaction, + TransactionType, +} from '@build-5/interfaces'; +import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { tradeToken } from '../../src/runtime/firebase/token/trading'; +import { mockWalletReturnValue, wait } from '../../test/controls/common'; +import { testEnv } from '../../test/set-up'; +import { awaitTransactionConfirmationsForToken } from '../common'; +import { requestFundsFromFaucet } from '../faucet'; +import { Helper } from './Helper'; + +describe('Base token trading', () => { + const helper = new Helper(); + + beforeEach(async () => { + await helper.beforeEach(); + }); + + it('Should not create royalty payments, zero percentage fee', async () => { + await build5Db() + .doc(`${COL.SYSTEM}/${SYSTEM_CONFIG_DOC_ID}`) + .set({ tokenTradingFeePercentage: 0 }); + + mockWalletReturnValue(helper.walletSpy, helper.seller!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 2, + type: TokenTradeOrderType.SELL, + }); + const sellOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + sellOrder.payload.targetAddress, + MIN_IOTA_AMOUNT, + ); + + const tradesQuery = build5Db() + .collection(COL.TOKEN_MARKET) + .where('token', '==', helper.token!.uid); + await wait(async () => { + const snap = await tradesQuery.get(); + return snap.length === 1; + }); + + mockWalletReturnValue(helper.walletSpy, helper.buyer!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 2, + type: TokenTradeOrderType.BUY, + }); + const buyOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.targetNetwork, + buyOrder.payload.targetAddress, + 2 * MIN_IOTA_AMOUNT, + ); + + const purchaseQuery = build5Db() + .collection(COL.TOKEN_PURCHASE) + .where('token', '==', helper.token!.uid); + await wait(async () => { + const snap = await purchaseQuery.get(); + return snap.length === 1; + }); + + const purchase = (await purchaseQuery.get())[0]; + expect(purchase.price).toBe(2); + + const billPayments = ( + await build5Db() + .collection(COL.TRANSACTION) + .where('type', '==', TransactionType.BILL_PAYMENT) + .where('payload.token', '==', helper.token!.uid) + .get() + ).map((d) => d); + expect(billPayments.length).toBe(2); + + const billPaymentToSeller = billPayments.find( + (bp) => bp.payload.amount === MIN_IOTA_AMOUNT * 2 && bp.payload.owner === helper.seller!.uid, + ); + expect(billPaymentToSeller).toBeDefined(); + + const billPaymentToBuyer = billPayments.find( + (bp) => bp.payload.amount === MIN_IOTA_AMOUNT && bp.payload.owner === helper.buyer!.uid, + ); + expect(billPaymentToBuyer).toBeDefined(); + + await awaitTransactionConfirmationsForToken(helper.token!.uid); + }); +}); diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_11.only.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_b.spec.ts similarity index 63% rename from packages/functions/test-tangle/base-token-trading/base-token-trading_11.only.spec.ts rename to packages/functions/test-tangle/base-token-trading/base-token-trading_11_b.spec.ts index 1d83a7092a..47ae9973c7 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_11.only.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_b.spec.ts @@ -3,7 +3,6 @@ import { MIN_IOTA_AMOUNT, StakeType, SUB_COL, - SYSTEM_CONFIG_DOC_ID, TokenPurchase, TokenTradeOrderType, Transaction, @@ -24,106 +23,94 @@ describe('Base token trading', () => { await helper.beforeEach(); }); - it.each([false, true])( - 'Should not create royalty payments, zero percentage fee', - async (isMember: boolean) => { - if (isMember) { - await build5Db() - .doc(`${COL.MEMBER}/${helper.seller!.uid}`) - .update({ tokenTradingFeePercentage: 0 }); - await build5Db() - .collection(COL.TOKEN) - .doc(helper.soonTokenId) - .collection(SUB_COL.DISTRIBUTION) - .doc(helper.seller?.uid!) - .set( - { - stakes: { - [StakeType.DYNAMIC]: { - value: 15000 * MIN_IOTA_AMOUNT, - }, - }, + it('Should not create royalty payments, zero percentage fee', async () => { + await build5Db() + .doc(`${COL.MEMBER}/${helper.seller!.uid}`) + .update({ tokenTradingFeePercentage: 0 }); + await build5Db() + .collection(COL.TOKEN) + .doc(helper.soonTokenId) + .collection(SUB_COL.DISTRIBUTION) + .doc(helper.seller?.uid!) + .set( + { + stakes: { + [StakeType.DYNAMIC]: { + value: 15000 * MIN_IOTA_AMOUNT, }, - true, - ); - } else { - await build5Db() - .doc(`${COL.SYSTEM}/${SYSTEM_CONFIG_DOC_ID}`) - .set({ tokenTradingFeePercentage: 0 }); - } - - mockWalletReturnValue(helper.walletSpy, helper.seller!.uid, { - symbol: helper.token!.symbol, - count: MIN_IOTA_AMOUNT, - price: 2, - type: TokenTradeOrderType.SELL, - }); - const sellOrder = await testEnv.wrap(tradeToken)({}); - await requestFundsFromFaucet( - helper.sourceNetwork, - sellOrder.payload.targetAddress, - MIN_IOTA_AMOUNT, + }, + }, + true, ); - const tradesQuery = build5Db() - .collection(COL.TOKEN_MARKET) - .where('token', '==', helper.token!.uid); - await wait(async () => { - const snap = await tradesQuery.get(); - return snap.length === 1; - }); + mockWalletReturnValue(helper.walletSpy, helper.seller!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 2, + type: TokenTradeOrderType.SELL, + }); + const sellOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + sellOrder.payload.targetAddress, + MIN_IOTA_AMOUNT, + ); - mockWalletReturnValue(helper.walletSpy, helper.buyer!.uid, { - symbol: helper.token!.symbol, - count: MIN_IOTA_AMOUNT, - price: 2, - type: TokenTradeOrderType.BUY, - }); - const buyOrder = await testEnv.wrap(tradeToken)({}); - await requestFundsFromFaucet( - helper.targetNetwork, - buyOrder.payload.targetAddress, - 2 * MIN_IOTA_AMOUNT, - ); + const tradesQuery = build5Db() + .collection(COL.TOKEN_MARKET) + .where('token', '==', helper.token!.uid); + await wait(async () => { + const snap = await tradesQuery.get(); + return snap.length === 1; + }); + + mockWalletReturnValue(helper.walletSpy, helper.buyer!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 2, + type: TokenTradeOrderType.BUY, + }); + const buyOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.targetNetwork, + buyOrder.payload.targetAddress, + 2 * MIN_IOTA_AMOUNT, + ); - const purchaseQuery = build5Db() - .collection(COL.TOKEN_PURCHASE) - .where('token', '==', helper.token!.uid); - await wait(async () => { - const snap = await purchaseQuery.get(); - return snap.length === 1; - }); + const purchaseQuery = build5Db() + .collection(COL.TOKEN_PURCHASE) + .where('token', '==', helper.token!.uid); + await wait(async () => { + const snap = await purchaseQuery.get(); + return snap.length === 1; + }); - const purchase = (await purchaseQuery.get())[0]; - expect(purchase.price).toBe(2); - if (isMember) { - expect(purchase.sellerTier).toBe(4); - expect(purchase.sellerTokenTradingFeePercentage).toBe(0); - } + const purchase = (await purchaseQuery.get())[0]; + expect(purchase.price).toBe(2); + expect(purchase.sellerTier).toBe(4); + expect(purchase.sellerTokenTradingFeePercentage).toBe(0); - const billPayments = ( - await build5Db() - .collection(COL.TRANSACTION) - .where('type', '==', TransactionType.BILL_PAYMENT) - .where('payload.token', '==', helper.token!.uid) - .get() - ).map((d) => d); - expect(billPayments.length).toBe(2); + const billPayments = ( + await build5Db() + .collection(COL.TRANSACTION) + .where('type', '==', TransactionType.BILL_PAYMENT) + .where('payload.token', '==', helper.token!.uid) + .get() + ).map((d) => d); + expect(billPayments.length).toBe(2); - const billPaymentToSeller = billPayments.find( - (bp) => - bp.payload.amount === MIN_IOTA_AMOUNT * 2 && bp.payload.owner === helper.seller!.uid, - ); - expect(billPaymentToSeller).toBeDefined(); + const billPaymentToSeller = billPayments.find( + (bp) => bp.payload.amount === MIN_IOTA_AMOUNT * 2 && bp.payload.owner === helper.seller!.uid, + ); + expect(billPaymentToSeller).toBeDefined(); - const billPaymentToBuyer = billPayments.find( - (bp) => bp.payload.amount === MIN_IOTA_AMOUNT && bp.payload.owner === helper.buyer!.uid, - ); - expect(billPaymentToBuyer).toBeDefined(); + const billPaymentToBuyer = billPayments.find( + (bp) => bp.payload.amount === MIN_IOTA_AMOUNT && bp.payload.owner === helper.buyer!.uid, + ); + expect(billPaymentToBuyer).toBeDefined(); - await awaitTransactionConfirmationsForToken(helper.token!.uid); - }, - ); + await awaitTransactionConfirmationsForToken(helper.token!.uid); + }); it('Should create royalty payments only with dust', async () => { await build5Db() diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_11_c.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_c.spec.ts new file mode 100644 index 0000000000..80e499f3de --- /dev/null +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_c.spec.ts @@ -0,0 +1,94 @@ +import { + COL, + MIN_IOTA_AMOUNT, + TokenPurchase, + TokenTradeOrderType, + Transaction, + TransactionType, +} from '@build-5/interfaces'; +import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { tradeToken } from '../../src/runtime/firebase/token/trading'; +import { mockWalletReturnValue, wait } from '../../test/controls/common'; +import { testEnv } from '../../test/set-up'; +import { awaitTransactionConfirmationsForToken } from '../common'; +import { requestFundsFromFaucet } from '../faucet'; +import { Helper } from './Helper'; + +describe('Base token trading', () => { + const helper = new Helper(); + + beforeEach(async () => { + await helper.beforeEach(); + }); + + it('Should create royalty payments only with dust', async () => { + await build5Db() + .doc(`${COL.MEMBER}/${helper.seller!.uid}`) + .update({ tokenTradingFeePercentage: 0 }); + mockWalletReturnValue(helper.walletSpy, helper.seller!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 2, + type: TokenTradeOrderType.SELL, + }); + const sellOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + sellOrder.payload.targetAddress, + MIN_IOTA_AMOUNT, + ); + + const tradesQuery = build5Db() + .collection(COL.TOKEN_MARKET) + .where('token', '==', helper.token!.uid); + await wait(async () => { + const snap = await tradesQuery.get(); + return snap.length === 1; + }); + + mockWalletReturnValue(helper.walletSpy, helper.buyer!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 2.001, + type: TokenTradeOrderType.BUY, + }); + const buyOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.targetNetwork, + buyOrder.payload.targetAddress, + 2.001 * MIN_IOTA_AMOUNT, + ); + + const purchaseQuery = build5Db() + .collection(COL.TOKEN_PURCHASE) + .where('token', '==', helper.token!.uid); + await wait(async () => { + const snap = await purchaseQuery.get(); + return snap.length === 1; + }); + + const purchase = (await purchaseQuery.get())[0]; + expect(purchase.price).toBe(2); + + const billPayments = ( + await build5Db() + .collection(COL.TRANSACTION) + .where('type', '==', TransactionType.BILL_PAYMENT) + .where('payload.token', '==', helper.token!.uid) + .get() + ).map((d) => d); + expect(billPayments.length).toBe(3); + + const billPaymentToSpaceOne = billPayments.find((bp) => bp.payload.amount === 1000 + 46800); + expect(billPaymentToSpaceOne).toBeDefined(); + + const billPaymentToSeller = billPayments.find( + (bp) => + bp.payload.amount === + MIN_IOTA_AMOUNT * 2 - billPaymentToSpaceOne?.payload?.storageReturn?.amount!, + ); + expect(billPaymentToSeller).toBeDefined(); + + await awaitTransactionConfirmationsForToken(helper.token!.uid); + }); +}); diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_11_d.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_d.spec.ts new file mode 100644 index 0000000000..b838664f21 --- /dev/null +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_11_d.spec.ts @@ -0,0 +1,103 @@ +import { + COL, + MIN_IOTA_AMOUNT, + TokenPurchase, + TokenTradeOrderType, + Transaction, + TransactionType, +} from '@build-5/interfaces'; +import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { tradeToken } from '../../src/runtime/firebase/token/trading'; +import { mockWalletReturnValue, wait } from '../../test/controls/common'; +import { testEnv } from '../../test/set-up'; +import { awaitTransactionConfirmationsForToken } from '../common'; +import { requestFundsFromFaucet } from '../faucet'; +import { Helper } from './Helper'; + +describe('Base token trading', () => { + const helper = new Helper(); + + beforeEach(async () => { + await helper.beforeEach(); + }); + + it('Should create royalty payments for different percentage', async () => { + await build5Db() + .doc(`${COL.MEMBER}/${helper.seller!.uid}`) + .update({ tokenTradingFeePercentage: 1 }); + mockWalletReturnValue(helper.walletSpy, helper.seller!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 2, + type: TokenTradeOrderType.SELL, + }); + const sellOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + sellOrder.payload.targetAddress, + MIN_IOTA_AMOUNT, + ); + + const tradesQuery = build5Db() + .collection(COL.TOKEN_MARKET) + .where('token', '==', helper.token!.uid); + await wait(async () => { + const snap = await tradesQuery.get(); + return snap.length === 1; + }); + + mockWalletReturnValue(helper.walletSpy, helper.buyer!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 2, + type: TokenTradeOrderType.BUY, + }); + const buyOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.targetNetwork, + buyOrder.payload.targetAddress, + 2 * MIN_IOTA_AMOUNT, + ); + + const purchaseQuery = build5Db() + .collection(COL.TOKEN_PURCHASE) + .where('token', '==', helper.token!.uid); + await wait(async () => { + const snap = await purchaseQuery.get(); + return snap.length === 1; + }); + + const purchase = (await purchaseQuery.get())[0]; + expect(purchase.price).toBe(2); + + const billPayments = ( + await build5Db() + .collection(COL.TRANSACTION) + .where('type', '==', TransactionType.BILL_PAYMENT) + .where('payload.token', '==', helper.token!.uid) + .get() + ).map((d) => d); + expect(billPayments.length).toBe(4); + + const billPaymentToSpaceOne = billPayments.find( + (bp) => bp.payload.amount === MIN_IOTA_AMOUNT * 2 * 0.01 * 0.1 + 46800, + ); + expect(billPaymentToSpaceOne).toBeDefined(); + + const billPaymentToSpaceTwo = billPayments.find( + (bp) => bp.payload.amount === MIN_IOTA_AMOUNT * 2 * 0.01 * 0.9 + 46800, + ); + expect(billPaymentToSpaceTwo).toBeDefined(); + + const billPaymentToSeller = billPayments.find( + (bp) => + bp.payload.amount === + MIN_IOTA_AMOUNT * 2 * 0.99 - + billPaymentToSpaceOne?.payload?.storageReturn?.amount! - + billPaymentToSpaceTwo?.payload?.storageReturn?.amount!, + ); + expect(billPaymentToSeller).toBeDefined(); + + await awaitTransactionConfirmationsForToken(helper.token!.uid); + }); +}); diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_12.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_12.spec.ts index 569ba33e0e..f8d8483ad2 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_12.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_12.spec.ts @@ -6,54 +6,44 @@ import { TokenTradeOrder, TokenTradeOrderType, Transaction, - TransactionType, } from '@build-5/interfaces'; import { build5Db } from '../../src/firebase/firestore/build5Db'; import { wait } from '../../test/controls/common'; -import { getRmsSoonTangleResponse, getTangleOrder } from '../common'; +import { getTangleOrder } from '../common'; import { requestFundsFromFaucet } from '../faucet'; import { Helper } from './Helper'; describe('Base token trading', () => { const helper = new Helper(); - let tangleOrder: Transaction; + let atoiTangleOrder: Transaction; + let rmsTangleOrder: Transaction; beforeEach(async () => { await helper.beforeEach(); - tangleOrder = await getTangleOrder(Network.RMS); }); it('Should create sell order with tangle', async () => { + atoiTangleOrder = await getTangleOrder(Network.ATOI); const atoiAddress = helper.sellerValidateAddress[Network.ATOI]; - const rmsAddress = helper.sellerValidateAddress[Network.RMS]; - await requestFundsFromFaucet(helper.sourceNetwork, atoiAddress.bech32, 5 * MIN_IOTA_AMOUNT); - await requestFundsFromFaucet(helper.targetNetwork, rmsAddress.bech32, 5 * MIN_IOTA_AMOUNT); + await requestFundsFromFaucet(helper.sourceNetwork, atoiAddress.bech32, MIN_IOTA_AMOUNT); - await helper.rmsWallet!.send(rmsAddress, tangleOrder.payload.targetAddress!, MIN_IOTA_AMOUNT, { - customMetadata: { - request: { - requestType: TangleRequestType.SELL_TOKEN, - symbol: helper.token?.symbol!, - count: MIN_IOTA_AMOUNT, - price: 1.5, + await helper.atoiWallet!.send( + atoiAddress, + atoiTangleOrder.payload.targetAddress!, + MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.SELL_TOKEN, + symbol: helper.token?.symbol!, + count: MIN_IOTA_AMOUNT, + price: 1.5, + }, }, }, - }); - - let query = build5Db() - .collection(COL.TRANSACTION) - .where('member', '==', helper.seller!.uid) - .where('type', '==', TransactionType.CREDIT_TANGLE_REQUEST); - await wait(async () => { - const snap = await query.get(); - return snap[0]?.payload?.walletReference?.confirmed; - }); - - let snap = await query.get(); - const response = await getRmsSoonTangleResponse(snap[0], helper.rmsWallet!); + ); - await helper.atoiWallet!.send(atoiAddress, response.address, response.amount, {}); - query = build5Db().collection(COL.TOKEN_MARKET).where('owner', '==', helper.seller!.uid); + const query = build5Db().collection(COL.TOKEN_MARKET).where('owner', '==', helper.seller!.uid); await wait(async () => { const snap = await query.get(); return snap.length > 0; @@ -67,12 +57,13 @@ describe('Base token trading', () => { }); it('Should buy base token with tangle request', async () => { + rmsTangleOrder = await getTangleOrder(Network.RMS); const rmsAddress = helper.buyerValidateAddress[Network.RMS]; await requestFundsFromFaucet(helper.targetNetwork, rmsAddress.bech32, 5 * MIN_IOTA_AMOUNT); await helper.rmsWallet!.send( rmsAddress, - tangleOrder.payload.targetAddress!, + rmsTangleOrder.payload.targetAddress!, 1.5 * MIN_IOTA_AMOUNT, { customMetadata: { diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_13.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_13.spec.ts new file mode 100644 index 0000000000..990048efe6 --- /dev/null +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_13.spec.ts @@ -0,0 +1,93 @@ +import { + COL, + MIN_IOTA_AMOUNT, + Network, + TangleRequestType, + TokenTradeOrder, + Transaction, +} from '@build-5/interfaces'; +import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { wait } from '../../test/controls/common'; +import { awaitTransactionConfirmationsForToken, getTangleOrder } from '../common'; +import { requestFundsFromFaucet } from '../faucet'; +import { Helper } from './Helper'; + +describe('Base token trading', () => { + const helper = new Helper(); + let atoiTangleOrder: Transaction; + let rmsTangleOrder: Transaction; + + beforeEach(async () => { + await helper.beforeEach(); + atoiTangleOrder = await getTangleOrder(Network.ATOI); + rmsTangleOrder = await getTangleOrder(Network.RMS); + }); + + it('Should trade, custom target address', async () => { + const atoiAddress = helper.sellerValidateAddress[Network.ATOI]; + const rmsAddress = helper.buyerValidateAddress[Network.RMS]; + + const faucetPromises = [ + requestFundsFromFaucet(helper.sourceNetwork, atoiAddress.bech32, MIN_IOTA_AMOUNT), + requestFundsFromFaucet(helper.targetNetwork, rmsAddress.bech32, MIN_IOTA_AMOUNT), + ]; + await Promise.all(faucetPromises); + + const sellerTargetAddress = await helper.rmsWallet!.getNewIotaAddressDetails(); + helper.rmsWallet!.send(atoiAddress, atoiTangleOrder.payload.targetAddress!, MIN_IOTA_AMOUNT, { + customMetadata: { + request: { + requestType: TangleRequestType.SELL_TOKEN, + symbol: helper.token?.symbol!, + count: MIN_IOTA_AMOUNT, + price: 1, + targetAddress: sellerTargetAddress.bech32, + }, + }, + }); + + const buyerTargetAddress = await helper.atoiWallet!.getNewIotaAddressDetails(); + helper.rmsWallet!.send(rmsAddress, rmsTangleOrder.payload.targetAddress!, MIN_IOTA_AMOUNT, { + customMetadata: { + request: { + requestType: TangleRequestType.BUY_TOKEN, + symbol: helper.token?.symbol!, + count: MIN_IOTA_AMOUNT, + price: 1, + targetAddress: buyerTargetAddress.bech32, + }, + }, + }); + + let query = build5Db().collection(COL.TOKEN_MARKET).where('owner', '==', helper.seller!.uid); + await wait(async () => { + const snap = await query.get(); + return snap.length > 0; + }); + const sell = (await query.get())[0]!; + + query = build5Db().collection(COL.TOKEN_MARKET).where('owner', '==', helper.buyer!.uid); + await wait(async () => { + const snap = await query.get(); + return snap.length > 0; + }); + const buy = (await query.get())[0]!; + + query = build5Db() + .collection(COL.TOKEN_PURCHASE) + .where('sell', '==', sell.uid) + .where('buy', '==', buy.uid); + await wait(async () => { + const snap = await query.get(); + return snap.length > 0; + }); + + await awaitTransactionConfirmationsForToken(helper.token?.uid!); + + const { amount: buyerAmount } = await helper.atoiWallet!.getBalance(buyerTargetAddress.bech32); + expect(buyerAmount).toBe(MIN_IOTA_AMOUNT); + + const { amount: sellerAmount } = await helper.rmsWallet!.getBalance(sellerTargetAddress.bech32); + expect(sellerAmount).toBe(881400); + }); +}); diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_8.only.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_8.spec.ts similarity index 94% rename from packages/functions/test-tangle/base-token-trading/base-token-trading_8.only.spec.ts rename to packages/functions/test-tangle/base-token-trading/base-token-trading_8.spec.ts index 35eb64a0fa..a5930a7321 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_8.only.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_8.spec.ts @@ -11,7 +11,6 @@ import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; -import { awaitTransactionConfirmationsForToken } from '../common'; import { requestFundsForManyFromFaucet, requestFundsFromFaucet } from '../faucet'; import { Helper } from './Helper'; @@ -69,7 +68,5 @@ describe('Base token trading', () => { ); return allFulfilled; }); - - await awaitTransactionConfirmationsForToken(helper.token!.uid); }); }); diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_9.only.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_9.spec.ts similarity index 94% rename from packages/functions/test-tangle/base-token-trading/base-token-trading_9.only.spec.ts rename to packages/functions/test-tangle/base-token-trading/base-token-trading_9.spec.ts index fcd1c86346..c10f8113b0 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_9.only.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_9.spec.ts @@ -11,7 +11,6 @@ import { build5Db } from '../../src/firebase/firestore/build5Db'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; -import { awaitTransactionConfirmationsForToken } from '../common'; import { requestFundsForManyFromFaucet, requestFundsFromFaucet } from '../faucet'; import { Helper } from './Helper'; @@ -68,7 +67,5 @@ describe('Base token trading', () => { ); return allFulfilled; }); - - await awaitTransactionConfirmationsForToken(helper.token!.uid); }); }); diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts index 8828895bb0..fc5f89add3 100644 --- a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3.spec.ts @@ -17,117 +17,113 @@ import { Helper } from './Helper'; describe('Metadata nft', () => { const helper = new Helper(); - it.each([Network.RMS, Network.ATOI])( - 'Should mint metada nft then update metadata', - async (network: Network) => { - await helper.beforeEach(network); - const metadata = { mytest: 'mytest', asd: 'asdasdasd' }; - await helper.walletService.send( - helper.memberAddress, - helper.tangleOrder.payload.targetAddress!, - MIN_IOTA_AMOUNT, - { - customMetadata: { - request: { - requestType: TangleRequestType.MINT_METADATA_NFT, - metadata, - }, + it('Should mint metada nft then update metadata', async () => { + await helper.beforeEach(Network.RMS); + const metadata = { mytest: 'mytest', asd: 'asdasdasd' }; + await helper.walletService.send( + helper.memberAddress, + helper.tangleOrder.payload.targetAddress!, + MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.MINT_METADATA_NFT, + metadata, }, }, - ); - await MnemonicService.store( - helper.memberAddress.bech32, - helper.memberAddress.mnemonic, - helper.network, - ); + }, + ); + await MnemonicService.store( + helper.memberAddress.bech32, + helper.memberAddress.mnemonic, + helper.network, + ); - const mintMetadataNftQuery = build5Db() - .collection(COL.TRANSACTION) - .where('member', '==', helper.member) - .where('type', '==', TransactionType.METADATA_NFT); - await wait(async () => { - const snap = await mintMetadataNftQuery.get(); - return snap.length === 3; - }); + const mintMetadataNftQuery = build5Db() + .collection(COL.TRANSACTION) + .where('member', '==', helper.member) + .where('type', '==', TransactionType.METADATA_NFT); + await wait(async () => { + const snap = await mintMetadataNftQuery.get(); + return snap.length === 3; + }); - const creditQuery = build5Db() - .collection(COL.TRANSACTION) - .where('member', '==', helper.member) - .where('type', '==', TransactionType.CREDIT); - await wait(async () => { - const snap = await creditQuery.get(); - return snap.length === 1 && snap[0]?.payload?.walletReference?.confirmed; - }); + const creditQuery = build5Db() + .collection(COL.TRANSACTION) + .where('member', '==', helper.member) + .where('type', '==', TransactionType.CREDIT); + await wait(async () => { + const snap = await creditQuery.get(); + return snap.length === 1 && snap[0]?.payload?.walletReference?.confirmed; + }); - const nftQuery = build5Db().collection(COL.NFT).where('owner', '==', helper.member); - const nft = (await nftQuery.get())[0]; + const nftQuery = build5Db().collection(COL.NFT).where('owner', '==', helper.member); + const nft = (await nftQuery.get())[0]; - await helper.walletService.send( - helper.memberAddress, - helper.tangleOrder.payload.targetAddress!, - MIN_IOTA_AMOUNT, - { - customMetadata: { - request: { - requestType: TangleRequestType.MINT_METADATA_NFT, - metadata: { asd: 'hello' }, - nftId: nft.mintingData?.nftId, - }, + await helper.walletService.send( + helper.memberAddress, + helper.tangleOrder.payload.targetAddress!, + MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.MINT_METADATA_NFT, + metadata: { asd: 'hello' }, + nftId: nft.mintingData?.nftId, }, }, - ); - await MnemonicService.store( - helper.memberAddress.bech32, - helper.memberAddress.mnemonic, - helper.network, - ); + }, + ); + await MnemonicService.store( + helper.memberAddress.bech32, + helper.memberAddress.mnemonic, + helper.network, + ); - await wait(async () => { - const snap = await creditQuery.get(); - return ( - snap.length === 2 && - snap.reduce((acc, act) => acc && (act.payload?.walletReference?.confirmed || false), true) - ); - }); + await wait(async () => { + const snap = await creditQuery.get(); + return ( + snap.length === 2 && + snap.reduce((acc, act) => acc && (act.payload?.walletReference?.confirmed || false), true) + ); + }); - let nftOutputId = await helper.walletService.client.nftOutputId(nft.mintingData?.nftId!); - let nftOutput = (await helper.walletService.client.getOutput(nftOutputId)) - .output as NftOutput; - let meta = getOutputMetadata(nftOutput); - expect(meta).toEqual({ asd: 'hello' }); + let nftOutputId = await helper.walletService.client.nftOutputId(nft.mintingData?.nftId!); + let nftOutput = (await helper.walletService.client.getOutput(nftOutputId)).output as NftOutput; + let meta = getOutputMetadata(nftOutput); + expect(meta).toEqual({ asd: 'hello' }); - await helper.walletService.send( - helper.memberAddress, - helper.tangleOrder.payload.targetAddress!, - MIN_IOTA_AMOUNT, - { - customMetadata: { - request: { - requestType: TangleRequestType.MINT_METADATA_NFT, - metadata: { asd: 'helloasdasd2' }, - nftId: nft.mintingData?.nftId, - }, + await helper.walletService.send( + helper.memberAddress, + helper.tangleOrder.payload.targetAddress!, + MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.MINT_METADATA_NFT, + metadata: { asd: 'helloasdasd2' }, + nftId: nft.mintingData?.nftId, }, }, - ); - await MnemonicService.store( - helper.memberAddress.bech32, - helper.memberAddress.mnemonic, - helper.network, - ); + }, + ); + await MnemonicService.store( + helper.memberAddress.bech32, + helper.memberAddress.mnemonic, + helper.network, + ); - await wait(async () => { - const snap = await creditQuery.get(); - return ( - snap.length === 3 && - snap.reduce((acc, act) => acc && (act.payload?.walletReference?.confirmed || false), true) - ); - }); + await wait(async () => { + const snap = await creditQuery.get(); + return ( + snap.length === 3 && + snap.reduce((acc, act) => acc && (act.payload?.walletReference?.confirmed || false), true) + ); + }); - nftOutputId = await helper.walletService.client.nftOutputId(nft.mintingData?.nftId!); - nftOutput = (await helper.walletService.client.getOutput(nftOutputId)).output as NftOutput; - meta = getOutputMetadata(nftOutput); - expect(meta).toEqual({ asd: 'helloasdasd2' }); - }, - ); + nftOutputId = await helper.walletService.client.nftOutputId(nft.mintingData?.nftId!); + nftOutput = (await helper.walletService.client.getOutput(nftOutputId)).output as NftOutput; + meta = getOutputMetadata(nftOutput); + expect(meta).toEqual({ asd: 'helloasdasd2' }); + }); }); diff --git a/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3_b.spec.ts b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3_b.spec.ts new file mode 100644 index 0000000000..c04c9d7fb3 --- /dev/null +++ b/packages/functions/test-tangle/metadata-nft/mint-metadata-nft_3_b.spec.ts @@ -0,0 +1,129 @@ +import { + COL, + MIN_IOTA_AMOUNT, + Network, + Nft, + TangleRequestType, + Transaction, + TransactionType, +} from '@build-5/interfaces'; +import { NftOutput } from '@iota/sdk'; +import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { MnemonicService } from '../../src/services/wallet/mnemonic'; +import { getOutputMetadata } from '../../src/utils/basic-output.utils'; +import { wait } from '../../test/controls/common'; +import { Helper } from './Helper'; + +describe('Metadata nft', () => { + const helper = new Helper(); + + it('Should mint metada nft then update metadata', async () => { + await helper.beforeEach(Network.ATOI); + const metadata = { mytest: 'mytest', asd: 'asdasdasd' }; + await helper.walletService.send( + helper.memberAddress, + helper.tangleOrder.payload.targetAddress!, + MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.MINT_METADATA_NFT, + metadata, + }, + }, + }, + ); + await MnemonicService.store( + helper.memberAddress.bech32, + helper.memberAddress.mnemonic, + helper.network, + ); + + const mintMetadataNftQuery = build5Db() + .collection(COL.TRANSACTION) + .where('member', '==', helper.member) + .where('type', '==', TransactionType.METADATA_NFT); + await wait(async () => { + const snap = await mintMetadataNftQuery.get(); + return snap.length === 3; + }); + + const creditQuery = build5Db() + .collection(COL.TRANSACTION) + .where('member', '==', helper.member) + .where('type', '==', TransactionType.CREDIT); + await wait(async () => { + const snap = await creditQuery.get(); + return snap.length === 1 && snap[0]?.payload?.walletReference?.confirmed; + }); + + const nftQuery = build5Db().collection(COL.NFT).where('owner', '==', helper.member); + const nft = (await nftQuery.get())[0]; + + await helper.walletService.send( + helper.memberAddress, + helper.tangleOrder.payload.targetAddress!, + MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.MINT_METADATA_NFT, + metadata: { asd: 'hello' }, + nftId: nft.mintingData?.nftId, + }, + }, + }, + ); + await MnemonicService.store( + helper.memberAddress.bech32, + helper.memberAddress.mnemonic, + helper.network, + ); + + await wait(async () => { + const snap = await creditQuery.get(); + return ( + snap.length === 2 && + snap.reduce((acc, act) => acc && (act.payload?.walletReference?.confirmed || false), true) + ); + }); + + let nftOutputId = await helper.walletService.client.nftOutputId(nft.mintingData?.nftId!); + let nftOutput = (await helper.walletService.client.getOutput(nftOutputId)).output as NftOutput; + let meta = getOutputMetadata(nftOutput); + expect(meta).toEqual({ asd: 'hello' }); + + await helper.walletService.send( + helper.memberAddress, + helper.tangleOrder.payload.targetAddress!, + MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.MINT_METADATA_NFT, + metadata: { asd: 'helloasdasd2' }, + nftId: nft.mintingData?.nftId, + }, + }, + }, + ); + await MnemonicService.store( + helper.memberAddress.bech32, + helper.memberAddress.mnemonic, + helper.network, + ); + + await wait(async () => { + const snap = await creditQuery.get(); + return ( + snap.length === 3 && + snap.reduce((acc, act) => acc && (act.payload?.walletReference?.confirmed || false), true) + ); + }); + + nftOutputId = await helper.walletService.client.nftOutputId(nft.mintingData?.nftId!); + nftOutput = (await helper.walletService.client.getOutput(nftOutputId)).output as NftOutput; + meta = getOutputMetadata(nftOutput); + expect(meta).toEqual({ asd: 'helloasdasd2' }); + }); +}); diff --git a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_a.spec.ts b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_a.spec.ts new file mode 100644 index 0000000000..cee11bf6ee --- /dev/null +++ b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_a.spec.ts @@ -0,0 +1,198 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +import { + COL, + MIN_IOTA_AMOUNT, + Member, + SUB_COL, + StakeType, + Token, + TokenDistribution, + TokenDropStatus, + TokenStats, + Transaction, + TransactionPayloadType, + TransactionType, + WenError, +} from '@build-5/interfaces'; +import dayjs from 'dayjs'; +import { head } from 'lodash'; +import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { + airdropMintedToken, + claimMintedTokenOrder, +} from '../../src/runtime/firebase/token/minting'; +import { getAddress } from '../../src/utils/address.utils'; +import { expectThrow, mockWalletReturnValue, wait } from '../../test/controls/common'; +import { testEnv } from '../../test/set-up'; +import { awaitTransactionConfirmationsForToken } from '../common'; +import { requestFundsFromFaucet, requestMintedTokenFromFaucet } from '../faucet'; +import { Helper, VAULT_MNEMONIC } from './Helper'; + +describe('Minted token airdrop', () => { + const helper = new Helper(); + + beforeAll(async () => { + await helper.berforeAll(); + }); + + beforeEach(async () => { + await helper.beforeEach(); + }); + + it('Should drop and claim minted token', async () => { + const stakeType = StakeType.DYNAMIC; + const drops = [ + { + count: 1, + recipient: helper.member!, + vestingAt: dayjs().subtract(1, 'm').toDate(), + }, + { count: 1, recipient: helper.member!, vestingAt: dayjs().add(2, 'M').toDate(), stakeType }, + ]; + const total = drops.reduce((acc, act) => acc + act.count, 0); + mockWalletReturnValue(helper.walletSpy, helper.guardian!, { + token: helper.token!.uid, + drops, + }); + let order = await testEnv.wrap(airdropMintedToken)({}); + expect(order.payload.unclaimedAirdrops).toBe(2); + + mockWalletReturnValue(helper.walletSpy, helper.member!, { symbol: helper.token!.symbol }); + await expectThrow(testEnv.wrap(claimMintedTokenOrder)({}), WenError.no_tokens_to_claim.key); + + const guardian = await build5Db().doc(`${COL.MEMBER}/${helper.guardian}`).get(); + const guardianAddress = await helper.walletService!.getAddressDetails( + getAddress(guardian, helper.network), + ); + await requestFundsFromFaucet(helper.network, guardianAddress.bech32, 5 * MIN_IOTA_AMOUNT); + await requestMintedTokenFromFaucet( + helper.walletService!, + guardianAddress, + helper.token!.mintingData?.tokenId!, + VAULT_MNEMONIC, + total, + ); + + await helper.walletService!.send(guardianAddress, order.payload.targetAddress, 0, { + nativeTokens: [{ id: helper.token?.mintingData?.tokenId!, amount: BigInt(total) }], + }); + + await wait(async () => { + const airdrops = await helper.getAirdropsForMember(helper.member!); + return airdrops.length === 2; + }); + + const distributionDocRef = build5Db().doc( + `${COL.TOKEN}/${helper.token!.uid}/${SUB_COL.DISTRIBUTION}/${helper.member}`, + ); + let distribution = await distributionDocRef.get(); + expect(distribution.totalUnclaimedAirdrop).toBe(2); + + mockWalletReturnValue(helper.walletSpy, helper.member!, { + symbol: helper.token!.symbol, + }); + const claimOrder = await testEnv.wrap(claimMintedTokenOrder)({}); + const claimOrder2 = await testEnv.wrap(claimMintedTokenOrder)({}); + await requestFundsFromFaucet( + helper.network, + claimOrder.payload.targetAddress, + claimOrder.payload.amount, + ); + await requestFundsFromFaucet( + helper.network, + claimOrder2.payload.targetAddress, + claimOrder2.payload.amount, + ); + + await wait(async () => { + const orderDocRef = build5Db().doc(`${COL.TRANSACTION}/${order.uid}`); + order = await orderDocRef.get(); + return order.payload.unclaimedAirdrops === 0; + }); + + const airdrops = await helper.getAirdropsForMember(helper.member!, TokenDropStatus.CLAIMED); + expect(airdrops.length).toBe(2); + + await awaitTransactionConfirmationsForToken(helper.token!.uid); + + const billPayments = ( + await build5Db() + .collection(COL.TRANSACTION) + .where('type', '==', TransactionType.BILL_PAYMENT) + .where('member', '==', helper.member) + .get() + ).map((d) => d as Transaction); + expect(billPayments.length).toBe(2); + billPayments.forEach((billPayment) => { + expect(billPayment.payload.token).toBe(helper.token!.uid); + expect(billPayment.payload.tokenSymbol).toBe(helper.token!.symbol); + expect(billPayment.payload.type).toBe(TransactionPayloadType.MINTED_AIRDROP_CLAIM); + }); + for (let i = 0; i < drops.length; ++i) { + expect( + billPayments.find((bp) => { + if (dayjs(drops[i].vestingAt).isBefore(dayjs())) { + return bp.payload.vestingAt === null; + } + return ( + bp.payload.vestingAt && + dayjs(bp.payload.vestingAt.toDate()).isSame(dayjs(drops[i].vestingAt)) + ); + }), + ).toBeDefined(); + } + + await wait(async () => { + const snap = await build5Db() + .collection(COL.TRANSACTION) + .where('type', '==', TransactionType.CREDIT) + .where('member', 'in', [helper.guardian, helper.member]) + .get(); + return snap.length === 2; + }); + + const { amount } = await helper.walletService!.getBalance(guardianAddress.bech32); + expect(amount).toBe(5 * MIN_IOTA_AMOUNT); + + const member = await build5Db().doc(`${COL.MEMBER}/${helper.member}`).get(); + const memberAddress = await helper.walletService!.getAddressDetails( + getAddress(member, helper.network), + ); + + for (const hasTimelock of [false, true]) { + const outputs = await helper.walletService!.getOutputs( + memberAddress.bech32, + [], + false, + hasTimelock, + ); + const sum = Object.values(outputs).reduce( + (acc, act) => acc + Number(head(act?.nativeTokens)?.amount || 0), + 0, + ); + expect(sum).toBe(1); + } + + await awaitTransactionConfirmationsForToken(helper.token?.uid!); + + const tokenUid = helper.token?.uid; + + helper.token = await build5Db().doc(`${COL.TOKEN}/${tokenUid}`).get(); + expect(helper.token.mintingData?.tokensInVault).toBe(0); + + const statsDocRef = build5Db().doc(`${COL.TOKEN}/${tokenUid}/${SUB_COL.STATS}/${tokenUid}`); + const tokenStats = await statsDocRef.get(); + expect(tokenStats.stakes![stakeType]?.amount).toBe(1); + expect(tokenStats.stakes![stakeType]?.totalAmount).toBe(1); + expect(tokenStats.stakes![stakeType]?.value).toBe(1); + expect(tokenStats.stakes![stakeType]?.totalValue).toBe(1); + + distribution = await distributionDocRef.get(); + expect(distribution.stakes![stakeType]?.amount).toBe(1); + expect(distribution.stakes![stakeType]?.totalAmount).toBe(1); + expect(distribution.stakes![stakeType]?.value).toBe(1); + expect(distribution.stakes![stakeType]?.totalValue).toBe(1); + expect(distribution.totalUnclaimedAirdrop).toBe(0); + }); +}); diff --git a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1.spec.ts b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_b.spec.ts similarity index 68% rename from packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1.spec.ts rename to packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_b.spec.ts index 0a240286aa..894d25a04d 100644 --- a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1.spec.ts +++ b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_b.spec.ts @@ -8,7 +8,6 @@ import { StakeType, Token, TokenDistribution, - TokenDrop, TokenDropStatus, TokenStats, Transaction, @@ -42,9 +41,9 @@ describe('Minted token airdrop', () => { await helper.beforeEach(); }); - it.each([false, true])('Should drop and claim minted token', async (hasExpiration: boolean) => { - const expiresAt = hasExpiration ? dateToTimestamp(dayjs().add(2, 'h').toDate()) : undefined; - const stakeType = hasExpiration ? StakeType.STATIC : StakeType.DYNAMIC; + it('Should drop and claim minted token', async () => { + const expiresAt = dateToTimestamp(dayjs().add(2, 'h').toDate()); + const stakeType = StakeType.STATIC; const drops = [ { count: 1, @@ -209,83 +208,4 @@ describe('Minted token airdrop', () => { expect(distribution.stakes![stakeType]?.totalValue).toBe(1); expect(distribution.totalUnclaimedAirdrop).toBe(0); }); - - it('Multiplier should be max 2', async () => { - const stakeType = StakeType.DYNAMIC; - const drops = [ - { - count: 1, - recipient: helper.member!, - vestingAt: dayjs().add(6000, 'y').toDate(), - stakeType, - }, - ]; - mockWalletReturnValue(helper.walletSpy, helper.guardian!, { - token: helper.token!.uid, - drops, - }); - let order = await testEnv.wrap(airdropMintedToken)({}); - - const airdropQuery = build5Db().collection(COL.AIRDROP).where('member', '==', helper.member); - let airdropsSnap = await airdropQuery.get(); - expect(airdropsSnap.length).toBe(1); - const airdrop = airdropsSnap[0]; - expect(airdrop.vestingAt.toDate()).toEqual(drops[0].vestingAt); - expect(airdrop.count).toEqual(drops[0].count); - expect(airdrop.member).toEqual(drops[0].recipient); - expect(airdrop.stakeType).toEqual(drops[0].stakeType); - expect(airdrop.token).toEqual(helper.token?.uid!); - expect(airdrop.status).toEqual(TokenDropStatus.DEPOSIT_NEEDED); - - const guardianDocRef = build5Db().doc(`${COL.MEMBER}/${helper.guardian}`); - const guardian = await guardianDocRef.get(); - const guardianAddress = await helper.walletService!.getAddressDetails( - getAddress(guardian, helper.network), - ); - await requestFundsFromFaucet(helper.network, guardianAddress.bech32, 5 * MIN_IOTA_AMOUNT); - await requestMintedTokenFromFaucet( - helper.walletService!, - guardianAddress, - helper.token!.mintingData?.tokenId!, - VAULT_MNEMONIC, - 1, - ); - - await helper.walletService!.send(guardianAddress, order.payload.targetAddress, 0, { - nativeTokens: [{ id: helper.token?.mintingData?.tokenId!, amount: BigInt(1) }], - }); - - await wait(async () => { - const airdropsSnap = await airdropQuery.get(); - return airdropsSnap.length === 1 && airdropsSnap[0]?.status === TokenDropStatus.UNCLAIMED; - }); - - mockWalletReturnValue(helper.walletSpy, helper.member!, { - symbol: helper.token!.symbol, - }); - const claimOrder = await testEnv.wrap(claimMintedTokenOrder)({}); - await requestFundsFromFaucet( - helper.network, - claimOrder.payload.targetAddress, - claimOrder.payload.amount, - ); - - await wait(async () => { - const docRef = build5Db().doc(`${COL.TRANSACTION}/${order.uid}`); - order = await docRef.get(); - return order.payload.unclaimedAirdrops === 0; - }); - - await awaitTransactionConfirmationsForToken(helper.token!.uid); - - const distributionDocRef = build5Db().doc( - `${COL.TOKEN}/${helper.token!.uid}/${SUB_COL.DISTRIBUTION}/${helper.member}`, - ); - const distribution = await distributionDocRef.get(); - expect(distribution?.stakes![stakeType].value).toBe(2); - - airdropsSnap = await airdropQuery.get(); - expect(airdropsSnap.length).toBe(1); - expect((airdropsSnap[0]).status).toBe(TokenDropStatus.CLAIMED); - }); }); diff --git a/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.spec.ts b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.spec.ts new file mode 100644 index 0000000000..a8bdce7244 --- /dev/null +++ b/packages/functions/test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.spec.ts @@ -0,0 +1,116 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +import { + COL, + MIN_IOTA_AMOUNT, + Member, + SUB_COL, + StakeType, + TokenDistribution, + TokenDrop, + TokenDropStatus, + Transaction, +} from '@build-5/interfaces'; +import dayjs from 'dayjs'; +import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { + airdropMintedToken, + claimMintedTokenOrder, +} from '../../src/runtime/firebase/token/minting'; +import { getAddress } from '../../src/utils/address.utils'; +import { mockWalletReturnValue, wait } from '../../test/controls/common'; +import { testEnv } from '../../test/set-up'; +import { awaitTransactionConfirmationsForToken } from '../common'; +import { requestFundsFromFaucet, requestMintedTokenFromFaucet } from '../faucet'; +import { Helper, VAULT_MNEMONIC } from './Helper'; + +describe('Minted token airdrop', () => { + const helper = new Helper(); + + beforeAll(async () => { + await helper.berforeAll(); + }); + + beforeEach(async () => { + await helper.beforeEach(); + }); + + it('Multiplier should be max 2', async () => { + const stakeType = StakeType.DYNAMIC; + const drops = [ + { + count: 1, + recipient: helper.member!, + vestingAt: dayjs().add(6000, 'y').toDate(), + stakeType, + }, + ]; + mockWalletReturnValue(helper.walletSpy, helper.guardian!, { + token: helper.token!.uid, + drops, + }); + let order = await testEnv.wrap(airdropMintedToken)({}); + + const airdropQuery = build5Db().collection(COL.AIRDROP).where('member', '==', helper.member); + let airdropsSnap = await airdropQuery.get(); + expect(airdropsSnap.length).toBe(1); + const airdrop = airdropsSnap[0]; + expect(airdrop.vestingAt.toDate()).toEqual(drops[0].vestingAt); + expect(airdrop.count).toEqual(drops[0].count); + expect(airdrop.member).toEqual(drops[0].recipient); + expect(airdrop.stakeType).toEqual(drops[0].stakeType); + expect(airdrop.token).toEqual(helper.token?.uid!); + expect(airdrop.status).toEqual(TokenDropStatus.DEPOSIT_NEEDED); + + const guardianDocRef = build5Db().doc(`${COL.MEMBER}/${helper.guardian}`); + const guardian = await guardianDocRef.get(); + const guardianAddress = await helper.walletService!.getAddressDetails( + getAddress(guardian, helper.network), + ); + await requestFundsFromFaucet(helper.network, guardianAddress.bech32, 5 * MIN_IOTA_AMOUNT); + await requestMintedTokenFromFaucet( + helper.walletService!, + guardianAddress, + helper.token!.mintingData?.tokenId!, + VAULT_MNEMONIC, + 1, + ); + + await helper.walletService!.send(guardianAddress, order.payload.targetAddress, 0, { + nativeTokens: [{ id: helper.token?.mintingData?.tokenId!, amount: BigInt(1) }], + }); + + await wait(async () => { + const airdropsSnap = await airdropQuery.get(); + return airdropsSnap.length === 1 && airdropsSnap[0]?.status === TokenDropStatus.UNCLAIMED; + }); + + mockWalletReturnValue(helper.walletSpy, helper.member!, { + symbol: helper.token!.symbol, + }); + const claimOrder = await testEnv.wrap(claimMintedTokenOrder)({}); + await requestFundsFromFaucet( + helper.network, + claimOrder.payload.targetAddress, + claimOrder.payload.amount, + ); + + await wait(async () => { + const docRef = build5Db().doc(`${COL.TRANSACTION}/${order.uid}`); + order = await docRef.get(); + return order.payload.unclaimedAirdrops === 0; + }); + + await awaitTransactionConfirmationsForToken(helper.token!.uid); + + const distributionDocRef = build5Db().doc( + `${COL.TOKEN}/${helper.token!.uid}/${SUB_COL.DISTRIBUTION}/${helper.member}`, + ); + const distribution = await distributionDocRef.get(); + expect(distribution?.stakes![stakeType].value).toBe(2); + + airdropsSnap = await airdropQuery.get(); + expect(airdropsSnap.length).toBe(1); + expect((airdropsSnap[0]).status).toBe(TokenDropStatus.CLAIMED); + }); +}); diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_19.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_19.spec.ts new file mode 100644 index 0000000000..772dd7a180 --- /dev/null +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_19.spec.ts @@ -0,0 +1,111 @@ +import { + COL, + MIN_IOTA_AMOUNT, + Network, + TangleRequestType, + TokenTradeOrder, + Transaction, +} from '@build-5/interfaces'; + +import { build5Db } from '../../src/firebase/firestore/build5Db'; +import { wait } from '../../test/controls/common'; +import { awaitTransactionConfirmationsForToken, getTangleOrder } from '../common'; +import { requestFundsFromFaucet, requestMintedTokenFromFaucet } from '../faucet'; +import { Helper, VAULT_MNEMONIC } from './Helper'; + +describe('Minted toke trading tangle request', () => { + const helper = new Helper(); + let tangleOrder: Transaction; + + beforeAll(async () => { + await helper.berforeAll(); + tangleOrder = await getTangleOrder(Network.RMS); + }); + + beforeEach(async () => { + await helper.beforeEach(); + }); + + it('Should create purchase, custom target address', async () => { + const faucetPromises = [ + requestFundsFromFaucet(Network.RMS, helper.sellerAddress!.bech32, MIN_IOTA_AMOUNT), + requestFundsFromFaucet(Network.RMS, helper.buyerAddress!.bech32, 5 * MIN_IOTA_AMOUNT), + requestMintedTokenFromFaucet( + helper.walletService!, + helper.sellerAddress!, + helper.token!.mintingData?.tokenId!, + VAULT_MNEMONIC, + ), + ]; + await Promise.all(faucetPromises); + + const sellerTargetAddress = await helper.walletService!.getNewIotaAddressDetails(); + helper.walletService!.send( + helper.sellerAddress!, + tangleOrder.payload.targetAddress!, + MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.SELL_TOKEN, + symbol: helper.token!.symbol, + price: MIN_IOTA_AMOUNT, + targetAddress: sellerTargetAddress.bech32, + }, + }, + nativeTokens: [{ id: helper.token?.mintingData?.tokenId!, amount: BigInt(5) }], + }, + ); + + const buyerTargetAddress = await helper.walletService!.getNewIotaAddressDetails(); + helper.walletService!.send( + helper.buyerAddress!, + tangleOrder.payload.targetAddress!, + 5 * MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.BUY_TOKEN, + symbol: helper.token!.symbol, + count: 5, + price: MIN_IOTA_AMOUNT, + targetAddress: buyerTargetAddress.bech32, + }, + }, + }, + ); + + let query = build5Db().collection(COL.TOKEN_MARKET).where('owner', '==', helper.seller); + await wait(async () => { + const snap = await query.get(); + return snap.length > 0; + }); + const sell = (await query.get())[0]!; + + query = build5Db().collection(COL.TOKEN_MARKET).where('owner', '==', helper.buyer); + await wait(async () => { + const snap = await query.get(); + return snap.length > 0; + }); + const buy = (await query.get())[0]!; + + query = build5Db() + .collection(COL.TOKEN_PURCHASE) + .where('sell', '==', sell.uid) + .where('buy', '==', buy.uid); + await wait(async () => { + const snap = await query.get(); + return snap.length > 0; + }); + + await awaitTransactionConfirmationsForToken(helper.token?.uid!); + + const balance = await helper.walletService!.getBalance(buyerTargetAddress.bech32); + expect(balance.nativeTokens[helper.token?.mintingData?.tokenId!]).toBe(5); + + const { amount: sellerAmount } = await helper.walletService!.getBalance( + sellerTargetAddress.bech32, + ); + expect(sellerAmount).toBe(4727600); + }); +}); diff --git a/packages/interfaces/src/api/tangle/TokenTradeTangleRequest.ts b/packages/interfaces/src/api/tangle/TokenTradeTangleRequest.ts index 32338ff12b..f4d0bb5e9d 100644 --- a/packages/interfaces/src/api/tangle/TokenTradeTangleRequest.ts +++ b/packages/interfaces/src/api/tangle/TokenTradeTangleRequest.ts @@ -23,6 +23,10 @@ export interface TradeTokenTangleRequest { * Symbol of the token to trade. */ symbol: string; + /** + * Funds will be sent here in case of a successfull trade. + */ + targetAddress?: string; /** * Direction of the trade. */ diff --git a/packages/interfaces/src/errors.ts b/packages/interfaces/src/errors.ts index 3470acaef6..7c634972fd 100644 --- a/packages/interfaces/src/errors.ts +++ b/packages/interfaces/src/errors.ts @@ -305,4 +305,5 @@ export const WenError = { code: 2138, key: 'Invalid collection id.', }, + invalid_target_address: { code: 2139, key: 'Invalid target address.' }, }; diff --git a/packages/interfaces/src/models/token.ts b/packages/interfaces/src/models/token.ts index 26f1ee4641..298f4d63c2 100644 --- a/packages/interfaces/src/models/token.ts +++ b/packages/interfaces/src/models/token.ts @@ -611,6 +611,10 @@ export interface TokenTradeOrder extends BaseRecord { * TODODOC */ readonly targetNetwork?: Network; + /** + * TODODOC + */ + readonly targetAddress?: string; } /** diff --git a/packages/interfaces/src/models/transaction/payload.ts b/packages/interfaces/src/models/transaction/payload.ts index be2f431ba2..6f10a1ca84 100644 --- a/packages/interfaces/src/models/transaction/payload.ts +++ b/packages/interfaces/src/models/transaction/payload.ts @@ -145,4 +145,6 @@ export interface TransactionPayload { tanglePuchase?: boolean; disableWithdraw?: boolean; + + tokenTradeOderTargetAddress?: string; }