From 521eac7b5870eb7230d9219782d43dbe62fe28bc Mon Sep 17 00:00:00 2001 From: Austin Kline Date: Sat, 6 Apr 2024 12:41:09 -0700 Subject: [PATCH 1/4] unit test workflow --- .github/workflows/unit-test.yml | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/unit-test.yml diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 0000000..4ca42fc --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,36 @@ +name: Unit Tests + +on: + pull_request: + branches: [main] + push: + branches: [main] + + +jobs: + tests: + name: Flow CLI Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: "true" + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.18 + - name: Set up Node + uses: actions/setup-node@v2 + with: + node-version: ^18 + - name: Install Flow dependencies + run: npm i + - name: Install Flow CLI + run: bash -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/feature/stable-cadence/install.sh)" -- v1.17.0 + - name: Run tests + run: sh ./run-tests.sh + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: Flowtyio/flowty-drops \ No newline at end of file From ae62cbdd467ee794d149d39c77fc9696432f5f77 Mon Sep 17 00:00:00 2001 From: Austin Kline Date: Sat, 6 Apr 2024 12:50:34 -0700 Subject: [PATCH 2/4] correct flow-cli version --- .github/workflows/unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 4ca42fc..8584492 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -26,7 +26,7 @@ jobs: - name: Install Flow dependencies run: npm i - name: Install Flow CLI - run: bash -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/feature/stable-cadence/install.sh)" -- v1.17.0 + run: bash -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" -- v1.17.0 - name: Run tests run: sh ./run-tests.sh - name: Upload coverage reports to Codecov From 1f574e04d606707a6aaf28125bd5d1229df28c3d Mon Sep 17 00:00:00 2001 From: Austin Kline Date: Sat, 6 Apr 2024 13:03:46 -0700 Subject: [PATCH 3/4] missing DropFactory in test deployments --- tests/test_helpers.cdc | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_helpers.cdc b/tests/test_helpers.cdc index cdeb025..6d69116 100644 --- a/tests/test_helpers.cdc +++ b/tests/test_helpers.cdc @@ -157,6 +157,7 @@ pub fun deployAll() { deploy("FlowtySwitches", "../contracts/FlowtySwitches.cdc", []) deploy("FlowtyPricers", "../contracts/FlowtyPricers.cdc", []) deploy("FlowtyAddressVerifiers", "../contracts/FlowtyAddressVerifiers.cdc", []) + deploy("DropFactory", "../contracts/DropFactory.cdc", []) deploy("OpenEditionNFT", "../contracts/nft/OpenEditionNFT.cdc", []) } From e360a3ca6cc4f6243843b60359c9902630a243fb Mon Sep 17 00:00:00 2001 From: Austin Kline Date: Sat, 6 Apr 2024 13:05:45 -0700 Subject: [PATCH 4/4] broken test --- contracts/DropFactory.cdc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/DropFactory.cdc b/contracts/DropFactory.cdc index 090a189..a344f91 100644 --- a/contracts/DropFactory.cdc +++ b/contracts/DropFactory.cdc @@ -17,7 +17,7 @@ pub contract DropFactory { minterCap: Capability<&{FlowtyDrops.Minter}> ): @FlowtyDrops.Drop { pre { - Type<@FungibleToken.Vault>().isSubtype(of: paymentTokenType): "paymentTokenType must be a FungibleToken" + paymentTokenType.isSubtype(of: Type<@FungibleToken.Vault>()): "paymentTokenType must be a FungibleToken" } // This drop is always on and never ends.