From 796f5f2bbcfb80c45a9af5032b9046696e04c90f Mon Sep 17 00:00:00 2001 From: Boldizsar Mezei Date: Wed, 13 Dec 2023 12:56:07 +0200 Subject: [PATCH 1/3] Market buy sell with OTR Fixes --- ...ions_tangle-online-unit-tests_emulator.yml | 448 ++++++++++------- .../workflows/functions_tangle-unit-tests.yml | 456 +++++++++++------- .vscode/settings.json | 2 +- .../token/TokenTradeTangleRequestSchema.ts | 4 +- .../token/token-trade.service.ts | 63 ++- .../payment/token/token-trade.service.ts | 66 ++- .../token-trading/match-base-token.ts | 17 +- .../token-trading/match-minted-token.ts | 13 +- .../src/triggers/token-trading/match-token.ts | 4 +- .../base-token-trading_14.spec.ts | 96 ++++ .../base-token-trading_15.spec.ts | 95 ++++ .../base-token-trading_16.spec.ts | 96 ++++ .../base-token-trading_17.spec.ts | 93 ++++ .../minted-token-trade_21.spec.ts | 78 +++ .../minted-token-trade_22.spec.ts | 74 +++ .../minted-token-trade_23.spec.ts | 76 +++ .../minted-token-trade_24.spec.ts | 73 +++ packages/interfaces/src/errors.ts | 4 + .../search/tangle/TokenTradeTangleRequest.ts | 4 +- 19 files changed, 1358 insertions(+), 404 deletions(-) create mode 100644 packages/functions/test-tangle/base-token-trading/base-token-trading_14.spec.ts create mode 100644 packages/functions/test-tangle/base-token-trading/base-token-trading_15.spec.ts create mode 100644 packages/functions/test-tangle/base-token-trading/base-token-trading_16.spec.ts create mode 100644 packages/functions/test-tangle/base-token-trading/base-token-trading_17.spec.ts create mode 100644 packages/functions/test-tangle/minted-token-trade/minted-token-trade_21.spec.ts create mode 100644 packages/functions/test-tangle/minted-token-trade/minted-token-trade_22.spec.ts create mode 100644 packages/functions/test-tangle/minted-token-trade/minted-token-trade_23.spec.ts create mode 100644 packages/functions/test-tangle/minted-token-trade/minted-token-trade_24.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 e545c136da..14880be2b4 100644 --- a/.github/workflows/functions_tangle-online-unit-tests_emulator.yml +++ b/.github/workflows/functions_tangle-online-unit-tests_emulator.yml @@ -388,8 +388,8 @@ jobs: npm run milestone-sync & firebase emulators:exec " 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 && - 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_14.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_15.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/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 && - 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_16.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_17.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 @@ -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/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 && - 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/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 @@ -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_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_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 @@ -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/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_4_a.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 @@ -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/collection-minting/collection-minting_4_b.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4_c.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_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 @@ -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/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 + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4_a.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4_b.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4_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 @@ -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/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 + 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/collection-minting/collection-minting_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 @@ -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/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 + 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/metadata-nft/mint-metadata-nft_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 @@ -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/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 + 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/metadata-nft/mint-metadata-nft_3_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/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 + 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 " --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-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 + 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 " --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-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 + 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 " --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-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 + 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 " --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-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 + 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 " --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-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 + 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_a.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_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 @@ -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-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 + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.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 " --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-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 + 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-token-claim/token.claim.minted_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 @@ -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-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 + 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-token-claim/token.claim.minted_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 @@ -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_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 + 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-trade/minted-token-trade_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 @@ -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_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 + 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-trade/minted-token-trade_12_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 @@ -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/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 + 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-trade/minted-token-trade_14_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 @@ -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/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_b.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_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-trade/minted-token-trade_17.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/minted-token-trade/minted-token-trade_20.spec.ts && - 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_18.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_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 @@ -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/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 && - 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_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_20.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_21.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/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 && - 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/minted-token-trade/minted-token-trade_22.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_23.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_24.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/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 && - 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/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 " --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/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 && - 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/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 " --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/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 && - 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/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 " --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/nft-staking/nft-staking_3.spec.ts && - 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-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 " --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/nft-staking/nft-staking_6.spec.ts && - 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/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 " --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/nft-staking/nft-staking_9.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 + 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 " --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/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 + 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 " --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/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 + 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/nft-staking/nft-staking_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 @@ -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/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 + 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 && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.simple.vote.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/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 + 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 && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.accept.member.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/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 + 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 && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.decline.member.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/stamp-tangle/stamp-tangle_1.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_2.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_3.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 && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.leave.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/stamp-tangle/stamp-tangle_4.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_5.spec.ts && - npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_6.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 && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_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 @@ -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/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 + 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 && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_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 @@ -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/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 + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_2.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_3.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_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 @@ -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/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 + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_5.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_6.spec.ts && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/tangleRequest/simple.token.trade.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/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 + 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 && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token-import/token.import_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 @@ -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/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 + 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 && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_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 @@ -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/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 + 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 && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_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 @@ -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/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 + 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 && + npm run test-tangle-online:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_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 @@ -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/transaction-trigger/transaction-trigger_14.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.mint/token.mint_4.spec.ts && + 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 " --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/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/transaction-trigger/transaction-trigger_1.spec.ts && + 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 " --project dev --only functions,firestore,storage,ui,auth --export-on-exit=./firestore-data - name: Archive firestore data uses: actions/upload-artifact@v3 @@ -2163,9 +2163,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/transaction-trigger/transaction-trigger_12.spec.ts && + 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_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 @@ -2200,9 +2200,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_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 @@ -2237,9 +2237,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_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 @@ -2274,9 +2274,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_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 @@ -2311,9 +2311,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/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 @@ -2348,9 +2348,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/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 @@ -2385,9 +2385,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_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 @@ -2422,9 +2422,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_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 @@ -2459,7 +2459,117 @@ 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_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_65 + path: ./packages/functions/firestore-data/ + retention-days: 1 + chunk_66: + needs: npm-install + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.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_66 + path: ./packages/functions/firestore-data/ + retention-days: 1 + chunk_67: + needs: npm-install + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.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_67 + path: ./packages/functions/firestore-data/ + retention-days: 1 + chunk_68: + needs: npm-install + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.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 @@ -2467,6 +2577,6 @@ jobs: uses: actions/upload-artifact@v3 if: ${{ failure() }} with: - name: firestore-data-test-tangle-online-chunk_65 + name: firestore-data-test-tangle-online-chunk_68 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 00a1671cdb..c4b07f00ba 100644 --- a/.github/workflows/functions_tangle-unit-tests.yml +++ b/.github/workflows/functions_tangle-unit-tests.yml @@ -386,8 +386,8 @@ jobs: npm run milestone-sync & firebase emulators:exec " 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 && - 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_14.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_15.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/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 && - 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_16.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/base-token-trading/base-token-trading_17.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 @@ -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/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 && - 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/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 @@ -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_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_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 @@ -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/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_4_a.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 @@ -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/collection-minting/collection-minting_4_b.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4_c.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_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 @@ -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/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 + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4_a.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4_b.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/collection-minting/collection-minting_4_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 @@ -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/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 + 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/collection-minting/collection-minting_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 @@ -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/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 + 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/metadata-nft/mint-metadata-nft_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 @@ -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/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 + 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/metadata-nft/mint-metadata-nft_3_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/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 + 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 " --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-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 + 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 " --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-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 + 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 " --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-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 + 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 " --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-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 + 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 " --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-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 + 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_a.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_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 @@ -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-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 + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-airdrop/minted-token-airdrop_1_c.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 " --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-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 + 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-token-claim/token.claim.minted_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 @@ -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-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 + 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-token-claim/token.claim.minted_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 @@ -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_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 + 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-trade/minted-token-trade_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 @@ -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_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 + 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-trade/minted-token-trade_12_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 @@ -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/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 + 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-trade/minted-token-trade_14_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 @@ -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/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_b.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_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-trade/minted-token-trade_17.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/minted-token-trade/minted-token-trade_20.spec.ts && - 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_18.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_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 @@ -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/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 && - 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_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_20.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_21.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/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 && - 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/minted-token-trade/minted-token-trade_22.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_23.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/minted-token-trade/minted-token-trade_24.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/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 && - 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/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 " --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/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 && - 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/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 " --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/nft-staking/nft-staking_1.spec.ts && - 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/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 " --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/nft-staking/nft-staking_3.spec.ts && - 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-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 " --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/nft-staking/nft-staking_6.spec.ts && - 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/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 " --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/nft-staking/nft-staking_9.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 + 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 " --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/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 + 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 " --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/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 + 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/nft-staking/nft-staking_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 @@ -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/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 + 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 && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/proposal-tangle/proposal.simple.vote.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/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 + 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 && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.accept.member.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/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 + 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 && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.decline.member.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/stamp-tangle/stamp-tangle_1.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_2.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_3.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 && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/space-tangle/space.leave.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/stamp-tangle/stamp-tangle_4.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_5.spec.ts && - npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_6.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 && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/staking/staking_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 @@ -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/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 + 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 && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_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 @@ -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/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 + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_2.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_3.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_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 @@ -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/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 + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_5.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/stamp-tangle/stamp-tangle_6.spec.ts && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/tangleRequest/simple.token.trade.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/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 + 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 && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token-import/token.import_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 @@ -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/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 + 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 && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_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 @@ -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/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 + 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 && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.based.voting/token.based.voting_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 @@ -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/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 + 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 && + npm run test-tangle:ci -- --forceExit --findRelatedTests ./test-tangle/token.mint/token.mint_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 @@ -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/transaction-trigger/transaction-trigger_14.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.mint/token.mint_4.spec.ts && + 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 " --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/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/transaction-trigger/transaction-trigger_1.spec.ts && + 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 " --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/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/transaction-trigger/transaction-trigger_12.spec.ts && + 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_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 @@ -2198,9 +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/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_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 @@ -2235,9 +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/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_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 @@ -2272,9 +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/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_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 @@ -2309,9 +2309,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/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 @@ -2346,9 +2346,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/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 @@ -2383,9 +2383,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_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 @@ -2420,9 +2420,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_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 @@ -2457,9 +2457,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_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 @@ -2494,7 +2494,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_3.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 @@ -2529,7 +2531,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_11.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 @@ -2564,7 +2568,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-token-trade/minted-token-trade_15.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 @@ -2573,3 +2578,108 @@ jobs: name: firestore-data-test-tangle-chunk_68 path: ./packages/functions/firestore-data/ retention-days: 1 + chunk_69: + needs: npm-install + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.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/collection-minting/collection-minting_3.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_69 + path: ./packages/functions/firestore-data/ + retention-days: 1 + chunk_70: + needs: npm-install + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.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-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 + if: ${{ failure() }} + with: + name: firestore-data-test-tangle-chunk_70 + path: ./packages/functions/firestore-data/ + retention-days: 1 + chunk_71: + needs: npm-install + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.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_71 + path: ./packages/functions/firestore-data/ + retention-days: 1 diff --git a/.vscode/settings.json b/.vscode/settings.json index a40188cc68..c03524986c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" 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 6aee81886e..4a55af2d2a 100644 --- a/packages/functions/src/services/payment/tangle-service/token/TokenTradeTangleRequestSchema.ts +++ b/packages/functions/src/services/payment/tangle-service/token/TokenTradeTangleRequestSchema.ts @@ -21,9 +21,9 @@ export const tradeMintedTokenSchema = toJoiObject({ .min(MIN_PRICE_PER_TOKEN) .max(MAX_PRICE) .precision(6) - .required() + .optional() .description( - `Pirce of the token to trade. Minimum ${MIN_PRICE_PER_TOKEN}, maximum: ${MAX_PRICE}.`, + `Price of the token to trade. Minimum ${MIN_PRICE_PER_TOKEN}, maximum: ${MAX_PRICE}.`, ), count: Joi.number() .min(MIN_COUNT) 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 13cf236f52..4a7126cd8d 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 @@ -2,6 +2,8 @@ import { ITransaction, build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, + MAX_TOTAL_TOKEN_SUPPLY, + MIN_PRICE_PER_TOKEN, Member, Network, SUB_COL, @@ -13,6 +15,7 @@ import { TokenTradeOrder, TokenTradeOrderStatus, TokenTradeOrderType, + TradeTokenTangleRequest, Transaction, TransactionPayloadType, TransactionType, @@ -22,9 +25,8 @@ import { } from '@build-5/interfaces'; import dayjs from 'dayjs'; import bigDecimal from 'js-big-decimal'; -import { set } from 'lodash'; +import { head, set } from 'lodash'; import { assertMemberHasValidAddress } from '../../../../utils/address.utils'; -import { packBasicOutput } from '../../../../utils/basic-output.utils'; import { getProject } from '../../../../utils/common.utils'; import { isProdEnv } from '../../../../utils/config.utils'; import { dateToTimestamp } from '../../../../utils/dateTime.utils'; @@ -73,8 +75,8 @@ export class TangleTokenTradeService extends BaseTangleService { owner, token, type, - params.count || 0, - params.price, + getCount(params, type), + await getPrice(params, type, token.uid), params.targetAddress, '', [TokenStatus.BASE, TokenStatus.MINTED], @@ -113,6 +115,7 @@ const ACCEPTED_TOKEN_STATUSES = [ TokenStatus.MINTED, TokenStatus.BASE, ]; + export const createTokenTradeOrder = async ( project: string, transaction: ITransaction, @@ -232,12 +235,12 @@ const createTradeOrderTransaction = async ( network, payload: { type: isSell ? TransactionPayloadType.SELL_TOKEN : TransactionPayloadType.BUY_TOKEN, - amount: await getAmount(token, count, price, isSell), + amount: getAmount(token, count, price, isSell), nativeTokens: - isMinted && isSell ? [{ id: token.mintingData?.tokenId!, amount: BigInt(count) }] : [], + isMinted && isSell ? [{ id: token.mintingData?.tokenId!, amount: BigInt(0) }] : [], targetAddress: targetAddress.bech32, expiresOn: dateToTimestamp(dayjs().add(TRANSACTION_MAX_EXPIRY_MS)), - validationType: getValidationType(token, isSell), + validationType: TransactionValidationType.ADDRESS, reconciled: false, void: false, chainReference: null, @@ -253,21 +256,45 @@ const createTradeOrderTransaction = async ( return order; }; -const getAmount = async (token: Token, count: number, price: number, isSell: boolean) => { +const getPrice = async ( + params: TradeTokenTangleRequest, + type: TokenTradeOrderType, + token: string, +) => { + if (params.price) { + return params.price; + } + if (type === TokenTradeOrderType.SELL) { + return MIN_PRICE_PER_TOKEN; + } + + const snap = await build5Db() + .collection(COL.TOKEN_MARKET) + .where('token', '==', token) + .where('status', '==', TokenTradeOrderStatus.ACTIVE) + .orderBy('price', 'desc') + .limit(1) + .get(); + const highestSell = head(snap); + if (!highestSell) { + throw invalidArgument(WenError.no_active_sells); + } + return highestSell.price; +}; + +const getCount = (params: TradeTokenTangleRequest, type: TokenTradeOrderType) => { + if (type === TokenTradeOrderType.BUY) { + return params.count || MAX_TOTAL_TOKEN_SUPPLY; + } + return params.count || 0; +}; + +const getAmount = (token: Token, count: number, price: number, isSell: boolean) => { if (!isSell) { return Number(bigDecimal.floor(bigDecimal.multiply(count, price))); } if (token.status !== TokenStatus.MINTED) { return count; } - const wallet = await WalletService.newWallet(token.mintingData?.network); - const tmpAddress = await wallet.getNewIotaAddressDetails(false); - const nativeTokens = [{ amount: BigInt(count), id: token.mintingData?.tokenId! }]; - const output = await packBasicOutput(wallet, tmpAddress.bech32, 0, { nativeTokens }); - return Number(output.amount); + return 0; }; - -const getValidationType = (token: Token, isSell: boolean) => - isSell && token.status === TokenStatus.MINTED - ? TransactionValidationType.ADDRESS - : TransactionValidationType.ADDRESS_AND_AMOUNT; diff --git a/packages/functions/src/services/payment/token/token-trade.service.ts b/packages/functions/src/services/payment/token/token-trade.service.ts index 5fd253bbe4..3aacb40e5c 100644 --- a/packages/functions/src/services/payment/token/token-trade.service.ts +++ b/packages/functions/src/services/payment/token/token-trade.service.ts @@ -2,6 +2,8 @@ import { build5Db } from '@build-5/database'; import { COL, DEFAULT_NETWORK, + MAX_TOTAL_TOKEN_SUPPLY, + MilestoneTransactionEntry, NativeToken, SUB_COL, TRANSACTION_MAX_EXPIRY_MS, @@ -10,11 +12,12 @@ import { TokenTradeOrder, TokenTradeOrderStatus, TokenTradeOrderType, + Transaction, TransactionPayloadType, getNetworkPair, } from '@build-5/interfaces'; import dayjs from 'dayjs'; -import { get, head, set } from 'lodash'; +import { get, head, isEqual, set } from 'lodash'; import { dateToTimestamp } from '../../../utils/dateTime.utils'; import { getRandomEthAddress } from '../../../utils/wallet.utils'; import { BaseService, HandlerParams } from '../base'; @@ -29,11 +32,12 @@ export class TokenTradeService extends BaseService { }: HandlerParams) => { const payment = await this.transactionService.createPayment(order, match); - const nativeTokenId = head(order.payload.nativeTokens as NativeToken[])?.id; - const nativeTokens = nativeTokenId - ? Number(tranEntry.nativeTokens?.find((n) => n.id === nativeTokenId)?.amount || 0) - : 0; - if (nativeTokenId && (!nativeTokens || (tranEntry.nativeTokens?.length || 0) > 1)) { + const expectedNativeTokenIds = [head(order.payload.nativeTokens as NativeToken[])?.id].filter( + (n) => n !== undefined, + ); + const receivedNativeTokenIds = tranEntry.nativeTokens?.map((n) => n.id); + + if (!isEqual(expectedNativeTokenIds, receivedNativeTokenIds)) { await this.transactionService.createCredit( TransactionPayloadType.INVALID_AMOUNT, payment, @@ -42,24 +46,30 @@ export class TokenTradeService extends BaseService { return; } this.transactionService.markAsReconciled(order, match.msgId); + const nativeTokens = Number(head(tranEntry.nativeTokens)?.amount); await this.createDistributionDocRef(order.payload.token!, order.member!); const token = await build5Db().doc(`${COL.TOKEN}/${order.payload.token}`).get(); const network = order.network || DEFAULT_NETWORK; + + const type = + order.payload.type === TransactionPayloadType.SELL_TOKEN + ? TokenTradeOrderType.SELL + : TokenTradeOrderType.BUY; + const price = get(order, 'payload.price', 0); + const count = getCount(order, tranEntry, type); + const data: TokenTradeOrder = { project, uid: getRandomEthAddress(), owner: order.member!, token: token.uid, tokenStatus: token.status, - type: - order.payload.type === TransactionPayloadType.SELL_TOKEN - ? TokenTradeOrderType.SELL - : TokenTradeOrderType.BUY, - count: nativeTokens || get(order, 'payload.count', 0), - price: get(order, 'payload.price', 0), - totalDeposit: nativeTokens || order.payload.amount || 0, - balance: nativeTokens || order.payload.amount || 0, + type, + count, + price, + totalDeposit: nativeTokens || match.to.amount || 0, + balance: nativeTokens || match.to.amount || 0, fulfilled: 0, status: TokenTradeOrderStatus.ACTIVE, orderTransactionId: order.uid, @@ -77,17 +87,12 @@ export class TokenTradeService extends BaseService { const ref = build5Db().doc(`${COL.TOKEN_MARKET}/${data.uid}`); this.transactionService.push({ ref, data, action: 'set' }); - if ( - order.payload.type === TransactionPayloadType.SELL_TOKEN && - token.status === TokenStatus.MINTED - ) { - const orderDocRef = build5Db().doc(`${COL.TRANSACTION}/${order.uid}`); - this.transactionService.push({ - ref: orderDocRef, - data: { 'payload.amount': match.to.amount }, - action: 'update', - }); - } + const orderDocRef = build5Db().doc(`${COL.TRANSACTION}/${order.uid}`); + this.transactionService.push({ + ref: orderDocRef, + data: { 'payload.amount': match.to.amount, 'payload.count': count }, + action: 'update', + }); }; private createDistributionDocRef = async (token: string, member: string) => { @@ -110,3 +115,14 @@ export class TokenTradeService extends BaseService { } }; } + +const getCount = ( + order: Transaction, + tranEntry: MilestoneTransactionEntry, + type: TokenTradeOrderType, +) => { + if (type === TokenTradeOrderType.SELL) { + return Number(head(tranEntry.nativeTokens)?.amount || 0) || tranEntry.amount; + } + return get(order, 'payload.count', MAX_TOTAL_TOKEN_SUPPLY); +}; 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 5f4d554f91..5f2d0a8f16 100644 --- a/packages/functions/src/triggers/token-trading/match-base-token.ts +++ b/packages/functions/src/triggers/token-trading/match-base-token.ts @@ -2,7 +2,6 @@ import { ITransaction, build5Db } from '@build-5/database'; import { COL, Entity, - MIN_IOTA_AMOUNT, Member, Space, Token, @@ -33,11 +32,11 @@ const createIotaPayments = async ( buyer: Member, count: number, ): Promise => { - if (count < MIN_IOTA_AMOUNT) { - return []; - } const balance = sell.balance - count; - if (balance !== 0 && balance < MIN_IOTA_AMOUNT) { + const wallet = await WalletService.newWallet(sell.sourceNetwork!); + const tmpAddress = await wallet.getNewIotaAddressDetails(false); + const remainder = await packBasicOutput(wallet, tmpAddress.bech32, balance, {}); + if (balance !== 0 && balance < Number(remainder.amount)) { return []; } const sellOrder = await build5Db() @@ -156,9 +155,9 @@ const createSmrPayments = async ( .doc(`${COL.TRANSACTION}/${buy.orderTransactionId}`) .get(); - const fulfilled = buy.fulfilled + tokensToTrade === buy.count; let salePrice = Number(bigDecimal.floor(bigDecimal.multiply(price, tokensToTrade))); let balanceLeft = buy.balance - salePrice; + const fulfilled = buy.fulfilled + tokensToTrade === buy.count || balanceLeft === 0; if (balanceLeft < 0) { return []; @@ -252,7 +251,11 @@ export const matchBaseToken = async ( price: number, triggeredBy: TokenTradeOrderType, ): Promise => { - const tokensToTrade = Math.min(sell.count - sell.fulfilled, buy.count - buy.fulfilled); + const tokensToTrade = Math.min( + sell.count - sell.fulfilled, + buy.count - buy.fulfilled, + Math.floor(buy.balance / price), + ); const seller = await build5Db().doc(`${COL.MEMBER}/${sell.owner}`).get(); const buyer = await build5Db().doc(`${COL.MEMBER}/${buy.owner}`).get(); 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 4b456b88e7..50f80fdf14 100644 --- a/packages/functions/src/triggers/token-trading/match-minted-token.ts +++ b/packages/functions/src/triggers/token-trading/match-minted-token.ts @@ -26,7 +26,6 @@ import { getMemberTier, getTokenTradingFee } from './token-trade-order.trigger'; const createRoyaltyBillPayments = async ( wallet: Wallet, token: Token, - sell: TokenTradeOrder, buy: TokenTradeOrder, seller: Member, buyer: Member, @@ -200,7 +199,6 @@ const createCreditToSeller = ( const createCreditToBuyer = ( token: Token, buyer: Member, - sell: TokenTradeOrder, buy: TokenTradeOrder, buyOrderTran: Transaction, amount: number, @@ -250,10 +248,14 @@ export const matchMintedToken = async ( .doc(`${COL.TRANSACTION}/${sell.orderTransactionId}`) .get())!; - const tokensToTrade = Math.min(sell.count - sell.fulfilled, buy.count - buy.fulfilled); - const buyIsFulfilled = buy.fulfilled + tokensToTrade === buy.count; + const tokensToTrade = Math.min( + sell.count - sell.fulfilled, + buy.count - buy.fulfilled, + Math.floor(buy.balance / price), + ); let salePrice = Number(bigDecimal.floor(bigDecimal.multiply(price, tokensToTrade))); let balanceLeft = buy.balance - salePrice; + const buyIsFulfilled = buy.fulfilled + tokensToTrade === buy.count || balanceLeft === 0; if (balanceLeft < 0) { return { purchase: undefined, sellerCreditId: undefined, buyerCreditId: undefined }; @@ -274,7 +276,6 @@ export const matchMintedToken = async ( const royaltyBillPayments = await createRoyaltyBillPayments( wallet, token, - sell, buy, seller, buyer, @@ -322,7 +323,7 @@ export const matchMintedToken = async ( const creditToBuyer = buyIsFulfilled && balanceLeft - ? createCreditToBuyer(token, buyer, sell, buy, buyOrderTran, balanceLeft) + ? createCreditToBuyer(token, buyer, buy, buyOrderTran, balanceLeft) : undefined; [ diff --git a/packages/functions/src/triggers/token-trading/match-token.ts b/packages/functions/src/triggers/token-trading/match-token.ts index 043191815c..ea0df2664a 100644 --- a/packages/functions/src/triggers/token-trading/match-token.ts +++ b/packages/functions/src/triggers/token-trading/match-token.ts @@ -143,7 +143,9 @@ const updateTrade = (trade: TokenTradeOrder, purchase: TokenPurchase, creditTran const balance = trade.balance - (trade.type === TokenTradeOrderType.SELL ? purchase.count : salePrice); const status = - trade.count === fulfilled ? TokenTradeOrderStatus.SETTLED : TokenTradeOrderStatus.ACTIVE; + trade.count === fulfilled || !balance + ? TokenTradeOrderStatus.SETTLED + : TokenTradeOrderStatus.ACTIVE; return { ...trade, fulfilled, balance, status, creditTransactionId }; }; diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_14.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_14.spec.ts new file mode 100644 index 0000000000..88bf95b2e6 --- /dev/null +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_14.spec.ts @@ -0,0 +1,96 @@ +import { build5Db } from '@build-5/database'; +import { + COL, + MAX_TOTAL_TOKEN_SUPPLY, + MIN_IOTA_AMOUNT, + Network, + TangleRequestType, + TokenTradeOrder, + TokenTradeOrderStatus, + TokenTradeOrderType, + Transaction, +} from '@build-5/interfaces'; +import { tradeToken } from '../../src/runtime/firebase/token/trading'; +import { mockWalletReturnValue, wait } from '../../test/controls/common'; +import { testEnv } from '../../test/set-up'; +import { getTangleOrder } from '../common'; +import { requestFundsFromFaucet } from '../faucet'; +import { Helper } from './Helper'; + +describe('Base token trading', () => { + const helper = new Helper(); + let rmsTangleOrder: Transaction; + + beforeEach(async () => { + await helper.beforeEach(); + }); + + it('Should create market buy with tangle request, settle it, no balance', async () => { + mockWalletReturnValue(helper.walletSpy, helper.seller!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 2, + type: TokenTradeOrderType.SELL, + }); + let sellOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + sellOrder.payload.targetAddress, + MIN_IOTA_AMOUNT, + ); + + mockWalletReturnValue(helper.walletSpy, helper.seller!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 4, + type: TokenTradeOrderType.SELL, + }); + sellOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + sellOrder.payload.targetAddress, + MIN_IOTA_AMOUNT, + ); + + rmsTangleOrder = await getTangleOrder(Network.RMS); + const rmsAddress = helper.buyerValidateAddress[Network.RMS]; + await requestFundsFromFaucet(helper.targetNetwork, rmsAddress.bech32, 4 * MIN_IOTA_AMOUNT); + + await helper.rmsWallet!.send( + rmsAddress, + rmsTangleOrder.payload.targetAddress!, + 4 * MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.BUY_TOKEN, + symbol: helper.token?.symbol!, + }, + }, + }, + ); + + const query = build5Db().collection(COL.TOKEN_MARKET).where('owner', '==', helper.buyer!.uid); + await wait(async () => { + const snap = await query.get(); + return snap.length === 1 && snap[0].status === TokenTradeOrderStatus.SETTLED; + }); + const buyOrder = (await query.get())[0]; + + expect(buyOrder.count).toBe(MAX_TOTAL_TOKEN_SUPPLY); + expect(buyOrder.fulfilled).toBe(1.5 * MIN_IOTA_AMOUNT); + expect(buyOrder.balance).toBe(0); + + const sellOrders = await build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', helper.seller?.uid) + .where('type', '==', TokenTradeOrderType.SELL) + .get(); + sellOrders.sort((a, b) => a.price - b.price); + + expect(sellOrders[0].price).toBe(2); + expect(sellOrders[0].fulfilled).toBe(MIN_IOTA_AMOUNT); + expect(sellOrders[1].price).toBe(4); + expect(sellOrders[1].fulfilled).toBe(0.5 * MIN_IOTA_AMOUNT); + }); +}); diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_15.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_15.spec.ts new file mode 100644 index 0000000000..6620f12d3c --- /dev/null +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_15.spec.ts @@ -0,0 +1,95 @@ +import { build5Db } from '@build-5/database'; +import { + COL, + MAX_TOTAL_TOKEN_SUPPLY, + MIN_IOTA_AMOUNT, + Network, + TangleRequestType, + TokenTradeOrder, + TokenTradeOrderType, + Transaction, +} from '@build-5/interfaces'; +import { tradeToken } from '../../src/runtime/firebase/token/trading'; +import { mockWalletReturnValue, wait } from '../../test/controls/common'; +import { testEnv } from '../../test/set-up'; +import { getTangleOrder } from '../common'; +import { requestFundsFromFaucet } from '../faucet'; +import { Helper } from './Helper'; + +describe('Base token trading', () => { + const helper = new Helper(); + let rmsTangleOrder: Transaction; + + beforeEach(async () => { + await helper.beforeEach(); + }); + + it('Should create market buy with tangle request,do not settle it', async () => { + mockWalletReturnValue(helper.walletSpy, helper.seller!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 2, + type: TokenTradeOrderType.SELL, + }); + let sellOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + sellOrder.payload.targetAddress, + MIN_IOTA_AMOUNT, + ); + + mockWalletReturnValue(helper.walletSpy, helper.seller!.uid, { + symbol: helper.token!.symbol, + count: MIN_IOTA_AMOUNT, + price: 4, + type: TokenTradeOrderType.SELL, + }); + sellOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + sellOrder.payload.targetAddress, + MIN_IOTA_AMOUNT, + ); + + rmsTangleOrder = await getTangleOrder(Network.RMS); + const rmsAddress = helper.buyerValidateAddress[Network.RMS]; + await requestFundsFromFaucet(helper.targetNetwork, rmsAddress.bech32, 7 * MIN_IOTA_AMOUNT); + + await helper.rmsWallet!.send( + rmsAddress, + rmsTangleOrder.payload.targetAddress!, + 7 * MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.BUY_TOKEN, + symbol: helper.token?.symbol!, + }, + }, + }, + ); + + const query = build5Db().collection(COL.TOKEN_MARKET).where('owner', '==', helper.buyer!.uid); + await wait(async () => { + const snap = await query.get(); + return snap.length === 1 && snap[0].fulfilled === 2 * MIN_IOTA_AMOUNT; + }); + const buyOrder = (await query.get())[0]; + + expect(buyOrder.count).toBe(MAX_TOTAL_TOKEN_SUPPLY); + expect(buyOrder.fulfilled).toBe(2 * MIN_IOTA_AMOUNT); + expect(buyOrder.balance).toBe(MIN_IOTA_AMOUNT); + + const sellOrders = await build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', helper.seller?.uid) + .where('type', '==', TokenTradeOrderType.SELL) + .get(); + sellOrders.sort((a, b) => a.price - b.price); + + expect(sellOrders[0].price).toBe(2); + expect(sellOrders[0].fulfilled).toBe(MIN_IOTA_AMOUNT); + expect(sellOrders[1].price).toBe(4); + expect(sellOrders[1].fulfilled).toBe(MIN_IOTA_AMOUNT); + }); +}); diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_16.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_16.spec.ts new file mode 100644 index 0000000000..8a98260181 --- /dev/null +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_16.spec.ts @@ -0,0 +1,96 @@ +import { build5Db } from '@build-5/database'; +import { + COL, + MIN_IOTA_AMOUNT, + MIN_PRICE_PER_TOKEN, + Network, + TangleRequestType, + TokenTradeOrder, + TokenTradeOrderStatus, + TokenTradeOrderType, + Transaction, +} from '@build-5/interfaces'; +import { tradeToken } from '../../src/runtime/firebase/token/trading'; +import { mockWalletReturnValue, wait } from '../../test/controls/common'; +import { testEnv } from '../../test/set-up'; +import { getTangleOrder } from '../common'; +import { requestFundsFromFaucet } from '../faucet'; +import { Helper } from './Helper'; + +describe('Base token trading', () => { + const helper = new Helper(); + let atoiTangleOrder: Transaction; + + beforeEach(async () => { + await helper.beforeEach(); + }); + + it('Should create market sell with tangle request, settle it', async () => { + mockWalletReturnValue(helper.walletSpy, helper.buyer!.uid, { + symbol: helper.token!.symbol, + count: 2 * MIN_IOTA_AMOUNT, + price: 1, + type: TokenTradeOrderType.BUY, + }); + let buyOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + buyOrder.payload.targetAddress, + buyOrder.payload.amount, + ); + + mockWalletReturnValue(helper.walletSpy, helper.buyer!.uid, { + symbol: helper.token!.symbol, + count: 4 * MIN_IOTA_AMOUNT, + price: 2, + type: TokenTradeOrderType.BUY, + }); + buyOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + buyOrder.payload.targetAddress, + buyOrder.payload.amount, + ); + + atoiTangleOrder = await getTangleOrder(Network.ATOI); + const atoiAddress = helper.sellerValidateAddress[Network.ATOI]; + await requestFundsFromFaucet(helper.sourceNetwork, atoiAddress.bech32, 5 * MIN_IOTA_AMOUNT); + + await helper.atoiWallet!.send( + atoiAddress, + atoiTangleOrder.payload.targetAddress!, + 5 * MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.SELL_TOKEN, + symbol: helper.token?.symbol!, + }, + }, + }, + ); + + const query = build5Db().collection(COL.TOKEN_MARKET).where('owner', '==', helper.seller!.uid); + await wait(async () => { + const snap = await query.get(); + return snap.length === 1 && snap[0].status === TokenTradeOrderStatus.SETTLED; + }); + const sellOrder = (await query.get())[0]; + + expect(sellOrder.count).toBe(5 * MIN_IOTA_AMOUNT); + expect(sellOrder.fulfilled).toBe(5 * MIN_IOTA_AMOUNT); + expect(sellOrder.balance).toBe(0); + expect(sellOrder.price).toBe(MIN_PRICE_PER_TOKEN); + + const buyOrders = await build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', helper.buyer?.uid) + .get(); + buyOrders.sort((a, b) => b.price - a.price); + + expect(buyOrders[0].price).toBe(2); + expect(buyOrders[0].fulfilled).toBe(4 * MIN_IOTA_AMOUNT); + expect(buyOrders[1].price).toBe(1); + expect(buyOrders[1].fulfilled).toBe(1 * MIN_IOTA_AMOUNT); + }); +}); diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_17.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_17.spec.ts new file mode 100644 index 0000000000..70404f2cf5 --- /dev/null +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_17.spec.ts @@ -0,0 +1,93 @@ +import { build5Db } from '@build-5/database'; +import { + COL, + MIN_IOTA_AMOUNT, + Network, + TangleRequestType, + TokenTradeOrder, + TokenTradeOrderType, + Transaction, +} from '@build-5/interfaces'; +import { tradeToken } from '../../src/runtime/firebase/token/trading'; +import { mockWalletReturnValue, wait } from '../../test/controls/common'; +import { testEnv } from '../../test/set-up'; +import { getTangleOrder } from '../common'; +import { requestFundsFromFaucet } from '../faucet'; +import { Helper } from './Helper'; + +describe('Base token trading', () => { + const helper = new Helper(); + let atoiTangleOrder: Transaction; + + beforeEach(async () => { + await helper.beforeEach(); + }); + + it('Should create market sell with tangle request, do not settle it', async () => { + mockWalletReturnValue(helper.walletSpy, helper.buyer!.uid, { + symbol: helper.token!.symbol, + count: 2 * MIN_IOTA_AMOUNT, + price: 1, + type: TokenTradeOrderType.BUY, + }); + let buyOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + buyOrder.payload.targetAddress, + buyOrder.payload.amount, + ); + + mockWalletReturnValue(helper.walletSpy, helper.buyer!.uid, { + symbol: helper.token!.symbol, + count: 4 * MIN_IOTA_AMOUNT, + price: 2, + type: TokenTradeOrderType.BUY, + }); + buyOrder = await testEnv.wrap(tradeToken)({}); + await requestFundsFromFaucet( + helper.sourceNetwork, + buyOrder.payload.targetAddress, + buyOrder.payload.amount, + ); + + atoiTangleOrder = await getTangleOrder(Network.ATOI); + const atoiAddress = helper.sellerValidateAddress[Network.ATOI]; + await requestFundsFromFaucet(helper.sourceNetwork, atoiAddress.bech32, 7 * MIN_IOTA_AMOUNT); + + await helper.atoiWallet!.send( + atoiAddress, + atoiTangleOrder.payload.targetAddress!, + 7 * MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.SELL_TOKEN, + symbol: helper.token?.symbol!, + }, + }, + }, + ); + + const query = build5Db().collection(COL.TOKEN_MARKET).where('owner', '==', helper.seller!.uid); + await wait(async () => { + const snap = await query.get(); + return snap.length === 1 && snap[0].fulfilled === 6 * MIN_IOTA_AMOUNT; + }); + const sellOrder = (await query.get())[0]; + + expect(sellOrder.count).toBe(7 * MIN_IOTA_AMOUNT); + expect(sellOrder.fulfilled).toBe(6 * MIN_IOTA_AMOUNT); + expect(sellOrder.balance).toBe(MIN_IOTA_AMOUNT); + + const buyOrders = await build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', helper.buyer?.uid) + .get(); + buyOrders.sort((a, b) => b.price - a.price); + + expect(buyOrders[0].price).toBe(2); + expect(buyOrders[0].fulfilled).toBe(4 * MIN_IOTA_AMOUNT); + expect(buyOrders[1].price).toBe(1); + expect(buyOrders[1].fulfilled).toBe(2 * MIN_IOTA_AMOUNT); + }); +}); diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_21.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_21.spec.ts new file mode 100644 index 0000000000..1b089bf51e --- /dev/null +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_21.spec.ts @@ -0,0 +1,78 @@ +import { build5Db } from '@build-5/database'; +import { + COL, + MAX_TOTAL_TOKEN_SUPPLY, + MIN_IOTA_AMOUNT, + Network, + TangleRequestType, + TokenTradeOrder, + TokenTradeOrderStatus, + TokenTradeOrderType, + Transaction, +} from '@build-5/interfaces'; +import { wait } from '../../test/controls/common'; +import { getTangleOrder } from '../common'; +import { requestFundsFromFaucet } from '../faucet'; +import { Helper } 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 market buy with tangle request, settle it, no balance', async () => { + await helper.createSellTradeOrder(); + await helper.createSellTradeOrder(10, 2 * MIN_IOTA_AMOUNT); + + const tmp = await helper.walletService!.getNewIotaAddressDetails(); + await requestFundsFromFaucet(Network.RMS, tmp.bech32, 20 * MIN_IOTA_AMOUNT); + + await helper.walletService!.send( + tmp, + tangleOrder.payload.targetAddress!, + 20 * MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.BUY_TOKEN, + symbol: helper.token!.symbol, + }, + }, + }, + ); + + const buyQuery = build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', tmp.bech32) + .where('type', '==', TokenTradeOrderType.BUY); + await wait(async () => { + const snap = await buyQuery.get(); + return snap.length === 1 && snap[0].status === TokenTradeOrderStatus.SETTLED; + }); + const buyOrder = (await buyQuery.get())[0]; + + expect(buyOrder.count).toBe(MAX_TOTAL_TOKEN_SUPPLY); + expect(buyOrder.fulfilled).toBe(15); + expect(buyOrder.balance).toBe(0); + + const sellOrders = await build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', helper.seller) + .where('type', '==', TokenTradeOrderType.SELL) + .get(); + sellOrders.sort((a, b) => a.price - b.price); + + expect(sellOrders[0].price).toBe(MIN_IOTA_AMOUNT); + expect(sellOrders[0].fulfilled).toBe(10); + expect(sellOrders[1].price).toBe(2 * MIN_IOTA_AMOUNT); + expect(sellOrders[1].fulfilled).toBe(5); + }); +}); diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_22.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_22.spec.ts new file mode 100644 index 0000000000..51f6e72a80 --- /dev/null +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_22.spec.ts @@ -0,0 +1,74 @@ +import { build5Db } from '@build-5/database'; +import { + COL, + MAX_TOTAL_TOKEN_SUPPLY, + MIN_IOTA_AMOUNT, + Network, + TangleRequestType, + TokenTradeOrder, + TokenTradeOrderStatus, + TokenTradeOrderType, + Transaction, +} from '@build-5/interfaces'; +import { wait } from '../../test/controls/common'; +import { getTangleOrder } from '../common'; +import { requestFundsFromFaucet } from '../faucet'; +import { Helper } 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 market buy with tangle request, do not fullfill it', async () => { + await helper.createSellTradeOrder(1, MIN_IOTA_AMOUNT); + await helper.createSellTradeOrder(2, 2 * MIN_IOTA_AMOUNT); + + const tmp = await helper.walletService!.getNewIotaAddressDetails(); + await requestFundsFromFaucet(Network.RMS, tmp.bech32, 6 * MIN_IOTA_AMOUNT); + + await helper.walletService!.send(tmp, tangleOrder.payload.targetAddress!, 6 * MIN_IOTA_AMOUNT, { + customMetadata: { + request: { + requestType: TangleRequestType.BUY_TOKEN, + symbol: helper.token!.symbol, + }, + }, + }); + + const buyQuery = build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', tmp.bech32) + .where('type', '==', TokenTradeOrderType.BUY); + await wait(async () => { + const snap = await buyQuery.get(); + return snap.length === 1 && snap[0].fulfilled === 3; + }); + const buyOrder = (await buyQuery.get())[0]; + + expect(buyOrder.count).toBe(MAX_TOTAL_TOKEN_SUPPLY); + expect(buyOrder.fulfilled).toBe(3); + expect(buyOrder.balance).toBe(MIN_IOTA_AMOUNT); + expect(buyOrder.status).toBe(TokenTradeOrderStatus.ACTIVE); + + const sellOrders = await build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', helper.seller) + .where('type', '==', TokenTradeOrderType.SELL) + .get(); + sellOrders.sort((a, b) => a.price - b.price); + + expect(sellOrders[0].price).toBe(MIN_IOTA_AMOUNT); + expect(sellOrders[0].fulfilled).toBe(1); + expect(sellOrders[1].price).toBe(2 * MIN_IOTA_AMOUNT); + expect(sellOrders[1].fulfilled).toBe(2); + }); +}); diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_23.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_23.spec.ts new file mode 100644 index 0000000000..53d59d6be0 --- /dev/null +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_23.spec.ts @@ -0,0 +1,76 @@ +import { build5Db } from '@build-5/database'; +import { + COL, + MIN_IOTA_AMOUNT, + MIN_PRICE_PER_TOKEN, + Network, + TangleRequestType, + TokenTradeOrder, + TokenTradeOrderStatus, + TokenTradeOrderType, + Transaction, +} from '@build-5/interfaces'; +import { wait } from '../../test/controls/common'; +import { getTangleOrder } from '../common'; +import { Helper } 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 market sell with tangle request, settle it, no balance', async () => { + await helper.createBuyOrder(2, MIN_IOTA_AMOUNT); + await helper.createBuyOrder(2, 2 * MIN_IOTA_AMOUNT); + + await helper.walletService!.send( + helper.sellerAddress!, + tangleOrder.payload.targetAddress!, + MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.SELL_TOKEN, + symbol: helper.token!.symbol, + }, + }, + nativeTokens: [{ id: helper.token?.mintingData?.tokenId!, amount: BigInt(3) }], + }, + ); + + const sellQuery = build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', helper.seller!) + .where('type', '==', TokenTradeOrderType.SELL); + await wait(async () => { + const snap = await sellQuery.get(); + return snap.length === 1 && snap[0].status === TokenTradeOrderStatus.SETTLED; + }); + const sellOrder = (await sellQuery.get())[0]; + + expect(sellOrder.count).toBe(3); + expect(sellOrder.fulfilled).toBe(3); + expect(sellOrder.balance).toBe(0); + expect(sellOrder.price).toBe(MIN_PRICE_PER_TOKEN); + + const buyOrders = await build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', helper.buyer!) + .where('type', '==', TokenTradeOrderType.BUY) + .get(); + buyOrders.sort((a, b) => b.price - a.price); + + expect(buyOrders[0].price).toBe(2 * MIN_IOTA_AMOUNT); + expect(buyOrders[0].fulfilled).toBe(2); + expect(buyOrders[1].price).toBe(MIN_IOTA_AMOUNT); + expect(buyOrders[1].fulfilled).toBe(1); + }); +}); diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_24.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_24.spec.ts new file mode 100644 index 0000000000..dd2e44f480 --- /dev/null +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_24.spec.ts @@ -0,0 +1,73 @@ +import { build5Db } from '@build-5/database'; +import { + COL, + MIN_IOTA_AMOUNT, + Network, + TangleRequestType, + TokenTradeOrder, + TokenTradeOrderType, + Transaction, +} from '@build-5/interfaces'; +import { wait } from '../../test/controls/common'; +import { getTangleOrder } from '../common'; +import { Helper } 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 market sell with tangle request, do not settle it', async () => { + await helper.createBuyOrder(1, MIN_IOTA_AMOUNT); + await helper.createBuyOrder(2, 2 * MIN_IOTA_AMOUNT); + + await helper.walletService!.send( + helper.sellerAddress!, + tangleOrder.payload.targetAddress!, + MIN_IOTA_AMOUNT, + { + customMetadata: { + request: { + requestType: TangleRequestType.SELL_TOKEN, + symbol: helper.token!.symbol, + }, + }, + nativeTokens: [{ id: helper.token?.mintingData?.tokenId!, amount: BigInt(4) }], + }, + ); + + const sellQuery = build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', helper.seller!) + .where('type', '==', TokenTradeOrderType.SELL); + await wait(async () => { + const snap = await sellQuery.get(); + return snap.length === 1 && snap[0].fulfilled === 3; + }); + const sellOrder = (await sellQuery.get())[0]; + + expect(sellOrder.count).toBe(4); + expect(sellOrder.fulfilled).toBe(3); + expect(sellOrder.balance).toBe(1); + + const buyOrders = await build5Db() + .collection(COL.TOKEN_MARKET) + .where('owner', '==', helper.buyer!) + .where('type', '==', TokenTradeOrderType.BUY) + .get(); + buyOrders.sort((a, b) => b.price - a.price); + + expect(buyOrders[0].price).toBe(2 * MIN_IOTA_AMOUNT); + expect(buyOrders[0].fulfilled).toBe(2); + expect(buyOrders[1].price).toBe(MIN_IOTA_AMOUNT); + expect(buyOrders[1].fulfilled).toBe(1); + }); +}); diff --git a/packages/interfaces/src/errors.ts b/packages/interfaces/src/errors.ts index 49bd0c931a..310daa8756 100644 --- a/packages/interfaces/src/errors.ts +++ b/packages/interfaces/src/errors.ts @@ -322,4 +322,8 @@ export const WenError = { code: 2146, key: 'Credit has expired.', }, + no_active_sells: { + code: 2147, + key: 'No active sell orders.', + }, }; diff --git a/packages/interfaces/src/search/tangle/TokenTradeTangleRequest.ts b/packages/interfaces/src/search/tangle/TokenTradeTangleRequest.ts index 0681f3545d..8dfc032e1c 100644 --- a/packages/interfaces/src/search/tangle/TokenTradeTangleRequest.ts +++ b/packages/interfaces/src/search/tangle/TokenTradeTangleRequest.ts @@ -12,9 +12,9 @@ export interface TradeTokenTangleRequest { */ count?: number; /** - * Pirce of the token to trade. Minimum 0.000001, maximum: 1000000000000. + * Price of the token to trade. Minimum 0.000001, maximum: 1000000000000. */ - price: number; + price?: number; /** * Type of the tangle request. */ From c5716d88992f2a5dd51dc09a0fa1d8fa372f5e98 Mon Sep 17 00:00:00 2001 From: Boldizsar Mezei Date: Wed, 13 Dec 2023 13:03:40 +0200 Subject: [PATCH 2/3] Client fixes Fixes Fixes Fixes Fixes --- packages/client/src/https/index.ts | 2 +- .../src/otr/datasets/TokenOtrDataset.ts | 4 +- packages/client/src/otr/datasets/common.ts | 10 +++- .../token-trade-order.trigger.ts | 28 ----------- .../base-token-trading_1.spec.ts | 46 ++++++++++++++----- .../minted-token-trade_9.spec.ts | 11 ++++- .../test/controls/token-trade.trigger.spec.ts | 31 ------------- 7 files changed, 55 insertions(+), 77 deletions(-) diff --git a/packages/client/src/https/index.ts b/packages/client/src/https/index.ts index e4768b4037..7b7accfee7 100644 --- a/packages/client/src/https/index.ts +++ b/packages/client/src/https/index.ts @@ -9,7 +9,7 @@ import { import axios from 'axios'; import { ProjectWrapper } from './https'; -export const https = (origin = Build5.PROD) => new HttpsWrapper(origin); +export const https = (origin: string = Build5.PROD) => new HttpsWrapper(origin as Build5); class HttpsWrapper { constructor(private readonly origin: Build5) {} diff --git a/packages/client/src/otr/datasets/TokenOtrDataset.ts b/packages/client/src/otr/datasets/TokenOtrDataset.ts index 82ad18a4b2..1d663eb4ef 100644 --- a/packages/client/src/otr/datasets/TokenOtrDataset.ts +++ b/packages/client/src/otr/datasets/TokenOtrDataset.ts @@ -18,7 +18,7 @@ export class TokenOtrDataset extends DatasetClass { ...params, requestType: TangleRequestType.SELL_TOKEN, }, - Math.floor((params.count || 0) * params.price), + Math.floor((params.count || 0) * (params.price || 0)), ); }; @@ -34,7 +34,7 @@ export class TokenOtrDataset extends DatasetClass { new OtrRequest( this.otrAddress, { ...params, requestType: TangleRequestType.BUY_TOKEN }, - Math.floor((params.count || 0) * params.price), + Math.floor((params.count || 0) * (params.price || 0)), ); stake = (tokenId: string, count: number, params: Omit) => diff --git a/packages/client/src/otr/datasets/common.ts b/packages/client/src/otr/datasets/common.ts index 3fd66d37d3..02301c6eda 100644 --- a/packages/client/src/otr/datasets/common.ts +++ b/packages/client/src/otr/datasets/common.ts @@ -1,6 +1,9 @@ import { Dataset, Network } from '@build-5/interfaces'; import { v4 as uuid } from 'uuid'; +import { AuctionOtrDataset } from './AuctionOtrDataset'; +import { AwardOtrDataset } from './AwardOtrDataset'; import { MemberOtrDataset } from './MemberOtrDataset'; +import { NftOtrDataset } from './NftOtrDataset'; import { ProposalOtrDataset } from './ProposalOtrDataset'; import { SpaceOtrDataset } from './SpaceOtrDataset'; import { StamptOtrDataset } from './StampOtrDataset'; @@ -8,11 +11,14 @@ import { TokenOtrDataset } from './TokenOtrDataset'; // prettier-ignore export type DatasetType = + T extends Dataset.AUCTION ? AuctionOtrDataset: + T extends Dataset.AWARD ? AwardOtrDataset: T extends Dataset.MEMBER ? MemberOtrDataset: - T extends Dataset.SPACE ? SpaceOtrDataset: - T extends Dataset.TOKEN ? TokenOtrDataset: + T extends Dataset.NFT ? NftOtrDataset: T extends Dataset.PROPOSAL ? ProposalOtrDataset: + T extends Dataset.SPACE ? SpaceOtrDataset: T extends Dataset.STAMP ? StamptOtrDataset: + T extends Dataset.TOKEN ? TokenOtrDataset: unknown; export interface INativeToken { diff --git a/packages/functions/src/triggers/token-trading/token-trade-order.trigger.ts b/packages/functions/src/triggers/token-trading/token-trade-order.trigger.ts index d7d3d581cf..eeb4f6a2db 100644 --- a/packages/functions/src/triggers/token-trading/token-trade-order.trigger.ts +++ b/packages/functions/src/triggers/token-trading/token-trade-order.trigger.ts @@ -8,13 +8,8 @@ import { SUB_COL, TokenDistribution, TokenTradeOrder, - TokenTradeOrderStatus, - TokenTradeOrderType, } from '@build-5/interfaces'; -import bigDecimal from 'js-big-decimal'; import { getStakeForType, getTier } from '../../services/stake.service'; -import { cancelTradeOrderUtil } from '../../utils/token-trade.utils'; -import { BIG_DECIMAL_PRECISION } from '../../utils/token.utils'; import { FirestoreDocEvent } from '../common'; import { matchTradeOrder } from './match-token'; @@ -27,29 +22,6 @@ export const onTokenTradeOrderWrite = async (event: FirestoreDocEvent { - const tradeOrderDocRef = build5Db().doc(`${COL.TOKEN_MARKET}/${curr.uid}`); - const tradeOrder = await transaction.get(tradeOrderDocRef); - if (tradeOrder && isActiveBuy(tradeOrder) && needsHigherBuyAmount(tradeOrder!)) { - await cancelTradeOrderUtil( - transaction, - tradeOrder, - TokenTradeOrderStatus.CANCELLED_UNFULFILLABLE, - ); - } - }); -}; - -const isActiveBuy = (sale?: TokenTradeOrder) => - sale?.type === TokenTradeOrderType.BUY && sale?.status === TokenTradeOrderStatus.ACTIVE; - -const needsHigherBuyAmount = (buy: TokenTradeOrder) => { - const tokensLeft = Number(bigDecimal.subtract(buy.count, buy.fulfilled)); - const price = Number( - bigDecimal.floor(bigDecimal.divide(buy.balance || 0, tokensLeft, BIG_DECIMAL_PRECISION)), - ); - return price > buy.price; }; export const getMemberTier = async (projectId: string, member: Member) => { diff --git a/packages/functions/test-tangle/base-token-trading/base-token-trading_1.spec.ts b/packages/functions/test-tangle/base-token-trading/base-token-trading_1.spec.ts index c95b655d13..3ce663be91 100644 --- a/packages/functions/test-tangle/base-token-trading/base-token-trading_1.spec.ts +++ b/packages/functions/test-tangle/base-token-trading/base-token-trading_1.spec.ts @@ -6,6 +6,7 @@ import { TokenPurchase, TokenStatus, TokenTradeOrder, + TokenTradeOrderStatus, TokenTradeOrderType, Transaction, TransactionPayloadType, @@ -219,7 +220,20 @@ describe('Base token trading', () => { expect(dayjs(buy.expiresAt.toDate()).isSame(dayjs(expiresAt.toDate()))).toBe(true); }); - it('Should credit buy order with expiration unlock, wrong amount', async () => { + it('Should not credit buy order with expiration unlock, custom amount', async () => { + 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 date = dayjs().add(2, 'h').millisecond(0).toDate(); const expiresAt = dateToTimestamp(date) as Timestamp; @@ -230,24 +244,32 @@ describe('Base token trading', () => { type: TokenTradeOrderType.BUY, }); const buyOrder = await testEnv.wrap(tradeToken)({}); - const { faucetAddress } = await requestFundsFromFaucet( + await requestFundsFromFaucet( helper.targetNetwork, buyOrder.payload.targetAddress, 4 * MIN_IOTA_AMOUNT, expiresAt, ); + const buyQuery = build5Db() + .collection(COL.TOKEN_MARKET) + .where('type', '==', TokenTradeOrderType.BUY) + .where('owner', '==', helper.buyer?.uid); await wait(async () => { - const snap = await build5Db() - .collection(COL.TRANSACTION) - .where('type', '==', TransactionType.CREDIT) - .where('member', '==', helper.buyer?.uid) - .get(); - return ( - snap.length === 1 && - snap[0]!.payload.amount === 4 * MIN_IOTA_AMOUNT && - snap[0]!.payload.targetAddress === faucetAddress.bech32 - ); + const snap = await buyQuery.get(); + return snap.length === 1 && snap[0].status === TokenTradeOrderStatus.SETTLED; }); + const buy = (await buyQuery.get())[0]; + expect(buy.balance).toBe(2 * MIN_IOTA_AMOUNT); + expect(buy.count).toBe(MIN_IOTA_AMOUNT); + expect(buy.fulfilled).toBe(MIN_IOTA_AMOUNT); + + const credit = await build5Db() + .collection(COL.TRANSACTION) + .where('member', '==', helper.buyer?.uid) + .where('payload.type', '==', TransactionPayloadType.TOKEN_TRADE_FULLFILLMENT) + .get(); + expect(credit.length).toBe(1); + expect(credit[0].payload.amount).toBe(2 * MIN_IOTA_AMOUNT); }); }); diff --git a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_9.spec.ts b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_9.spec.ts index f3e5241959..8dc60fc7e6 100644 --- a/packages/functions/test-tangle/minted-token-trade/minted-token-trade_9.spec.ts +++ b/packages/functions/test-tangle/minted-token-trade/minted-token-trade_9.spec.ts @@ -9,6 +9,7 @@ import { TransactionType, } from '@build-5/interfaces'; import { tradeToken } from '../../src/runtime/firebase/token/trading'; +import { packBasicOutput } from '../../src/utils/basic-output.utils'; import { mockWalletReturnValue, wait } from '../../test/controls/common'; import { testEnv } from '../../test/set-up'; import { awaitTransactionConfirmationsForToken } from '../common'; @@ -53,7 +54,15 @@ describe('Token minting', () => { }); const snap = await query.get(); const credit = snap[0]; - expect(credit.payload.amount).toBe(sellOrder.payload.amount); + const output = await packBasicOutput( + helper.walletService!, + sellOrder.payload.targetAddress, + 0, + { + nativeTokens: [{ amount: BigInt(10), id: helper.token!.mintingData?.tokenId! }], + }, + ); + expect(credit.payload.amount).toBe(Number(output.amount)); expect(credit.payload.nativeTokens![0].id).toBe(MINTED_TOKEN_ID); expect(credit.payload.nativeTokens![0].amount).toBe(10); const sellSnap = await build5Db() diff --git a/packages/functions/test/controls/token-trade.trigger.spec.ts b/packages/functions/test/controls/token-trade.trigger.spec.ts index 5b8b55bc1f..0a7d4c82e5 100644 --- a/packages/functions/test/controls/token-trade.trigger.spec.ts +++ b/packages/functions/test/controls/token-trade.trigger.spec.ts @@ -1107,37 +1107,6 @@ describe('Trade trigger', () => { expect(purchase.price).toBe(2 * MIN_IOTA_AMOUNT); }); - it('Should cancel after it needs higher fulfillment price', async () => { - mockWalletReturnValue(walletSpy, seller, { - symbol: token.symbol, - price: 0.8 * MIN_IOTA_AMOUNT, - count: 8, - type: TokenTradeOrderType.SELL, - }); - await testEnv.wrap(tradeToken)({}); - - const request = { - symbol: token.symbol, - price: 0.82 * MIN_IOTA_AMOUNT, - count: 10, - type: TokenTradeOrderType.BUY, - }; - await buyTokenFunc(buyer, request); - - const buyQuery = build5Db().collection(COL.TOKEN_MARKET).where('owner', '==', buyer); - - await wait(async () => { - return ( - (await buyQuery.get())[0]?.status === - TokenTradeOrderStatus.CANCELLED_UNFULFILLABLE - ); - }); - - expect((await buyQuery.get())[0]?.status).toBe( - TokenTradeOrderStatus.CANCELLED_UNFULFILLABLE, - ); - }); - it('Should fulfill low price sell with high price buy', async () => { mockWalletReturnValue(walletSpy, seller, { symbol: token.symbol, From 0d645d1a6547cf4625426210aec267bb2751b843 Mon Sep 17 00:00:00 2001 From: Boldizsar Mezei Date: Wed, 13 Dec 2023 20:08:19 +0200 Subject: [PATCH 3/3] Search fixes --- packages/search/src/getMany.ts | 2 +- packages/search/src/getManyAdvanced.ts | 2 +- packages/search/src/getUpdatedAfter.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/search/src/getMany.ts b/packages/search/src/getMany.ts index 9d53ed4060..e78c51acb3 100644 --- a/packages/search/src/getMany.ts +++ b/packages/search/src/getMany.ts @@ -30,7 +30,7 @@ const getManySchema = Joi.object({ dataset: Joi.string() .equal(...Object.values(Dataset)) .required(), - setId: CommonJoi.uid(false), + setId: CommonJoi.uid(false, 5), subset: Joi.string() .equal(...Object.values(Subset)) .optional(), diff --git a/packages/search/src/getManyAdvanced.ts b/packages/search/src/getManyAdvanced.ts index 110bfad080..2d70ba2c2a 100644 --- a/packages/search/src/getManyAdvanced.ts +++ b/packages/search/src/getManyAdvanced.ts @@ -36,7 +36,7 @@ const getManyAdvancedSchema = Joi.object({ dataset: Joi.string() .equal(...Object.values(Dataset)) .required(), - setId: CommonJoi.uid(false), + setId: CommonJoi.uid(false, 5), subset: Joi.string() .equal(...Object.values(Subset)) .optional(), diff --git a/packages/search/src/getUpdatedAfter.ts b/packages/search/src/getUpdatedAfter.ts index 96ee811c36..3b65fe228b 100644 --- a/packages/search/src/getUpdatedAfter.ts +++ b/packages/search/src/getUpdatedAfter.ts @@ -22,8 +22,8 @@ const getUpdatedAfterSchema = Joi.object({ dataset: Joi.string() .equal(...Object.values(Dataset)) .required(), - setId: CommonJoi.uid(false), - subCollection: Joi.string() + setId: CommonJoi.uid(false, 5), + subset: Joi.string() .equal(...Object.values(Subset)) .optional(), updatedAfter: Joi.number().min(0).max(MAX_MILLISECONDS).integer().optional(),