From db7ece510555cb51a65044d6bcbea12adac3c251 Mon Sep 17 00:00:00 2001 From: huianyang Date: Fri, 18 Nov 2022 18:29:07 -0800 Subject: [PATCH] fix: address comments removed duplicate tests and move kathcases to commoncases re #2065 --- .../contract-edo-deploy-having-ticket.spec.ts | 24 +------------- integration-tests/data/allTestsCases.ts | 31 ++----------------- .../test/taquito-local-forging.spec.ts | 22 ++++++------- 3 files changed, 14 insertions(+), 63 deletions(-) diff --git a/integration-tests/contract-edo-deploy-having-ticket.spec.ts b/integration-tests/contract-edo-deploy-having-ticket.spec.ts index 313d74310f..14cf18d382 100644 --- a/integration-tests/contract-edo-deploy-having-ticket.spec.ts +++ b/integration-tests/contract-edo-deploy-having-ticket.spec.ts @@ -14,17 +14,6 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { await setup(); done() }) - kathmandunet('Originates a contract having ticket with init and the wallet api', async (done) => { - const op = await Tezos.wallet.originate({ - code: ticketCodeProto14, - init: ticketStorageProto14 - }).send(); - - await op.confirmation(); - expect(op.opHash).toBeDefined(); - - done(); - }); kathmandunet('Originates a contract having ticket with init and the contract api', async (done) => { const op = await Tezos.contract.originate({ @@ -75,18 +64,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { await setup(); done() }) - limanetAndAlpha('Originates a contract having ticket with init and the wallet api', async (done) => { - const op = await Tezos.wallet.originate({ - code: ticketCode, - init: ticketStorage - }).send(); - - await op.confirmation(); - expect(op.opHash).toBeDefined(); - - done(); - }); - + limanetAndAlpha('Originates a contract having ticket with init and the contract api', async (done) => { const op = await Tezos.contract.originate({ code: ticketCode, diff --git a/integration-tests/data/allTestsCases.ts b/integration-tests/data/allTestsCases.ts index c7e651486b..a5ba048a1e 100644 --- a/integration-tests/data/allTestsCases.ts +++ b/integration-tests/data/allTestsCases.ts @@ -806,7 +806,7 @@ export const commonCases: TestCase[] = [ ], }, }, - ...extractOp(0, 150, opMappingProto14).map((op): TestCase => { + ...extractOp(0, 151, opMappingProto14).map((op): TestCase => { return { name: `Origination operation (${op})`, operation: { @@ -1344,32 +1344,6 @@ export const commonCases: TestCase[] = [ ], }, }, -]; - -export const kathmanduCases: TestCase[] = [ - ...extractOp(150, 151, opMappingProto14).map((op): TestCase => { - return { - name: `Origination operation (${op})`, - operation: { - branch: 'BLzyjjHKEKMULtvkpSHxuZxx6ei6fpntH2BTkYZiLgs8zLVstvX', - contents: [ - { - kind: OpKind.ORIGINATION, - counter: '1', - source: 'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn', - fee: '10000', - gas_limit: '10', - storage_limit: '10', - balance: '0', - script: { - code: genericCode(op) as MichelsonV1Expression[], - storage: genericStorage, - }, - }, - ], - }, - }; - }), { name: `Origination of a contract that contains the instructions EMIT`, operation: { @@ -1413,10 +1387,9 @@ export const kathmanduCases: TestCase[] = [ }, ]; - export const limaCases: TestCase[] = [ // In `opMapping` from the file `constants.ts`, the operations and types starting at `ticket` were added in the lima protocol - ...extractOp(154, 154, opMapping).map((op): TestCase => { + ...extractOp(152, 154, opMapping).map((op): TestCase => { return { name: `Origination operation (${op})`, operation: { diff --git a/packages/taquito-local-forging/test/taquito-local-forging.spec.ts b/packages/taquito-local-forging/test/taquito-local-forging.spec.ts index 81d59ce650..e6249bf87e 100644 --- a/packages/taquito-local-forging/test/taquito-local-forging.spec.ts +++ b/packages/taquito-local-forging/test/taquito-local-forging.spec.ts @@ -10,7 +10,7 @@ import { ticketCode3Proto14, ticketStorage3Proto14, } from '../../../integration-tests/data/code_with_ticket_proto14'; -import { commonCases, kathmanduCases } from '../../../integration-tests/data/allTestsCases'; +import { commonCases } from '../../../integration-tests/data/allTestsCases'; import { InvalidOperationSchemaError, InvalidBlockHashError, @@ -31,16 +31,16 @@ describe('Forge and parse operations default protocol', () => { }); }); - describe('Forge and parse operations kathmandu protocol', () => { - const localForger = new LocalForger(); - kathmanduCases.forEach(({ name, operation, expected }) => { - test(`Common test: ${name}`, async (done) => { - const result = await localForger.forge(operation); - expect(await localForger.parse(result)).toEqual(expected || operation); - done(); - }); - }); - }); + // describe('Forge and parse operations kathmandu protocol', () => { + // const localForger = new LocalForger(); + // kathmanduCases.forEach(({ name, operation, expected }) => { + // test(`Common test: ${name}`, async (done) => { + // const result = await localForger.forge(operation); + // expect(await localForger.parse(result)).toEqual(expected || operation); + // done(); + // }); + // }); + // }); describe('Forge should validate parameters against the schema', () => { const hexToParse = `0572cbea904d67468808c8eb50a9450c9721db309128012543902d0ac358a62ae28f75bb8f1c7c42c39a8c5529bf0f4e166a9d8cabc673a322fda673779d8e3822ba3ecb8670e461f73bb9021d5fd76a4c56d9d4cd16bd1bba86881979749d28`;