diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc88a4d091..cf82f7fc90 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -112,7 +112,7 @@ jobs: --protocol-kind ${{ matrix.protocol }} - run: npm ci - run: npm run build - - run: npm -w integration-tests run test:originate-known-contracts && npm -w integration-tests run test:${{ matrix.testnet }}-secret-key -- --testPathIgnorePatterns ledger-signer-failing-tests.spec.ts ledger-signer.spec.ts contract-estimation-tests.spec.ts rpc-get-protocol-constants.spec.ts sandbox-ballot-operation.spec.ts + - run: npm -w integration-tests run test:originate-known-contracts && npm -w integration-tests run test:${{ matrix.testnet }}-secret-key -- --testPathIgnorePatterns ledger-signer-failing-tests.spec.ts ledger-signer.spec.ts contract-estimation-tests.spec.ts rpc-get-protocol-constants.spec.ts sandbox-ballot-operation.spec.ts contract-batch-high-number-of-operations.spec.ts --detectOpenHandles --runInBand env: RUN_${{ matrix.testnet_uppercase }}_WITH_SECRET_KEY: true SECRET_KEY: edsk3S8mG2sSBmSRbikAcZVLCz4SrCq4DjmsQRic6MGktqNFijfrS2 diff --git a/integration-tests/contract-batch-high-number-of-operations.spec.ts b/integration-tests/contract-batch-high-number-of-operations.spec.ts index 37ddfe17c0..ceb235caa6 100644 --- a/integration-tests/contract-batch-high-number-of-operations.spec.ts +++ b/integration-tests/contract-batch-high-number-of-operations.spec.ts @@ -3,6 +3,7 @@ import { b58cencode, Prefix, prefix } from '@taquito/utils'; import { InMemorySigner } from '@taquito/signer'; const crypto = require('crypto'); +// This test is skipped on Flextesa due to the high number of operations taking too long to resolve in the sandbox CONFIGS().forEach(({ lib, rpc, setup }) => { const Tezos = lib; diff --git a/integration-tests/contract-increase-paid-storage-operation.spec.ts b/integration-tests/contract-increase-paid-storage-operation.spec.ts index 3553d17b0d..8a83cd2f34 100644 --- a/integration-tests/contract-increase-paid-storage-operation.spec.ts +++ b/integration-tests/contract-increase-paid-storage-operation.spec.ts @@ -27,7 +27,7 @@ CONFIGS().forEach(({ lib, rpc, setup }) => { simpleContractAddress = op.contractAddress!; } catch (e) { - console.log(JSON.stringify(e)); + console.log(`Error when trying to originate the contract for the test: \n`, JSON.stringify(e)); } }); @@ -48,35 +48,6 @@ CONFIGS().forEach(({ lib, rpc, setup }) => { expect(parseInt(paidSpaceAfter)).toEqual(parseInt(paidSpaceBefore) + 1); }); - it(`should be able to include increasePaidStorage operation in a batch: ${rpc}`, async () => { - const paidSpaceBefore = await Tezos.rpc.getStoragePaidSpace(simpleContractAddress); - - const op = await Tezos.contract - .batch() - .withOrigination({ - balance: "1", - code: `parameter string; - storage string; - code {CAR; - PUSH string "Hello "; - CONCAT; - NIL operation; PAIR}; - `, - init: `"test"` - }) - .withIncreasePaidStorage({ - amount: 1, - destination: simpleContractAddress - }) - .send(); - await op.confirmation(); - expect(op.status).toEqual('applied'); - - const paidSpaceAfter = await Tezos.rpc.getStoragePaidSpace(simpleContractAddress); - - expect(parseInt(paidSpaceAfter)).toEqual(parseInt(paidSpaceBefore) + 1); - }); - it(`should be able to include increasePaidStorage operation in a batch (different batch syntax): ${rpc}`, async () => { const paidSpaceBefore = await Tezos.rpc.getStoragePaidSpace(simpleContractAddress); @@ -93,7 +64,7 @@ CONFIGS().forEach(({ lib, rpc, setup }) => { destination: simpleContractAddress } ]) - .send(); + .send(); await op.confirmation(); expect(op.status).toEqual('applied'); diff --git a/integration-tests/contract-manager-that-calls-failwith-contract.spec.ts b/integration-tests/contract-manager-that-calls-failwith-contract.spec.ts index d7a20cec06..3aefbaf6dd 100644 --- a/integration-tests/contract-manager-that-calls-failwith-contract.spec.ts +++ b/integration-tests/contract-manager-that-calls-failwith-contract.spec.ts @@ -1,37 +1,44 @@ import { CONFIGS } from "./config"; import { failwithContractCode } from "./data/failwith"; import { managerCode } from "./data/manager_code"; -import { MANAGER_LAMBDA } from "@taquito/taquito"; +import { DefaultContractType, MANAGER_LAMBDA, OriginationOperation } from "@taquito/taquito"; CONFIGS().forEach(({ lib, rpc, setup }) => { const Tezos = lib; - describe(`Test contract origination of a contract that calls 2nd contract that FAILs through contract api: ${rpc}`, () => { + let contract: DefaultContractType; + let opManager: OriginationOperation; + describe(`Test contract origination of a contract that calls 2nd contract that FAILs through contract api: ${rpc}`, () => { beforeEach(async () => { - await setup() - }) - test('Verify that transferring token from the manager contract to a contract having a FAILWITH instruction will fail', async () => { - const op = await Tezos.contract.originate({ - balance: "1", - code: failwithContractCode, - storage: null - }) - const contract = await op.contract() - expect(op.hash).toBeDefined(); - expect(op.includedInBlock).toBeLessThan(Number.POSITIVE_INFINITY) - expect(op.status === 'applied'); + await setup(); + + try { + const op = await Tezos.contract.originate({ + balance: "1", + code: failwithContractCode, + storage: null + }); + + contract = await op.contract(); - const opManager = await Tezos.contract.originate({ - balance: "1", - code: managerCode, - init: { "string": await Tezos.signer.publicKeyHash() }, - }) + opManager = await Tezos.contract.originate({ + balance: "1", + code: managerCode, + init: { "string": await Tezos.signer.publicKeyHash() }, + }); + } catch(e) { + console.log(`Error when preparing the test: ${e}`); + } + }); + + it('Verify that transferring token from the manager contract to a contract having a FAILWITH instruction will fail', async () => { const managerContract = await opManager.contract() expect(opManager.hash).toBeDefined(); expect(opManager.includedInBlock).toBeLessThan(Number.POSITIVE_INFINITY) - expect(opManager.status === 'applied'); + expect(opManager.status).toEqual('applied'); + try { await managerContract.methods.do(MANAGER_LAMBDA.transferToContract(contract.address, 1)).send({ amount: 0 }) fail('Expected transfer operation to throw error') diff --git a/package-lock.json b/package-lock.json index faffc9eb7b..7b8e1ff64a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5765,9 +5765,9 @@ } }, "node_modules/@types/babel__core": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.2.tgz", - "integrity": "sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==", + "version": "7.20.4", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.4.tgz", + "integrity": "sha512-mLnSC22IC4vcWiuObSRjrLd9XcBTGf59vUSoq2jkQDJ/QQ8PMI9rSuzE+aEV8karUMbskw07bKYoUJCKTUaygg==", "dev": true, "dependencies": { "@babel/parser": "^7.20.7", @@ -5778,18 +5778,18 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.5", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.5.tgz", - "integrity": "sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w==", + "version": "7.6.7", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.7.tgz", + "integrity": "sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.2.tgz", - "integrity": "sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -5797,9 +5797,9 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.2.tgz", - "integrity": "sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw==", + "version": "7.20.4", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.4.tgz", + "integrity": "sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA==", "dev": true, "dependencies": { "@babel/types": "^7.20.7"