Skip to content

Commit

Permalink
test: updated mondaynet known contract and fixed test suite and asser…
Browse files Browse the repository at this point in the history
…tion against latest monday net (#2303)
  • Loading branch information
hui-an-yang authored Jan 17, 2023
1 parent e9c956f commit cb0fd1b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Protocols } from '@taquito/taquito';
import { CONFIGS } from "./config";

CONFIGS().forEach(({ lib, rpc, setup }) => {
CONFIGS().forEach(({ lib, rpc, setup, protocol }) => {
const Tezos = lib;
const limanet = (protocol === Protocols.PtLimaPtL) ? test : test.skip;
const alpha = (protocol === Protocols.ProtoALpha) ? test : test.skip;

describe(`Test injecting more than one manager operation in a block: ${rpc}`, () => {

Expand All @@ -10,7 +13,7 @@ CONFIGS().forEach(({ lib, rpc, setup }) => {
done()
})

it('Verify that doing transfers without awaiting the confirmation after each will fail', async (done) => {
limanet('Verify that doing transfers without awaiting the confirmation after each will fail', async (done) => {
try {
const op1Promise = Tezos.contract.transfer({ to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu', amount: 1 });
const op2Promise = Tezos.contract.transfer({ to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu', amount: 2 });
Expand All @@ -25,5 +28,21 @@ CONFIGS().forEach(({ lib, rpc, setup }) => {
}
done();
})

alpha('Verify that doing transfers without awaiting the confirmation after each will fail', async (done) => {
try {
const op1Promise = Tezos.contract.transfer({ to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu', amount: 1 });
const op2Promise = Tezos.contract.transfer({ to: 'tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu', amount: 2 });

const [op1, op2] = await Promise.all([op1Promise, op2Promise])

await op1.confirmation();
await op2.confirmation();

} catch (error: any) {
expect(error.message).toContain('mempool already contains a conflicting operation');
}
done();
})
});
})
10 changes: 5 additions & 5 deletions integration-tests/known-contracts-ProtoALph.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const knownContractProtoALph = "KT1E4pv41UsA8wAgsE97eH2pUef3PwoxGtKv";
export const knownBigMapContractProtoALph = "KT1QG6K5T6gnQiTXEMboJUwWf8w2GuvoZk5s";
export const knownTzip12BigMapOffChainContractProtoALph = "KT1H742YsRxYbX16deKMwJtWDjSuR2PNGfUM";
export const knownSaplingContractProtoALph = "KT1TvF1kZPaam4qDR8WZeUdbTqYKemBLu9HA";
export const knownOnChainViewContractAddressProtoALph = "KT1KPWAassVahrpKb9RBdewsaLAufRt5X8ZE";
export const knownContractProtoALph = "KT1M3V5uDENHahkwgboVgXdYW5RJ2DS4W1Wg";
export const knownBigMapContractProtoALph = "KT1UR4NPP7QWGoD8McpVLW8xbK64BJXRnsih";
export const knownTzip12BigMapOffChainContractProtoALph = "KT1KQCNdi8xWSscrGmRCgbFdQWwaun7bnivs";
export const knownSaplingContractProtoALph = "KT1A2m13khuHMneRU4Ep3UjAxy2Pt6x9CC3u";
export const knownOnChainViewContractAddressProtoALph = "KT19BzzXMnBCpB5NriqDSLvSyq3EosDTTeKo";
export const txRollupAddressProtoALph = "";
8 changes: 5 additions & 3 deletions integration-tests/prepare-operation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Protocols } from '@taquito/taquito';
import { OperationContentsBallot, OperationContentsTransaction } from '@taquito/rpc';
import {
OpKind,
} from '@taquito/taquito';
import { CONFIGS } from './config';

CONFIGS().forEach(({ lib, setup }) => {
CONFIGS().forEach(({ lib, setup, protocol }) => {
const Tezos = lib;
let contractAddress: string;
const limanet = (protocol === Protocols.PtLimaPtL) ? test : test.skip;

describe(`Test Preparation of operations using the PrepareProvider`, () => {
beforeAll(async (done) => {
Expand Down Expand Up @@ -84,7 +86,7 @@ CONFIGS().forEach(({ lib, setup }) => {
done();
});

it('should be able to prepare a txRollupOriginate operation', async (done) => {
limanet('should be able to prepare a txRollupOriginate operation', async (done) => {
const prepared = await Tezos.prepare.txRollupOrigination({});

expect(prepared).toBeDefined();
Expand Down Expand Up @@ -114,7 +116,7 @@ CONFIGS().forEach(({ lib, setup }) => {
expect(prepared.opOb.contents[0].kind).toEqual('ballot');
expect(content.proposal).toEqual('PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg');
expect(content.ballot).toEqual('yay');
expect(prepared.opOb.protocol).toEqual('PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW');
expect(prepared.opOb.protocol).toEqual(protocol);
done();
});

Expand Down

0 comments on commit cb0fd1b

Please sign in to comment.