From 6fa2f67f4bfb70481426bb9030a9e7798f9580e6 Mon Sep 17 00:00:00 2001 From: disenotov Date: Sat, 19 Aug 2023 22:29:06 +0300 Subject: [PATCH 1/5] feat(PT-3508): fix e2e tests --- packages/e2e-tests/tests/common/utils.ts | 3 +++ .../e2e-tests/tests/ethereum/smoke/api/order.test.ts | 3 +++ .../tests/ethereum/smoke/nft/mint-and-sell-buy.test.ts | 5 +++++ .../tests/ethereum/smoke/order/mint-bid-accepbid.test.ts | 5 +++++ .../smoke/order/mint-bid-bidupdate-accepbid.test.ts | 5 +++++ .../tests/ethereum/smoke/order/mint-bid-cancel.test.ts | 5 +++++ .../ethereum/smoke/order/mint-floorbid-accepbid.test.ts | 5 +++++ .../smoke/order/mint-floorbid-bidupdate-accepbid.test.ts | 5 +++++ .../ethereum/smoke/order/mint-floorbid-cancel.test.ts | 5 +++++ .../tests/ethereum/smoke/order/mint-sell-buy.test.ts | 9 +++++++++ .../tests/ethereum/smoke/order/mint-sell-cancel.test.ts | 9 +++++++++ .../smoke/order/mint-sell-sellupdate-buy.test.ts | 9 +++++++++ packages/ethereum/sdk/src/nft/burn.test.ts | 6 +++--- 13 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 packages/e2e-tests/tests/common/utils.ts diff --git a/packages/e2e-tests/tests/common/utils.ts b/packages/e2e-tests/tests/common/utils.ts new file mode 100644 index 000000000..462cb1f18 --- /dev/null +++ b/packages/e2e-tests/tests/common/utils.ts @@ -0,0 +1,3 @@ +export function getEndDateAfterMonthAsDate(): Date { + return new Date(Math.floor(Date.now() + 1000 * 60 * 60 * 24 * 30 / 1000)) +} \ No newline at end of file diff --git a/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts b/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts index 1abb101ef..63d61df12 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts @@ -34,6 +34,7 @@ import { getSellOrdersRaw, } from "../../../common/api-helpers/order-helper" import { bid } from "../../../common/atoms-tests/bid" +import { getEndDateAfterMonthAsDate } from "../../../common/utils" function suites(): { blockchain: Blockchain, @@ -70,6 +71,7 @@ function suites(): { amount: 3, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, bidRequest: async (currency: RequestCurrency): Promise => { @@ -77,6 +79,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, diff --git a/packages/e2e-tests/tests/ethereum/smoke/nft/mint-and-sell-buy.test.ts b/packages/e2e-tests/tests/ethereum/smoke/nft/mint-and-sell-buy.test.ts index 18ac8115e..87f39b249 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/nft/mint-and-sell-buy.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/nft/mint-and-sell-buy.test.ts @@ -14,6 +14,7 @@ import { getCollection } from "../../../common/helpers" import { mintAndSell } from "../../../common/atoms-tests/mint-and-sell" import { buy } from "../../../common/atoms-tests/buy" import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" +import { getEndDateAfterMonthAsDate } from "../../../common/utils" function suites(): { blockchain: Blockchain, @@ -48,6 +49,7 @@ function suites(): { currency: { "@type": "ETH", }, + expirationDate: getEndDateAfterMonthAsDate(), } }, buyAmount: 1, @@ -76,6 +78,7 @@ function suites(): { currency: { "@type": "ETH", }, + expirationDate: getEndDateAfterMonthAsDate(), } }, buyAmount: 1, @@ -104,6 +107,7 @@ function suites(): { currency: { "@type": "ETH", }, + expirationDate: getEndDateAfterMonthAsDate(), } }, buyAmount: 11, @@ -132,6 +136,7 @@ function suites(): { currency: { "@type": "ETH", }, + expirationDate: getEndDateAfterMonthAsDate(), } }, buyAmount: 11, diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-accepbid.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-accepbid.test.ts index 89784092c..1776d2428 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-accepbid.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-accepbid.test.ts @@ -19,6 +19,7 @@ import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { awaitForOwnershipValue } from "../../../common/api-helpers/ownership-helper" import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" +import { getEndDateAfterMonthAsDate } from "../../../common/utils" function suites(): { blockchain: Blockchain, @@ -56,6 +57,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -85,6 +87,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -114,6 +117,7 @@ function suites(): { amount: 5, price: toBigNumber("10"), currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -143,6 +147,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-bidupdate-accepbid.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-bidupdate-accepbid.test.ts index e24735d3f..fe0f16fe1 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-bidupdate-accepbid.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-bidupdate-accepbid.test.ts @@ -21,6 +21,7 @@ import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { awaitForOwnershipValue } from "../../../common/api-helpers/ownership-helper" import { bidUpdate } from "../../../common/atoms-tests/bid-update" +import { getEndDateAfterMonthAsDate } from "../../../common/utils" function suites(): { blockchain: Blockchain, @@ -59,6 +60,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateBidRequest: { @@ -91,6 +93,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateBidRequest: { @@ -123,6 +126,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateBidRequest: { @@ -155,6 +159,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateBidRequest: { diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-cancel.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-cancel.test.ts index acbc5708c..9462fe5be 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-cancel.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-cancel.test.ts @@ -17,6 +17,7 @@ import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { cancel } from "../../../common/atoms-tests/cancel" import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" +import { getEndDateAfterMonthAsDate } from "../../../common/utils" function suites(): { blockchain: Blockchain, @@ -56,6 +57,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -86,6 +88,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -116,6 +119,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -146,6 +150,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-accepbid.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-accepbid.test.ts index 2881979fb..dd58f6119 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-accepbid.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-accepbid.test.ts @@ -20,6 +20,7 @@ import { acceptBid } from "../../../common/atoms-tests/accept-bid" import { getCurrency } from "../../../common/currency" import { awaitForOwnershipValue } from "../../../common/api-helpers/ownership-helper" import { createCollection } from "../../../common/atoms-tests/create-collection" +import { getEndDateAfterMonthAsDate } from "../../../common/utils" function suites(): { blockchain: Blockchain, @@ -65,6 +66,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -102,6 +104,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -139,6 +142,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -176,6 +180,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-bidupdate-accepbid.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-bidupdate-accepbid.test.ts index ba9e1d2ef..600741ce8 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-bidupdate-accepbid.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-bidupdate-accepbid.test.ts @@ -22,6 +22,7 @@ import { getCurrency } from "../../../common/currency" import { awaitForOwnershipValue } from "../../../common/api-helpers/ownership-helper" import { bidUpdate } from "../../../common/atoms-tests/bid-update" import { createCollection } from "../../../common/atoms-tests/create-collection" +import { getEndDateAfterMonthAsDate } from "../../../common/utils" function suites(): { blockchain: Blockchain, @@ -68,6 +69,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateBidRequest: { @@ -108,6 +110,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateBidRequest: { @@ -148,6 +151,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateBidRequest: { @@ -188,6 +192,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateBidRequest: { diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-cancel.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-cancel.test.ts index 470661136..351ddc7d4 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-cancel.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-cancel.test.ts @@ -18,6 +18,7 @@ import { bid } from "../../../common/atoms-tests/bid" import { getCurrency } from "../../../common/currency" import { cancel } from "../../../common/atoms-tests/cancel" import { createCollection } from "../../../common/atoms-tests/create-collection" +import { getEndDateAfterMonthAsDate } from "../../../common/utils" function suites(): { blockchain: Blockchain, @@ -65,6 +66,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -103,6 +105,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -141,6 +144,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -179,6 +183,7 @@ function suites(): { amount: 5, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-buy.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-buy.test.ts index 5b15e83d9..7ec1755dc 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-buy.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-buy.test.ts @@ -19,6 +19,7 @@ import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { awaitForOwnershipValue } from "../../../common/api-helpers/ownership-helper" import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" +import { getEndDateAfterMonthAsDate } from "../../../common/utils" function suites(): { blockchain: Blockchain, @@ -56,6 +57,7 @@ function suites(): { amount: 1, price: "0.0000000000000001", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -85,6 +87,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -114,6 +117,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -143,6 +147,7 @@ function suites(): { amount: 1, price: "0.0000000000000001", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -172,6 +177,7 @@ function suites(): { amount: 3, price: "0.0000000000000001", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -201,6 +207,7 @@ function suites(): { amount: 3, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -230,6 +237,7 @@ function suites(): { amount: 3, price: "0.0000000000000001", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -259,6 +267,7 @@ function suites(): { amount: 3, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-cancel.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-cancel.test.ts index 8119e8310..68c0f3b32 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-cancel.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-cancel.test.ts @@ -17,6 +17,7 @@ import { cancel } from "../../../common/atoms-tests/cancel" import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" +import { getEndDateAfterMonthAsDate } from "../../../common/utils" function suites(): { blockchain: Blockchain, @@ -56,6 +57,7 @@ function suites(): { amount: 1, price: "0.0000000000000001", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -86,6 +88,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -116,6 +119,7 @@ function suites(): { amount: 1, price: "0.0000000000000001", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -146,6 +150,7 @@ function suites(): { amount: 1, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -176,6 +181,7 @@ function suites(): { amount: 20, price: "0.0000000000000001", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -206,6 +212,7 @@ function suites(): { amount: 20, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -236,6 +243,7 @@ function suites(): { amount: 20, price: "0.0000000000000001", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, @@ -266,6 +274,7 @@ function suites(): { amount: 20, price: "10", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, }, diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-sellupdate-buy.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-sellupdate-buy.test.ts index de2eec44e..cf4c1a1cc 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-sellupdate-buy.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-sellupdate-buy.test.ts @@ -20,6 +20,7 @@ import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { awaitForOwnershipValue } from "../../../common/api-helpers/ownership-helper" import { sellUpdate } from "../../../common/atoms-tests/sell-update" +import { getEndDateAfterMonthAsDate } from "../../../common/utils" function suites(): { blockchain: Blockchain, @@ -58,6 +59,7 @@ function suites(): { amount: 1, price: "12", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateSellRequest: { @@ -90,6 +92,7 @@ function suites(): { amount: 1, price: "0.0000000000000002", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateSellRequest: { @@ -122,6 +125,7 @@ function suites(): { amount: 1, price: "12", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateSellRequest: { @@ -154,6 +158,7 @@ function suites(): { amount: 1, price: "0.0000000000000002", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateSellRequest: { @@ -186,6 +191,7 @@ function suites(): { amount: 3, price: "12", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateSellRequest: { @@ -218,6 +224,7 @@ function suites(): { amount: 3, price: "0.0000000000000002", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateSellRequest: { @@ -250,6 +257,7 @@ function suites(): { amount: 3, price: "12", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateSellRequest: { @@ -282,6 +290,7 @@ function suites(): { amount: 3, price: "0.0000000000000002", currency: currency, + expirationDate: getEndDateAfterMonthAsDate(), } }, updateSellRequest: { diff --git a/packages/ethereum/sdk/src/nft/burn.test.ts b/packages/ethereum/sdk/src/nft/burn.test.ts index 321ef3db9..e81466a6e 100644 --- a/packages/ethereum/sdk/src/nft/burn.test.ts +++ b/packages/ethereum/sdk/src/nft/burn.test.ts @@ -114,7 +114,7 @@ describe.each(providers)("burn nfts", (ethereum: Ethereum) => { expect(toBn(testBalanceAfterBurn).toString()).toBe("50") }) - test.skip("should burn ERC-721 v3 lazy", async () => { + test("should burn ERC-721 v3 lazy", async () => { const minted = await mint( mintLazyApi, checkChainId, @@ -146,7 +146,7 @@ describe.each(providers)("burn nfts", (ethereum: Ethereum) => { }) }) - test.skip("should burn ERC-1155 v2 lazy", async () => { + test("should burn ERC-1155 v2 lazy", async () => { const minted = await mint(mintLazyApi, checkChainId, { collection: createErc1155V2Collection(e2eErc1155V2ContractAddress), uri: "ipfs://ipfs/hash", @@ -178,7 +178,7 @@ describe.each(providers)("burn nfts", (ethereum: Ethereum) => { }) }) - test.skip("should burn ERC-1155 v2 lazy and burn creators is empty", async () => { + test("should burn ERC-1155 v2 lazy and burn creators is empty", async () => { const minted = await mint(mintLazyApi, checkChainId, { collection: createErc1155V2Collection(e2eErc1155V2ContractAddress), uri: "ipfs://ipfs/hash", From 3465ec0c598cec66bd2bb75062194a2aa653f27f Mon Sep 17 00:00:00 2001 From: Vadim Fadeev Date: Wed, 20 Sep 2023 18:14:59 +0100 Subject: [PATCH 2/5] feat: add api key to sdk --- .dockerignore | 3 ++- .gitignore | 1 + packages/e2e-tests/tests/common/create-sdk.ts | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index e5f8714f0..47b1019bb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,4 +16,5 @@ scripts # packages packages !packages/transaction-backend -packages/transaction-backend/node_modules \ No newline at end of file +packages/transaction-backend/node_modules +packages/e2e-tests/allure-results \ No newline at end of file diff --git a/.gitignore b/.gitignore index bde3f6a8f..6f6e10d89 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ storybook-static yarn-error.log lerna-debug.log .env +packages/e2e-tests/allure-results diff --git a/packages/e2e-tests/tests/common/create-sdk.ts b/packages/e2e-tests/tests/common/create-sdk.ts index 974488a6a..861d129a7 100644 --- a/packages/e2e-tests/tests/common/create-sdk.ts +++ b/packages/e2e-tests/tests/common/create-sdk.ts @@ -21,11 +21,11 @@ export function createSdk(blockchain: Blockchain, wallet: BlockchainWallet): IRa break default: } - return createRaribleSdk( wallet, env, { + apiKey: process.env.SDK_API_KEY_TESTNET, logs: LogsLevel.DISABLED, ...(flowAuth ? { blockchain: { @@ -33,7 +33,7 @@ export function createSdk(blockchain: Blockchain, wallet: BlockchainWallet): IRa auth: flowAuth, }, }, - } : {}), + } : { apiKey: process.env.SDK_API_KEY_TESTNET }), }, ) } From 9894e632659d95a93e43ae48bb8f1c698bf86947 Mon Sep 17 00:00:00 2001 From: Vadim Fadeev Date: Thu, 12 Oct 2023 16:38:31 +0100 Subject: [PATCH 3/5] feat: add retry --- .eslintignore | 1 + .../connectors/connector-beacon/package.json | 6 +- .../connectors/connector-fcl/package.json | 6 +- .../connector-fortmatic/package.json | 6 +- .../connectors/connector-helper/package.json | 6 +- .../connectors/connector-iframe/package.json | 6 +- .../connector-immutablex-link/package.json | 6 +- .../connectors/connector-mattel/package.json | 6 +- .../connectors/connector-mew/package.json | 6 +- .../connectors/connector-nfid/package.json | 6 +- .../connectors/connector-phantom/package.json | 6 +- .../connectors/connector-portis/package.json | 6 +- .../connector-solflare/package.json | 6 +- .../connectors/connector-torus/package.json | 6 +- .../connector-walletconnect-v2/package.json | 6 +- .../connector-walletconnect/package.json | 6 +- .../connector-walletlink/package.json | 6 +- packages/connectors/connector/package.json | 6 +- packages/e2e-tests/package.json | 2 +- .../common/api-helpers/activity-helper.ts | 2 +- .../tests/common/api-helpers/item-helper.ts | 4 + .../tests/common/config/settings-factory.ts | 22 +++++ packages/e2e-tests/tests/common/helpers.ts | 2 +- .../tests/ethereum/smoke/api/activity.test.ts | 16 ++-- .../tests/ethereum/smoke/api/item.test.ts | 13 +-- .../tests/ethereum/smoke/api/order.test.ts | 26 ++++-- .../ethereum/smoke/api/ownership.test.ts | 12 +-- .../smoke/nft/mint-and-sell-buy.test.ts | 16 ++-- .../smoke/nft/mint-transfer-burn.test.ts | 17 ++-- .../smoke/order/mint-bid-accepbid.test.ts | 66 +++++++++++--- .../order/mint-bid-bidupdate-accepbid.test.ts | 54 ++++++++++-- .../smoke/order/mint-bid-cancel.test.ts | 19 ++-- .../smoke/order/mint-sell-buy.test.ts | 88 ++++++++++++++++--- .../smoke/order/mint-sell-cancel.test.ts | 88 ++++++++++++++++--- .../order/mint-sell-sellupdate-buy.test.ts | 33 ++++--- packages/example/package.json | 44 +++++----- packages/sdk-examples/package.json | 6 +- packages/solana-common/package.json | 8 +- packages/solana-sdk/package.json | 2 +- packages/solana-wallet/package.json | 2 +- packages/transaction-backend/package.json | 8 +- 41 files changed, 464 insertions(+), 189 deletions(-) create mode 100644 packages/e2e-tests/tests/common/config/settings-factory.ts diff --git a/.eslintignore b/.eslintignore index ea8d82608..744cfa581 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,3 +5,4 @@ **/esm **/docs packages/sdk/example +packages/e2e-tests/allure-results \ No newline at end of file diff --git a/packages/connectors/connector-beacon/package.json b/packages/connectors/connector-beacon/package.json index 5decb5de3..724297bae 100644 --- a/packages/connectors/connector-beacon/package.json +++ b/packages/connectors/connector-beacon/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -30,5 +27,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-fcl/package.json b/packages/connectors/connector-fcl/package.json index 9c52a5926..528c25045 100644 --- a/packages/connectors/connector-fcl/package.json +++ b/packages/connectors/connector-fcl/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -29,5 +26,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-fortmatic/package.json b/packages/connectors/connector-fortmatic/package.json index 066b8e956..09e9423ad 100644 --- a/packages/connectors/connector-fortmatic/package.json +++ b/packages/connectors/connector-fortmatic/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -29,5 +26,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-helper/package.json b/packages/connectors/connector-helper/package.json index b850520a5..b4227f099 100644 --- a/packages/connectors/connector-helper/package.json +++ b/packages/connectors/connector-helper/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -38,5 +35,8 @@ "peerDependencies": { "rxjs": ">= 6.6.7 < 8.0.0", "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-iframe/package.json b/packages/connectors/connector-iframe/package.json index 78f902e74..54fd53824 100644 --- a/packages/connectors/connector-iframe/package.json +++ b/packages/connectors/connector-iframe/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -29,5 +26,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-immutablex-link/package.json b/packages/connectors/connector-immutablex-link/package.json index 14b81d764..ed347f24e 100644 --- a/packages/connectors/connector-immutablex-link/package.json +++ b/packages/connectors/connector-immutablex-link/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -31,5 +28,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-mattel/package.json b/packages/connectors/connector-mattel/package.json index 1680bc3f7..88bdc0c8e 100644 --- a/packages/connectors/connector-mattel/package.json +++ b/packages/connectors/connector-mattel/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -34,5 +31,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-mew/package.json b/packages/connectors/connector-mew/package.json index 7d329e5b9..92223b6c2 100644 --- a/packages/connectors/connector-mew/package.json +++ b/packages/connectors/connector-mew/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -31,5 +28,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-nfid/package.json b/packages/connectors/connector-nfid/package.json index 9bfcfdd74..d6adf5beb 100644 --- a/packages/connectors/connector-nfid/package.json +++ b/packages/connectors/connector-nfid/package.json @@ -4,9 +4,6 @@ "license": "ISC", "main": "build/index.js", "types": "build/index.d.ts", - "publishConfig": { - "access": "public" - }, "files": [ "build" ], @@ -31,5 +28,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-phantom/package.json b/packages/connectors/connector-phantom/package.json index 0d6fb4ea4..781c9dda7 100644 --- a/packages/connectors/connector-phantom/package.json +++ b/packages/connectors/connector-phantom/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -30,5 +27,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-portis/package.json b/packages/connectors/connector-portis/package.json index cf4f44f7b..1fbd05e98 100644 --- a/packages/connectors/connector-portis/package.json +++ b/packages/connectors/connector-portis/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -29,5 +26,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-solflare/package.json b/packages/connectors/connector-solflare/package.json index bdd8485b3..61d8effc3 100644 --- a/packages/connectors/connector-solflare/package.json +++ b/packages/connectors/connector-solflare/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -31,5 +28,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-torus/package.json b/packages/connectors/connector-torus/package.json index c3945ee5b..d789c0f66 100644 --- a/packages/connectors/connector-torus/package.json +++ b/packages/connectors/connector-torus/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -31,5 +28,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-walletconnect-v2/package.json b/packages/connectors/connector-walletconnect-v2/package.json index 6b19249c8..d120c4ead 100644 --- a/packages/connectors/connector-walletconnect-v2/package.json +++ b/packages/connectors/connector-walletconnect-v2/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -30,5 +27,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-walletconnect/package.json b/packages/connectors/connector-walletconnect/package.json index 51cdec1e6..0501c99ca 100644 --- a/packages/connectors/connector-walletconnect/package.json +++ b/packages/connectors/connector-walletconnect/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -29,5 +26,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector-walletlink/package.json b/packages/connectors/connector-walletlink/package.json index 00eba3771..9f375cfdd 100644 --- a/packages/connectors/connector-walletlink/package.json +++ b/packages/connectors/connector-walletlink/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -29,5 +26,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/connectors/connector/package.json b/packages/connectors/connector/package.json index eaf76112e..6a2bbb81b 100644 --- a/packages/connectors/connector/package.json +++ b/packages/connectors/connector/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -32,5 +29,8 @@ "peerDependencies": { "rxjs": ">= 6.6.7 < 8.0.0", "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index 82c9c4ba3..dd81415bd 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -1,9 +1,9 @@ { "name": "@rarible/sdk-e2e-tests", "version": "0.13.50-beta.1", + "private": true, "homepage": "", "license": "ISC", - "private": true, "scripts": { "test": "echo run e2e-test to run e2e-tests", "e2e-tests": "jest --runInBand", diff --git a/packages/e2e-tests/tests/common/api-helpers/activity-helper.ts b/packages/e2e-tests/tests/common/api-helpers/activity-helper.ts index f1aea7d39..83f62c38a 100644 --- a/packages/e2e-tests/tests/common/api-helpers/activity-helper.ts +++ b/packages/e2e-tests/tests/common/api-helpers/activity-helper.ts @@ -49,7 +49,7 @@ export async function getActivitiesByItem(sdk: IRaribleSdk, itemId: string, }) expect(activities).not.toBe(null) if (typeof shouldPresent !== "undefined") { - Logger.log(activities.activities) + Logger.log(activities.activities) expect(activities.activities.map(a => a["@type"]).sort()).toEqual(shouldPresent.sort()) } return activities diff --git a/packages/e2e-tests/tests/common/api-helpers/item-helper.ts b/packages/e2e-tests/tests/common/api-helpers/item-helper.ts index e5121a766..b8bdd55fc 100644 --- a/packages/e2e-tests/tests/common/api-helpers/item-helper.ts +++ b/packages/e2e-tests/tests/common/api-helpers/item-helper.ts @@ -218,3 +218,7 @@ export async function verifyItemsContainsItem(items: Items, itemId: ItemId): Pro const ids = items.items.map(c => c.id) expect(ids).toContain(itemId) } + +export function sleep(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)) +} diff --git a/packages/e2e-tests/tests/common/config/settings-factory.ts b/packages/e2e-tests/tests/common/config/settings-factory.ts new file mode 100644 index 000000000..d09a36092 --- /dev/null +++ b/packages/e2e-tests/tests/common/config/settings-factory.ts @@ -0,0 +1,22 @@ +import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified" +import { Blockchain } from "@rarible/api-client" + +export const ERC_721_REQUEST = { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "erc721", + symbol: "rari", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, +} as CreateCollectionRequestSimplified + +export const ERC_1155_REQUEST = { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, +} as CreateCollectionRequestSimplified \ No newline at end of file diff --git a/packages/e2e-tests/tests/common/helpers.ts b/packages/e2e-tests/tests/common/helpers.ts index 53c385f9f..f9f3607f1 100644 --- a/packages/e2e-tests/tests/common/helpers.ts +++ b/packages/e2e-tests/tests/common/helpers.ts @@ -13,7 +13,7 @@ export async function awaitOrderStock( id: OrderId, awaitingValue: BigNumber | string, ): Promise { - return retry(20, 2000, async () => { + return retry(20, 3000, async () => { const order = await sdk.apis.order.getOrderById({ id }) expect(order.makeStock.toString()).toEqual(awaitingValue.toString()) return order diff --git a/packages/e2e-tests/tests/ethereum/smoke/api/activity.test.ts b/packages/e2e-tests/tests/ethereum/smoke/api/activity.test.ts index 598856fe5..96466f9f7 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/api/activity.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/api/activity.test.ts @@ -9,11 +9,11 @@ import type { GetAllActivities200, } from "@rarible/api-client/build/apis/ActivityControllerApi" import { UserActivityType } from "@rarible/api-client/build/models" +import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified" import { getEthereumWallet, getWalletAddressFull } from "../../../common/wallet" import { createSdk } from "../../../common/create-sdk" import { mint } from "../../../common/atoms-tests/mint" import { awaitExpected, getCollection } from "../../../common/helpers" -import { testsConfig } from "../../../common/config" import { getActivitiesByCollection, getActivitiesByCollectionRaw, @@ -25,17 +25,20 @@ import { getAllActivitiesRaw, } from "../../../common/api-helpers/activity-helper" +import { createCollection } from "../../../common/atoms-tests/create-collection" +import { ERC_1155_REQUEST } from "../../../common/config/settings-factory" + function suites(): { blockchain: Blockchain, wallets: { seller: BlockchainWallet }, - collectionId: string, + deployRequest: CreateCollectionRequestSimplified, mintRequest: (address: UnionAddress) => MintRequest }[] { return [ { blockchain: Blockchain.ETHEREUM, wallets: { seller: getEthereumWallet() }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: ERC_1155_REQUEST, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -59,19 +62,20 @@ describe.each(suites())("$blockchain api => activity", (suite) => { test("activity controller", async () => { const walletAddressSeller = await getWalletAddressFull(sellerWallet) - const collection = await getCollection(sellerSdk, suite.collectionId) + const { address } = await createCollection(sellerSdk, sellerWallet, suite.deployRequest) + const collection = await getCollection(sellerSdk, address) const { nft } = await mint(sellerSdk, sellerWallet, { collection }, suite.mintRequest(walletAddressSeller.unionAddress)) await awaitExpected(async () => { const activitiesByCollection = await getActivitiesByCollection(sellerSdk, - suite.collectionId, [ActivityType.MINT]) + collection.id, [ActivityType.MINT]) expect(activitiesByCollection.activities.length).toBeGreaterThanOrEqual(1) }) await awaitExpected(async () => { const activitiesByCollectionRaw = await getActivitiesByCollectionRaw(sellerSdk, - suite.collectionId, [ActivityType.MINT]) as GetActivitiesByCollection200 + collection.id, [ActivityType.MINT]) as GetActivitiesByCollection200 expect(activitiesByCollectionRaw.value.activities.length).toBeGreaterThanOrEqual(1) }) await awaitExpected(async () => { diff --git a/packages/e2e-tests/tests/ethereum/smoke/api/item.test.ts b/packages/e2e-tests/tests/ethereum/smoke/api/item.test.ts index 9e3cf01d7..50ae0f291 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/api/item.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/api/item.test.ts @@ -12,8 +12,8 @@ import type { UnionAddress } from "@rarible/types" import { toBigNumber } from "@rarible/types" import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request.type" import type { GetAllItems200 } from "@rarible/api-client/build/apis/ItemControllerApi" +import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified" import { getEthereumWallet, getWalletAddressFull } from "../../../common/wallet" -import { testsConfig } from "../../../common/config" import { createSdk } from "../../../common/create-sdk" import { mint } from "../../../common/atoms-tests/mint" import { awaitExpected, awaitForItemSupply, getCollection } from "../../../common/helpers" @@ -31,19 +31,20 @@ import { getItemsByOwner, getItemsByOwnerRaw, } from "../../../common/api-helpers/item-helper" - +import { createCollection } from "../../../common/atoms-tests/create-collection" +import { ERC_1155_REQUEST } from "../../../common/config/settings-factory" function suites(): { blockchain: Blockchain, wallet: BlockchainWallet, - collectionId: string, + deployRequest: CreateCollectionRequestSimplified, mintRequest: (address: UnionAddress) => MintRequest, }[] { return [ { blockchain: Blockchain.ETHEREUM, wallet: getEthereumWallet(), - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: ERC_1155_REQUEST, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG1", @@ -66,7 +67,8 @@ describe.each(suites())("$blockchain api => ownership", (suite) => { test("item controller", async () => { const address = await getWalletAddressFull(wallet) - const collection = await getCollection(sdk, suite.collectionId) + const { address: addressCollection } = await createCollection(sdk, wallet, suite.deployRequest) + const collection = await getCollection(sdk, addressCollection) const { nft } = await mint(sdk, wallet, { collection }, suite.mintRequest(address.unionAddress)) @@ -106,6 +108,7 @@ describe.each(suites())("$blockchain api => ownership", (suite) => { const itemsByOwner = await getItemsByOwner(sdk, address.unionAddress, 2) expect(itemsByOwner.items.length).toBeGreaterThanOrEqual(1) }) + await awaitExpected(async () => { const itemsByOwnerRaw = await getItemsByOwnerRaw(sdk, address.unionAddress, 2) as GetItemsByOwner200 diff --git a/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts b/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts index 63d61df12..f0a6cdfa1 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts @@ -12,12 +12,12 @@ import type { GetSellOrdersByItem200, GetSellOrdersByMaker200, } from "@rarible/api-client/build/apis/OrderControllerApi" +import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified" import { sell } from "../../../common/atoms-tests/sell" import { getEthereumWallet, getEthereumWalletBuyer, getWalletAddressFull } from "../../../common/wallet" import { createSdk } from "../../../common/create-sdk" import { mint } from "../../../common/atoms-tests/mint" import { getCollection } from "../../../common/helpers" -import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { getOrderBidsByItem, @@ -35,11 +35,14 @@ import { } from "../../../common/api-helpers/order-helper" import { bid } from "../../../common/atoms-tests/bid" import { getEndDateAfterMonthAsDate } from "../../../common/utils" +import { createCollection } from "../../../common/atoms-tests/create-collection" +import { ERC_1155_REQUEST } from "../../../common/config/settings-factory" +import { sleep } from "../../../common/api-helpers/item-helper" function suites(): { blockchain: Blockchain, wallets: { seller: BlockchainWallet, buyer: BlockchainWallet }, - collectionId: string, + deployRequest: CreateCollectionRequestSimplified, mintRequest: (address: UnionAddress) => MintRequest, currency: string, sellRequest: (currency: RequestCurrency) => Promise, @@ -52,7 +55,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: ERC_1155_REQUEST, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -97,8 +100,9 @@ describe.each(suites())("$blockchain api => order", (suite) => { test("order controller", async () => { const walletAddressSeller = await getWalletAddressFull(sellerWallet) - const collection = await getCollection(sellerSdk, suite.collectionId) - + const { address } = await createCollection(sellerSdk, sellerWallet, suite.deployRequest) + const collection = await getCollection(sellerSdk, address) + await sleep(5000) const { nft } = await mint(sellerSdk, sellerWallet, { collection }, suite.mintRequest(walletAddressSeller.unionAddress)) @@ -113,7 +117,7 @@ describe.each(suites())("$blockchain api => order", (suite) => { const ordersAllRaw = await getOrdersAllRaw(sellerSdk, [suite.blockchain], 2) as GetOrdersAll200 expect(ordersAllRaw.value.orders.length).toBeGreaterThanOrEqual(1) - + await sleep(1000) const ordersByIds = await getOrdersByIds(sellerSdk, sellOrder.id) expect(ordersByIds.orders.length).toBeGreaterThanOrEqual(1) @@ -142,17 +146,21 @@ describe.each(suites())("$blockchain api => order", (suite) => { expect(sellOrdersByMakerRaw.value.orders.length).toBeGreaterThanOrEqual(1) const bidRequest = await suite.bidRequest(requestCurrency) - await bid(buyerSdk, buyerWallet, { itemId: nft.id }, bidRequest) - + await sleep(5000) + await retry(40, 3000, async () => { + await bid(buyerSdk, buyerWallet, { itemId: nft.id }, bidRequest) + }) await retry(40, 3000, async () => { const orderBidsByItem = await getOrderBidsByItem(sellerSdk, nft.contract!, nft.tokenId!, 2) expect(orderBidsByItem.orders.length).toBeGreaterThanOrEqual(1) }) - + await sleep(1000) + console.log("await getOrderBidsByItemRaw(sellerSdk, nft.contract!, nft.tokenId!") await retry(40, 3000, async () => { const orderBidsByItemRaw = await getOrderBidsByItemRaw(sellerSdk, nft.contract!, nft.tokenId!, 2) as GetOrderBidsByItem200 expect(orderBidsByItemRaw.value.orders.length).toBeGreaterThanOrEqual(1) }) + await sleep(1000) }) }) diff --git a/packages/e2e-tests/tests/ethereum/smoke/api/ownership.test.ts b/packages/e2e-tests/tests/ethereum/smoke/api/ownership.test.ts index 887d3763e..26062bd8f 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/api/ownership.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/api/ownership.test.ts @@ -4,8 +4,8 @@ import type { UnionAddress } from "@rarible/types" import { toBigNumber } from "@rarible/types" import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request.type" import type { GetOwnershipsByItem200 } from "@rarible/api-client/build/apis/OwnershipControllerApi" +import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified" import { getEthereumWallet, getWalletAddressFull } from "../../../common/wallet" -import { testsConfig } from "../../../common/config" import { createSdk } from "../../../common/create-sdk" import { mint } from "../../../common/atoms-tests/mint" import { awaitExpected, getCollection } from "../../../common/helpers" @@ -15,19 +15,20 @@ import { getOwnershipsByItem, getOwnershipsByItemRaw, } from "../../../common/api-helpers/ownership-helper" - +import { createCollection } from "../../../common/atoms-tests/create-collection" +import { ERC_1155_REQUEST } from "../../../common/config/settings-factory" function suites(): { blockchain: Blockchain, wallet: BlockchainWallet, - collectionId: string, + deployRequest: CreateCollectionRequestSimplified, mintRequest: (address: UnionAddress) => MintRequest, }[] { return [ { blockchain: Blockchain.ETHEREUM, wallet: getEthereumWallet(), - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: ERC_1155_REQUEST, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -50,7 +51,8 @@ describe.each(suites())("$blockchain api => ownership", (suite) => { test("ownership controller", async () => { const address = await getWalletAddressFull(wallet) - const collection = await getCollection(sdk, suite.collectionId) + const { address: addressCollection } = await createCollection(sdk, wallet, suite.deployRequest) + const collection = await getCollection(sdk, addressCollection) const { nft } = await mint(sdk, wallet, { collection }, suite.mintRequest(address.unionAddress)) diff --git a/packages/e2e-tests/tests/ethereum/smoke/nft/mint-and-sell-buy.test.ts b/packages/e2e-tests/tests/ethereum/smoke/nft/mint-and-sell-buy.test.ts index 87f39b249..2ed340bfc 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/nft/mint-and-sell-buy.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/nft/mint-and-sell-buy.test.ts @@ -3,6 +3,7 @@ import type { UnionAddress } from "@rarible/types" import { toBigNumber } from "@rarible/types" import type { BlockchainWallet } from "@rarible/sdk-wallet" import type { MintAndSellRequest } from "@rarible/sdk" +import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified" import { getEthereumWallet, getWalletAddressFull, @@ -15,12 +16,14 @@ import { mintAndSell } from "../../../common/atoms-tests/mint-and-sell" import { buy } from "../../../common/atoms-tests/buy" import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" import { getEndDateAfterMonthAsDate } from "../../../common/utils" +import { createCollection } from "../../../common/atoms-tests/create-collection" +import { ERC_1155_REQUEST, ERC_721_REQUEST } from "../../../common/config/settings-factory" function suites(): { blockchain: Blockchain, description: string, wallets: { creator: BlockchainWallet, buyer: BlockchainWallet }, - collectionId: string, + deployRequest: CreateCollectionRequestSimplified, mintAndSellRequest: (address: UnionAddress) => MintAndSellRequest, buyAmount: number, creatorBalance: number, @@ -34,7 +37,7 @@ function suites(): { creator: getEthereumWallet(), buyer: getEthereumWallet(testsConfig.variables.ETHEREUM_WALLET_BUYER), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: ERC_721_REQUEST, mintAndSellRequest: (walletAddress: UnionAddress): MintAndSellRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -63,7 +66,7 @@ function suites(): { creator: getEthereumWallet(), buyer: getEthereumWallet(testsConfig.variables.ETHEREUM_WALLET_BUYER), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: ERC_721_REQUEST, mintAndSellRequest: (walletAddress: UnionAddress): MintAndSellRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -92,7 +95,7 @@ function suites(): { creator: getEthereumWallet(), buyer: getEthereumWallet(testsConfig.variables.ETHEREUM_WALLET_BUYER), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: ERC_1155_REQUEST, mintAndSellRequest: (walletAddress: UnionAddress): MintAndSellRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -121,7 +124,7 @@ function suites(): { creator: getEthereumWallet(), buyer: getEthereumWallet(testsConfig.variables.ETHEREUM_WALLET_BUYER), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: ERC_1155_REQUEST, mintAndSellRequest: (walletAddress: UnionAddress): MintAndSellRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -157,7 +160,8 @@ describe.each(suites())("$blockchain mint-and-sell => buy", (suite) => { test(suite.description, async () => { const walletAddressCreator = await getWalletAddressFull(creatorWallet) const walletAddressBuyer = await getWalletAddressFull(buyerWallet) - const collection = await getCollection(creatorSdk, suite.collectionId) + const { address } = await createCollection(creatorSdk, creatorWallet, suite.deployRequest) + const collection = await getCollection(creatorSdk, address) const mintAndSellResponse = await mintAndSell(creatorSdk, creatorWallet, { collection }, suite.mintAndSellRequest(walletAddressCreator.unionAddress)) diff --git a/packages/e2e-tests/tests/ethereum/smoke/nft/mint-transfer-burn.test.ts b/packages/e2e-tests/tests/ethereum/smoke/nft/mint-transfer-burn.test.ts index 62881e14d..25433347b 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/nft/mint-transfer-burn.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/nft/mint-transfer-burn.test.ts @@ -6,25 +6,27 @@ import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request import type { BlockchainWallet } from "@rarible/sdk-wallet" import type { BurnRequest } from "@rarible/sdk/build/types/nft/burn/domain" import type { TransferRequest } from "@rarible/sdk/build/types/nft/transfer/domain" +import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified" import { getEthereumWallet, getEthereumWalletBuyer, getWalletAddressFull, } from "../../../common/wallet" import { createSdk } from "../../../common/create-sdk" import { mint } from "../../../common/atoms-tests/mint" -import { testsConfig } from "../../../common/config" import { burn } from "../../../common/atoms-tests/burn" import { transfer } from "../../../common/atoms-tests/transfer" import { getCollectionById } from "../../../common/api-helpers/collection-helper" import { awaitForOwnershipValue } from "../../../common/api-helpers/ownership-helper" import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" import { getAllItems, verifyItemsByBlockchain, verifyItemsContainsItem } from "../../../common/api-helpers/item-helper" +import { createCollection } from "../../../common/atoms-tests/create-collection" +import { ERC_1155_REQUEST, ERC_721_REQUEST } from "../../../common/config/settings-factory" function suites(): { blockchain: Blockchain, description: string, wallets: { creator: BlockchainWallet, recipient: BlockchainWallet }, - collectionId: string, + deployRequest: CreateCollectionRequestSimplified, mintRequest: (address: UnionAddress) => MintRequest, transferRequest: (address: UnionAddress) => TransferRequest, creatorBalanceAfterTransfer: string, @@ -40,7 +42,7 @@ function suites(): { creator: getEthereumWallet(), recipient: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: ERC_721_REQUEST, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG1", @@ -74,7 +76,7 @@ function suites(): { creator: getEthereumWallet(), recipient: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: ERC_721_REQUEST, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG1", @@ -108,7 +110,7 @@ function suites(): { creator: getEthereumWallet(), recipient: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: ERC_1155_REQUEST, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG1", @@ -142,7 +144,7 @@ function suites(): { creator: getEthereumWallet(), recipient: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: ERC_1155_REQUEST, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG1", @@ -184,7 +186,8 @@ describe.each(suites())("$blockchain mint => transfer => burn", (suite) => { const creatorWalletAddress = await getWalletAddressFull(creatorWallet) const recipientWalletAddress = await getWalletAddressFull(recipientWallet) - const collection = await getCollectionById(creatorSdk, suite.collectionId) + const { address } = await createCollection(creatorSdk, creatorWallet, suite.deployRequest) + const collection = await getCollectionById(creatorSdk, address) const { nft } = await mint(creatorSdk, creatorWallet, { collection }, suite.mintRequest(creatorWalletAddress.unionAddress)) diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-accepbid.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-accepbid.test.ts index 1776d2428..496ea9f0b 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-accepbid.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-accepbid.test.ts @@ -5,6 +5,8 @@ import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request import type { BlockchainWallet } from "@rarible/sdk-wallet" import type { RequestCurrency } from "@rarible/sdk/src/common/domain" import type { OrderRequest } from "@rarible/sdk/src/types/order/common" +import { retry } from "@rarible/sdk/build/common/retry" +import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified" import { getEthereumWallet, getEthereumWalletBuyer, @@ -15,17 +17,18 @@ import { mint } from "../../../common/atoms-tests/mint" import { getCollection } from "../../../common/helpers" import { bid } from "../../../common/atoms-tests/bid" import { acceptBid } from "../../../common/atoms-tests/accept-bid" -import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { awaitForOwnershipValue } from "../../../common/api-helpers/ownership-helper" import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" import { getEndDateAfterMonthAsDate } from "../../../common/utils" +import { sleep } from "../../../common/api-helpers/item-helper" +import { createCollection } from "../../../common/atoms-tests/create-collection" function suites(): { blockchain: Blockchain, description: string, wallets: { seller: BlockchainWallet, buyer: BlockchainWallet }, - collectionId: string, + deployRequest: CreateCollectionRequestSimplified, mintRequest: (creatorAddress: UnionAddress) => MintRequest, currency: string, bidRequest: (currency: RequestCurrency) => Promise @@ -38,7 +41,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -68,7 +79,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -98,7 +117,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -128,7 +155,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -163,10 +198,13 @@ describe.each(suites())("$blockchain mint => bid => acceptBid", (suite) => { const buyerSdk = createSdk(suite.blockchain, buyerWallet) test(suite.description, async () => { + await sleep(1000) + const walletAddressSeller = await getWalletAddressFull(sellerWallet) const walletAddressBuyer = await getWalletAddressFull(buyerWallet) - const collection = await getCollection(sellerSdk, suite.collectionId) + const { address } = await createCollection(sellerSdk, sellerWallet, suite.deployRequest) + const collection = await getCollection(sellerSdk, address) const { nft } = await mint(sellerSdk, sellerWallet, { collection }, suite.mintRequest(walletAddressSeller.unionAddress)) @@ -176,15 +214,23 @@ describe.each(suites())("$blockchain mint => bid => acceptBid", (suite) => { const bidOrder = await bid(buyerSdk, buyerWallet, { itemId: nft.id }, bidRequest) - //await getActivitiesByItem(buyerSdk, nft.id, [ActivityType.BID], [ActivityType.BID]) + await retry(40, 3000, async () => { + await getActivitiesByItem(buyerSdk, nft.id, + [ActivityType.BID], + [ActivityType.BID]) + }) - await acceptBid(sellerSdk, sellerWallet, { orderId: bidOrder.id }, - { amount: bidRequest.amount || 1 }) + await retry(40, 3000, async () => { + await acceptBid(sellerSdk, sellerWallet, { orderId: bidOrder.id }, + { amount: bidRequest.amount || 1 }) + }) await awaitForOwnershipValue(buyerSdk, nft.id, walletAddressBuyer.address, toBigNumber(String(bidRequest.amount))) await getActivitiesByItem(buyerSdk, nft.id, [ActivityType.TRANSFER, ActivityType.MINT, ActivityType.BID], [ActivityType.TRANSFER, ActivityType.MINT, ActivityType.BID]) + + await sleep(5000) }) }) diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-bidupdate-accepbid.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-bidupdate-accepbid.test.ts index fe0f16fe1..336e50867 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-bidupdate-accepbid.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-bidupdate-accepbid.test.ts @@ -7,6 +7,8 @@ import type { RequestCurrency } from "@rarible/sdk/src/common/domain" import type { OrderRequest } from "@rarible/sdk/src/types/order/common" import type { OrderUpdateRequest } from "@rarible/sdk/build/types/order/common" import { delay } from "@rarible/sdk/build/common/retry" +import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified" +import { retry } from "@rarible/sdk/build/common/retry" import { getEthereumWallet, getEthereumWalletBuyer, @@ -17,17 +19,17 @@ import { mint } from "../../../common/atoms-tests/mint" import { getCollection } from "../../../common/helpers" import { bid } from "../../../common/atoms-tests/bid" import { acceptBid } from "../../../common/atoms-tests/accept-bid" -import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { awaitForOwnershipValue } from "../../../common/api-helpers/ownership-helper" import { bidUpdate } from "../../../common/atoms-tests/bid-update" import { getEndDateAfterMonthAsDate } from "../../../common/utils" +import { createCollection } from "../../../common/atoms-tests/create-collection" function suites(): { blockchain: Blockchain, description: string, wallets: { seller: BlockchainWallet, buyer: BlockchainWallet }, - collectionId: string, + deployRequest: CreateCollectionRequestSimplified, mintRequest: (creatorAddress: UnionAddress) => MintRequest, currency: string, bidRequest: (currency: RequestCurrency) => Promise, @@ -41,7 +43,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -74,7 +84,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -107,7 +125,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -140,7 +166,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -181,7 +215,8 @@ describe.each(suites())("$blockchain mint => bid => bidUpdate => acceptBid", (su const walletAddressSeller = await getWalletAddressFull(sellerWallet) const walletAddressBuyer = await getWalletAddressFull(buyerWallet) - const collection = await getCollection(sellerSdk, suite.collectionId) + const { address } = await createCollection(sellerSdk, sellerWallet, suite.deployRequest) + const collection = await getCollection(sellerSdk, address) const { nft } = await mint(sellerSdk, sellerWallet, { collection }, suite.mintRequest(walletAddressSeller.unionAddress)) @@ -194,8 +229,9 @@ describe.each(suites())("$blockchain mint => bid => bidUpdate => acceptBid", (su const order = await bidUpdate(buyerSdk, buyerWallet, { orderId: bidOrder.id }, suite.updateBidRequest) await delay(3000) - - await acceptBid(sellerSdk, sellerWallet, { orderId: order.id }, { amount: bidRequest.amount || 1 }) + await retry(40, 3000, async () => { + await acceptBid(sellerSdk, sellerWallet, { orderId: order.id }, { amount: bidRequest.amount || 1 }) + }) await awaitForOwnershipValue(buyerSdk, nft.id, walletAddressBuyer.address, toBigNumber(String(bidRequest.amount))) //toDo add balance verification diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-cancel.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-cancel.test.ts index 9462fe5be..800573c5c 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-cancel.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-bid-cancel.test.ts @@ -4,6 +4,7 @@ import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request import type { BlockchainWallet } from "@rarible/sdk-wallet" import type { RequestCurrency } from "@rarible/sdk/src/common/domain" import type { OrderRequest } from "@rarible/sdk/src/types/order/common" +import { retry } from "@rarible/sdk/build/common/retry" import { getEthereumWallet, getEthereumWalletBuyer, @@ -13,7 +14,6 @@ import { createSdk } from "../../../common/create-sdk" import { mint } from "../../../common/atoms-tests/mint" import { getCollection } from "../../../common/helpers" import { bid } from "../../../common/atoms-tests/bid" -import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { cancel } from "../../../common/atoms-tests/cancel" import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" @@ -38,7 +38,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + collectionId: "ETHEREUM:0x74FeD9e7c29907313F987dff0BF13edfd884c5a9", mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -69,7 +69,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + collectionId: "ETHEREUM:0x1E5D1745E688a20cBa7d52B6CD1b9Ca7e8297BD6", mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -100,7 +100,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + collectionId: "ETHEREUM:0x75295818ed5CC95F4d430ed314Ad04aF6Da5628b", mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -131,7 +131,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + collectionId: "ETHEREUM:0x7Fe23b1f19B4590869B9EDFfb857aFe3834b6941", mintRequest: (creatorAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -169,7 +169,6 @@ describe.each(suites())("$blockchain mint => bid => cancel", (suite) => { const walletAddressSeller = await getWalletAddressFull(sellerWallet) const collection = await getCollection(sellerSdk, suite.collectionId) - const { nft } = await mint(sellerSdk, sellerWallet, { collection }, suite.mintRequest(walletAddressSeller.unionAddress)) @@ -178,9 +177,11 @@ describe.each(suites())("$blockchain mint => bid => cancel", (suite) => { const bidOrder = await bid(buyerSdk, buyerWallet, { itemId: nft.id }, bidRequest) - await getActivitiesByItem(buyerSdk, nft.id, - [ActivityType.BID], - [ActivityType.BID]) + await retry(40, 3000, async () => { + await getActivitiesByItem(buyerSdk, nft.id, + [ActivityType.BID], + [ActivityType.BID]) + }) await cancel(buyerSdk, buyerWallet, { orderId: bidOrder.id }) diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-buy.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-buy.test.ts index 7ec1755dc..4de624039 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-buy.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-buy.test.ts @@ -5,6 +5,7 @@ import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request import type { BlockchainWallet } from "@rarible/sdk-wallet" import type { RequestCurrency } from "@rarible/sdk/src/common/domain" import type { OrderRequest } from "@rarible/sdk/src/types/order/common" +import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified" import { sell } from "../../../common/atoms-tests/sell" import { getEthereumWallet, @@ -15,17 +16,17 @@ import { createSdk } from "../../../common/create-sdk" import { mint } from "../../../common/atoms-tests/mint" import { awaitOrderStock, getCollection } from "../../../common/helpers" import { buy } from "../../../common/atoms-tests/buy" -import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { awaitForOwnershipValue } from "../../../common/api-helpers/ownership-helper" import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" import { getEndDateAfterMonthAsDate } from "../../../common/utils" +import { createCollection } from "../../../common/atoms-tests/create-collection" function suites(): { blockchain: Blockchain, description: string, wallets: { seller: BlockchainWallet, buyer: BlockchainWallet }, - collectionId: string, + deployRequest: CreateCollectionRequestSimplified, mintRequest: (address: UnionAddress) => MintRequest, currency: string, sellRequest: (currency: RequestCurrency) => Promise @@ -38,7 +39,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -68,7 +77,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -98,7 +115,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -128,7 +153,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -158,7 +191,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -188,7 +229,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -218,7 +267,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -248,7 +305,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -286,7 +351,8 @@ describe.each(suites())("$blockchain mint => sell => buy", (suite) => { const walletAddressSeller = await getWalletAddressFull(sellerWallet) const walletAddressBuyer = await getWalletAddressFull(buyerWallet) - const collection = await getCollection(sellerSdk, suite.collectionId) + const { address } = await createCollection(sellerSdk, sellerWallet, suite.deployRequest) + const collection = await getCollection(sellerSdk, address) const { nft } = await mint( sellerSdk, diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-cancel.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-cancel.test.ts index 68c0f3b32..b787c4635 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-cancel.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-cancel.test.ts @@ -4,6 +4,7 @@ import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request import type { BlockchainWallet } from "@rarible/sdk-wallet" import type { RequestCurrency } from "@rarible/sdk/src/common/domain" import type { OrderRequest } from "@rarible/sdk/src/types/order/common" +import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified" import { sell } from "../../../common/atoms-tests/sell" import { getEthereumWallet, @@ -14,17 +15,17 @@ import { createSdk } from "../../../common/create-sdk" import { mint } from "../../../common/atoms-tests/mint" import { getCollection } from "../../../common/helpers" import { cancel } from "../../../common/atoms-tests/cancel" -import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" import { getEndDateAfterMonthAsDate } from "../../../common/utils" +import { createCollection } from "../../../common/atoms-tests/create-collection" function suites(): { blockchain: Blockchain, description: string, isLazy: boolean, wallets: { seller: BlockchainWallet, buyer: BlockchainWallet }, - collectionId: string, + deployRequest: CreateCollectionRequestSimplified, mintRequest: (address: UnionAddress) => MintRequest, currency: string, sellRequest: (currency: RequestCurrency) => Promise, @@ -38,7 +39,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -69,7 +78,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -100,7 +117,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -131,7 +156,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC721", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -162,7 +195,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -193,7 +234,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -224,7 +273,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -255,7 +312,15 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + deployRequest: { + blockchain: Blockchain.ETHEREUM, + type: "ERC1155", + name: "name", + symbol: "RARI", + baseURI: "https://ipfs.rarible.com", + contractURI: "https://ipfs.rarible.com", + isPublic: true, + } as CreateCollectionRequestSimplified, mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -288,7 +353,8 @@ describe.each(suites())("$blockchain mint => sell => cancel", (suite) => { test(suite.description, async () => { const sellerWalletAddress = await getWalletAddressFull(sellerWallet) - const collection = await getCollection(sellerSdk, suite.collectionId) + const { address } = await createCollection(sellerSdk, sellerWallet, suite.deployRequest) + const collection = await getCollection(sellerSdk, address) const { nft } = await mint(sellerSdk, sellerWallet, { collection }, suite.mintRequest(sellerWalletAddress.unionAddress)) diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-sellupdate-buy.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-sellupdate-buy.test.ts index cf4c1a1cc..6621d0fbb 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-sellupdate-buy.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-sell-sellupdate-buy.test.ts @@ -1,4 +1,4 @@ -import { Blockchain } from "@rarible/api-client" +import { ActivityType, Blockchain } from "@rarible/api-client" import type { UnionAddress } from "@rarible/types" import { toBigNumber } from "@rarible/types" import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request.type" @@ -6,6 +6,7 @@ import type { BlockchainWallet } from "@rarible/sdk-wallet" import type { RequestCurrency } from "@rarible/sdk/src/common/domain" import type { OrderRequest } from "@rarible/sdk/src/types/order/common" import type { OrderUpdateRequest } from "@rarible/sdk/build/types/order/common" +import { retry } from "@rarible/sdk/build/common/retry" import { sell } from "../../../common/atoms-tests/sell" import { getEthereumWallet, @@ -16,11 +17,12 @@ import { createSdk } from "../../../common/create-sdk" import { mint } from "../../../common/atoms-tests/mint" import { awaitOrderStock, getCollection } from "../../../common/helpers" import { buy } from "../../../common/atoms-tests/buy" -import { testsConfig } from "../../../common/config" import { getCurrency } from "../../../common/currency" import { awaitForOwnershipValue } from "../../../common/api-helpers/ownership-helper" import { sellUpdate } from "../../../common/atoms-tests/sell-update" import { getEndDateAfterMonthAsDate } from "../../../common/utils" +import { getActivitiesByItem } from "../../../common/api-helpers/activity-helper" +import { sleep } from "../../../common/api-helpers/item-helper" function suites(): { blockchain: Blockchain, @@ -40,7 +42,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + collectionId: "ETHEREUM:0xDbE18aB40B2059A83df4784183ae56F5C4065e3c", mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -73,7 +75,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + collectionId: "ETHEREUM:0xBB350b42fa45224832179b87761F090769B896ED", mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -106,7 +108,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + collectionId: "ETHEREUM:0x22c1744d24Dfa71936f8693b17A2B820766BB6Bf", mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -139,7 +141,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_721, + collectionId: "ETHEREUM:0x54E289a08617B45e92eB9DB0f293fFbcA75BCC9f", mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -172,7 +174,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + collectionId: "ETHEREUM:0x0CF473d46fa5e5c82A5bC4CF89Ed08aB02812CD4", mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -205,7 +207,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + collectionId: "ETHEREUM:0x18B85CfeD48107cbE8cFe2e50A035fFD56aC7835", mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -238,7 +240,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + collectionId: "ETHEREUM:0x1E6187c21aC2630b4F5CB471c6EfbaA17da8Cc5d", mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -271,7 +273,7 @@ function suites(): { seller: getEthereumWallet(), buyer: getEthereumWalletBuyer(), }, - collectionId: testsConfig.variables.ETHEREUM_COLLECTION_ERC_1155, + collectionId: "ETHEREUM:0x1d61C26275578da5521d6E899fD3a3431E0f1027", mintRequest: (walletAddress: UnionAddress): MintRequest => { return { uri: "ipfs://ipfs/QmfVqzkQcKR1vCNqcZkeVVy94684hyLki7QcVzd9rmjuG5", @@ -310,10 +312,11 @@ describe.each(suites())("$blockchain mint => sell => sellUpdate => buy", (suite) const buyerSdk = createSdk(suite.blockchain, buyerWallet) test(suite.description, async () => { + await sleep(5000) const walletAddressSeller = await getWalletAddressFull(sellerWallet) const walletAddressBuyer = await getWalletAddressFull(buyerWallet) - const collection = await getCollection(sellerSdk, suite.collectionId) + const collection = await getCollection(sellerSdk, suite.collectionId) const { nft } = await mint(sellerSdk, sellerWallet, { collection }, suite.mintRequest(walletAddressSeller.unionAddress)) @@ -322,12 +325,18 @@ describe.each(suites())("$blockchain mint => sell => sellUpdate => buy", (suite) const orderRequest = await suite.sellRequest(requestCurrency) const sellOrder = await sell(sellerSdk, sellerWallet, { itemId: nft.id }, orderRequest) - + await retry(40, 3000, async () => { + await getActivitiesByItem(sellerSdk, nft.id, + [ActivityType.LIST], + [ActivityType.LIST]) + }) const order = await sellUpdate(sellerSdk, sellerWallet, { orderId: sellOrder.id }, suite.updateSellRequest) await buy(buyerSdk, buyerWallet, nft.id, { orderId: order.id }, { amount: orderRequest.amount || 1 }) await awaitOrderStock(sellerSdk, order.id, toBigNumber("0")) await awaitForOwnershipValue(buyerSdk, nft.id, walletAddressBuyer.address, toBigNumber(String(orderRequest.amount))) + + await sleep(5000) }) }) diff --git a/packages/example/package.json b/packages/example/package.json index 80389fc71..916571c38 100644 --- a/packages/example/package.json +++ b/packages/example/package.json @@ -2,6 +2,28 @@ "name": "example", "version": "0.13.50-beta.1", "private": true, + "scripts": { + "build": "SKIP_PREFLIGHT_CHECK=true react-scripts build", + "eject": "SKIP_PREFLIGHT_CHECK=true react-scripts eject", + "start": "SKIP_PREFLIGHT_CHECK=true react-app-rewired start", + "verify": "tsc --noEmit" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "resolutions": { + "//": "See https://github.com/facebook/create-react-app/issues/11773", + "react-error-overlay": "6.0.9" + }, "dependencies": { "@babel/core": "^7.0.0", "@babel/runtime": "^7.0.0", @@ -61,30 +83,8 @@ "rxjs": "^6.6.7", "typescript": "^4.8.4" }, - "resolutions": { - "//": "See https://github.com/facebook/create-react-app/issues/11773", - "react-error-overlay": "6.0.9" - }, - "scripts": { - "start": "SKIP_PREFLIGHT_CHECK=true react-app-rewired start", - "build": "SKIP_PREFLIGHT_CHECK=true react-scripts build", - "eject": "SKIP_PREFLIGHT_CHECK=true react-scripts eject", - "verify": "tsc --noEmit" - }, "devDependencies": { "customize-cra": "1.0.0", "react-app-rewired": "^2.2.1" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] } } diff --git a/packages/sdk-examples/package.json b/packages/sdk-examples/package.json index 9339fcdc4..c45011d18 100644 --- a/packages/sdk-examples/package.json +++ b/packages/sdk-examples/package.json @@ -3,9 +3,6 @@ "version": "0.13.50-beta.1", "homepage": "", "license": "ISC", - "publishConfig": { - "access": "public" - }, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -44,5 +41,8 @@ }, "peerDependencies": { "tslib": "^2.3.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/solana-common/package.json b/packages/solana-common/package.json index 732b2f1bc..b3cb404eb 100644 --- a/packages/solana-common/package.json +++ b/packages/solana-common/package.json @@ -1,17 +1,17 @@ { "name": "@rarible/solana-common", - "description": "Common code", "version": "0.13.37", + "description": "Common code", "license": "Apache-2.0", + "main": "build/index.js", + "types": "build/index.d.ts", "files": [ "build" ], - "main": "build/index.js", - "types": "build/index.d.ts", "scripts": { - "clean": "rimraf ./build", "build": "run-s build:*", "build:esm": "tsc --project tsconfig-build.json", + "clean": "rimraf ./build", "verify": "tsc --noEmit" }, "dependencies": { diff --git a/packages/solana-sdk/package.json b/packages/solana-sdk/package.json index 61e2dde5f..4e0a4d33f 100644 --- a/packages/solana-sdk/package.json +++ b/packages/solana-sdk/package.json @@ -12,9 +12,9 @@ "build" ], "scripts": { - "clean": "rimraf ./build", "build": "run-s build:*", "build:esm": "tsc --project tsconfig-build.json", + "clean": "rimraf ./build", "verify": "tsc --noEmit" }, "dependencies": { diff --git a/packages/solana-wallet/package.json b/packages/solana-wallet/package.json index e219f3b0e..b900ebd71 100644 --- a/packages/solana-wallet/package.json +++ b/packages/solana-wallet/package.json @@ -12,9 +12,9 @@ "build" ], "scripts": { - "clean": "rimraf ./build", "build": "run-s build:*", "build:esm": "tsc --project tsconfig-build.json", + "clean": "rimraf ./build", "verify": "tsc --noEmit" }, "dependencies": { diff --git a/packages/transaction-backend/package.json b/packages/transaction-backend/package.json index f1bbe7c91..3915bdd82 100644 --- a/packages/transaction-backend/package.json +++ b/packages/transaction-backend/package.json @@ -1,6 +1,7 @@ { "name": "@rarible/sdk-transaction-backend", "version": "0.13.50-beta.1", + "private": true, "homepage": "", "license": "ISC", "main": "build/index.js", @@ -8,15 +9,14 @@ "files": [ "build" ], - "private": true, "scripts": { - "start": "node ./build/index.js", "build": "yarn clean && yarn tsc --project ./tsconfig.json && yarn copy-files", "clean": "rimraf ./build", "copy-files": "cp ./src/openapi.yml ./build/", + "serve": "nodemon", + "start": "node ./build/index.js", "test": "jest --runInBand", - "verify": "tsc --noEmit", - "serve": "nodemon" + "verify": "tsc --noEmit" }, "dependencies": { "@rarible/protocol-ethereum-sdk": "^0.13.50-beta.1", From d41d1734adf8e115c84fc9f5a07ead3968dcab3e Mon Sep 17 00:00:00 2001 From: Vadim Fadeev Date: Fri, 13 Oct 2023 15:53:34 +0100 Subject: [PATCH 4/5] feat: add retry --- .../e2e-tests/tests/ethereum/smoke/api/order.test.ts | 2 +- .../smoke/order/mint-floorbid-accepbid.test.ts | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts b/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts index f0a6cdfa1..1f3060056 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts @@ -154,8 +154,8 @@ describe.each(suites())("$blockchain api => order", (suite) => { const orderBidsByItem = await getOrderBidsByItem(sellerSdk, nft.contract!, nft.tokenId!, 2) expect(orderBidsByItem.orders.length).toBeGreaterThanOrEqual(1) }) + await sleep(1000) - console.log("await getOrderBidsByItemRaw(sellerSdk, nft.contract!, nft.tokenId!") await retry(40, 3000, async () => { const orderBidsByItemRaw = await getOrderBidsByItemRaw(sellerSdk, nft.contract!, nft.tokenId!, 2) as GetOrderBidsByItem200 diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-accepbid.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-accepbid.test.ts index dd58f6119..81419fb04 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-accepbid.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-accepbid.test.ts @@ -219,11 +219,13 @@ describe.each(suites())("$blockchain mint => floorBid => acceptBid", (suite) => expect(collection1.bestBidOrder?.takePrice).toBe(bidRequest.price) }) - await acceptBid(sellerSdk, sellerWallet, { orderId: bidOrder.id }, - { - amount: bidRequest.amount || 1, - itemId: nft.id, - }) + await retry(40, 3000, async () => { + await acceptBid(sellerSdk, sellerWallet, { orderId: bidOrder.id }, + { + amount: bidRequest.amount || 1, + itemId: nft.id, + }) + }) await awaitForOwnershipValue(buyerSdk, nft.id, walletAddressBuyer.address, toBigNumber(String(bidRequest.amount))) From fbc2e9ba9b895bb45f4d7fe7b5a66a15e311605e Mon Sep 17 00:00:00 2001 From: Vadim Fadeev Date: Fri, 13 Oct 2023 16:32:13 +0100 Subject: [PATCH 5/5] feat: add retry and remove logs --- .../order/mint-floorbid-bidupdate-accepbid.test.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-bidupdate-accepbid.test.ts b/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-bidupdate-accepbid.test.ts index 600741ce8..747051bba 100644 --- a/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-bidupdate-accepbid.test.ts +++ b/packages/e2e-tests/tests/ethereum/smoke/order/mint-floorbid-bidupdate-accepbid.test.ts @@ -236,12 +236,13 @@ describe.each(suites())("$blockchain mint => floorBid => bidUpdate => acceptBid" const collection2 = await getCollection(sellerSdk, address) expect(collection2.bestBidOrder?.takePrice).toBe(suite.updateBidRequest.price) }) - - await acceptBid(sellerSdk, sellerWallet, { orderId: bidOrder.id }, - { - amount: bidRequest.amount || 1, - itemId: nft.id, - }) + await retry(40, 3000, async () => { + await acceptBid(sellerSdk, sellerWallet, { orderId: bidOrder.id }, + { + amount: bidRequest.amount || 1, + itemId: nft.id, + }) + }) await awaitForOwnershipValue(buyerSdk, nft.id, walletAddressBuyer.address, toBigNumber(String(bidRequest.amount)))