Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing Cadence tests #162

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 41 additions & 36 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,44 @@ name: NFT Catalog Integration Tests
on: pull_request

jobs:
tests:
env:
CATALOG_TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.CATALOG_TESTNET_ACCOUNT_PRIVATE_KEY }}
EXAMPLENFT_TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.EXAMPLENFT_TESTNET_ACCOUNT_PRIVATE_KEY }}
EXAMPLENFT_TESTNET_HOLDER_ACCOUNT_PRIVATE_KEY: ${{ secrets.EXAMPLENFT_TESTNET_HOLDER_ACCOUNT_PRIVATE_KEY }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 18

# This should be switched to the regular CLI once the stable-cadence branch is merged
- name: Install Cadence 1.0 Flow CLI
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"

- name: Update PATH
run: echo "/root/.local/bin" >> $GITHUB_PATH

- run: echo $(flow version)

- name: Install Dependencies
run: npm install

- name: Install UI Dependencies
run: npm run install-ui

- name: Run Cadence Tests
if: always()
run: npm test

# - name: Run E2E Cypress Tests
# if: always()
# run: npm run e2e
tests:
env:
CATALOG_TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.CATALOG_TESTNET_ACCOUNT_PRIVATE_KEY }}
EXAMPLENFT_TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.EXAMPLENFT_TESTNET_ACCOUNT_PRIVATE_KEY }}
EXAMPLENFT_TESTNET_HOLDER_ACCOUNT_PRIVATE_KEY: ${{ secrets.EXAMPLENFT_TESTNET_HOLDER_ACCOUNT_PRIVATE_KEY }}
EMULATOR_ACCOUNT_PRIVATE_KEY: ${{ secrets.EMULATOR_ACCOUNT_PRIVATE_KEY }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 18

# This should be switched to the regular CLI once the stable-cadence branch is merged
- name: Install Cadence 1.0 Flow CLI
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"

- name: Update PATH
run: echo "/root/.local/bin" >> $GITHUB_PATH

- run: echo $(flow version)

- name: Install Dependencies
run: npm install

- name: Install UI Dependencies
run: npm run install-ui

- name: Run Cadence javascript Tests
if: always()
run: npm test

- name: Run Cadence Tests
if: always()
run: sh run-test.sh

# - name: Run E2E Cypress Tests
# if: always()
# run: npm run e2e
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ lerna-debug.log*
# emulator datastore
flowdb
coverage.json
coverage.lcov

keys
8 changes: 4 additions & 4 deletions cadence/__test__/src/nftcatalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const deployNFTCatalog = async () => {
await deployContractByName({ to: NFTCatalogAdmin, name: 'NFTCatalogAdmin' })
}

export const updateSnapshotAdmin = async(catalogAccount, collections) => {
export const updateSnapshotAdmin = async (catalogAccount, collections) => {
const name = 'update_snapshot_admin';

const args = [collections]
Expand All @@ -19,7 +19,7 @@ export const updateSnapshotAdmin = async(catalogAccount, collections) => {
return sendTransaction({ name, args, signers });
}

export const updateShouldUseSnapshotAdmin = async(catalogAccount, shouldUseSnapshot) => {
export const updateShouldUseSnapshotAdmin = async (catalogAccount, shouldUseSnapshot) => {
const name = 'set_snapshot_enabled_admin';

const args = [shouldUseSnapshot]
Expand Down Expand Up @@ -84,9 +84,9 @@ export const sendAdminProxyCapability = async (ownerAccount) => {
return sendTransaction({ name, args, signers });
}

export const proposeNFTToCatalog = async (account, collectionIdentifier, contractName, contractAddress, nftTypeIdentifier, storagePathIdentifier, publicPathIdentifier, publicLinkedTypeIdentifier, publicLinkedTypeRestrictions, collectionName, collectionDescription, externalURL, squareURL, squareMediaType, bannerURL, bannerMediaType, socials, message) => {
export const proposeNFTToCatalog = async (account, collectionIdentifier, contractName, contractAddress, nftTypeIdentifier, storagePathIdentifier, publicPathIdentifier, publicLinkedTypeIdentifier, collectionName, collectionDescription, externalURL, squareURL, squareMediaType, bannerURL, bannerMediaType, socials, message) => {
const name = 'propose_nft_to_catalog';
const args = [collectionIdentifier, contractName, contractAddress, nftTypeIdentifier, storagePathIdentifier, publicPathIdentifier, publicLinkedTypeIdentifier, publicLinkedTypeRestrictions, collectionName, collectionDescription, externalURL, squareURL, squareMediaType, bannerURL, bannerMediaType, socials, message];
const args = [collectionIdentifier, contractName, contractAddress, nftTypeIdentifier, storagePathIdentifier, publicPathIdentifier, publicLinkedTypeIdentifier, collectionName, collectionDescription, externalURL, squareURL, squareMediaType, bannerURL, bannerMediaType, socials, message];
const signers = [account];

return sendTransaction({ name, args, signers });
Expand Down
Loading
Loading