From 400cffc5245698bba817385a141b4bc934f4c9b7 Mon Sep 17 00:00:00 2001 From: Davis Sawali Date: Mon, 23 Jan 2023 11:52:38 -0800 Subject: [PATCH] update Taquito test configs to support Mumbai runs (#2312) * update Taquito test configs to support Mumbai runs * updated some integration tests to point to mumbainet * pdate constant values for mumbainet * removed accidental change to mondaynet test --- .github/workflows/main.yml | 2 + integration-tests/config.ts | 45 ++++++- .../contract-deploy-having-ticket.spec.ts | 10 +- ...ct-increase-paid-storage-operation.spec.ts | 11 +- ...inate-and-call-contract-lambda-rec.spec.ts | 66 +++++----- ...act-update-consensus-key-operation.spec.ts | 6 +- ...iple-manager-operations-in-a-block.spec.ts | 66 +++++----- .../known-contracts-PtLimaPtL.ts | 12 +- .../known-contracts-PtMumbaii.ts | 6 + integration-tests/local-forging.spec.ts | 5 +- integration-tests/package.json | 2 + .../rpc-get-protocol-constants.spec.ts | 116 +++++++++++++++++- integration-tests/rpc-nodes.spec.ts | 6 +- .../wallet-deploy-having-ticket.spec.ts | 11 +- ...et-increase-paid-storage-operation.spec.ts | 10 +- packages/taquito/src/constants.ts | 5 +- 16 files changed, 267 insertions(+), 112 deletions(-) create mode 100644 integration-tests/known-contracts-PtMumbaii.ts diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cbb46c65d5..ee5f33d0f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,6 +45,8 @@ jobs: include: - testnet: limanet testnet_uppercase: LIMANET + - testnet: mumbainet + testnet_uppercase: MUMBAINET steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 diff --git a/integration-tests/config.ts b/integration-tests/config.ts index ff013180c5..2f0fbf12f5 100644 --- a/integration-tests/config.ts +++ b/integration-tests/config.ts @@ -7,6 +7,7 @@ import { RpcClient, RpcClientCache } from '@taquito/rpc'; import { knownBigMapContractProtoALph, knownContractProtoALph, knownOnChainViewContractAddressProtoALph, knownSaplingContractProtoALph, knownTzip12BigMapOffChainContractProtoALph, txRollupAddressProtoALph } from './known-contracts-ProtoALph'; import { knownContractPtLimaPtL, knownBigMapContractPtLimaPtL, knownTzip12BigMapOffChainContractPtLimaPtL, knownSaplingContractPtLimaPtL, knownOnChainViewContractAddressPtLimaPtL, txRollupAddressPtLimaPtL } from './known-contracts-PtLimaPtL'; import { knownContractPtGhostnet, knownBigMapContractPtGhostnet, knownTzip12BigMapOffChainContractPtGhostnet, knownSaplingContractPtGhostnet, knownOnChainViewContractAddressPtGhostnet, txRollupAddressPtGhostnet } from './known-contracts-PtGhostnet'; +import { knownContractPtMumbaii, knownBigMapContractPtMumbaii, knownTzip12BigMapOffChainContractPtMumbaii, knownSaplingContractPtMumbaii, knownOnChainViewContractAddressPtMumbaii, txRollupAddressPtMumbaii } from './known-contracts-PtMumbaii'; const nodeCrypto = require('crypto'); @@ -96,6 +97,27 @@ const limanetEphemeral = { }, }; +const mumbainetEphemeral = { + rpc: process.env['TEZOS_RPC_LIMANET'] || 'http://ecad-mumbainet-full.i.tez.ie:8732', + pollingIntervalMilliseconds: process.env['POLLING_INTERVAL_MILLISECONDS'] || undefined, + rpcCacheMilliseconds: process.env['RPC_CACHE_MILLISECONDS'] || '1000', + knownBaker: process.env['TEZOS_BAKER'] || 'tz1cjyja1TU6fiyiFav3mFAdnDsCReJ12hPD', + knownContract: process.env['TEZOS_MUMBAINET_CONTRACT_ADDRESS'] || knownContractPtMumbaii, + knownBigMapContract: process.env['TEZOS_MUMBAINET_BIGMAPCONTRACT_ADDRESS'] || knownBigMapContractPtMumbaii, + knownTzip1216Contract: process.env['TEZOS_MUMBAINET_TZIP1216CONTRACT_ADDRESS'] || knownTzip12BigMapOffChainContractPtMumbaii, + knownSaplingContract: process.env['TEZOS_MUMBAINET_SAPLINGCONTRACT_ADDRESS'] || knownSaplingContractPtMumbaii, + txRollupWithdrawContract: process.env['TEZOS_MUMBAINET_TX_ROLLUP_WITHDRAW_CONTRACT'] || '', + txRollupDepositContract: process.env['TEZOS_MUMBAINET_TX_ROLLUP_DEPOSIT_CONTRACT'] || '', + knownViewContract: process.env['TEZOS_MUMBAINET_ON_CHAIN_VIEW_CONTRACT'] || knownOnChainViewContractAddressPtMumbaii, + txRollupAddress: process.env['TEZOS_MUMBAINET_TXROLLUP_ADDRESS'] || txRollupAddressPtMumbaii, + protocol: Protocols.PtMumbaii, + signerConfig: { + type: SignerType.EPHEMERAL_KEY as SignerType.EPHEMERAL_KEY, + keyUrl: 'https://api.tez.ie/keys/mumbainet', + requestHeaders: { Authorization: 'Bearer taquito-example' }, + }, +}; + const ghostnetEphemeral = { rpc: process.env['TEZOS_RPC_GHOSTNET'] || 'ecad-ghostnet-rolling:8732', pollingIntervalMilliseconds: process.env['POLLING_INTERVAL_MILLISECONDS'] || undefined, @@ -155,6 +177,23 @@ const limanetSecretKey = { signerConfig: defaultSecretKey }; +const mumbainetSecretKey = { + rpc: process.env['TEZOS_RPC_LIMANET'] || 'http://ecad-limanet-full:8732', + pollingIntervalMilliseconds: process.env['POLLING_INTERVAL_MILLISECONDS'] || undefined, + rpcCacheMilliseconds: process.env['RPC_CACHE_MILLISECONDS'] || '1000', + knownBaker: process.env['TEZOS_BAKER'] || 'tz1cjyja1TU6fiyiFav3mFAdnDsCReJ12hPD', + knownContract: process.env['TEZOS_MUMBAINET_CONTRACT_ADDRESS'] || knownContractPtMumbaii, + knownBigMapContract: process.env['TEZOS_MUMBAINET_BIGMAPCONTRACT_ADDRESS'] || knownBigMapContractPtMumbaii, + knownTzip1216Contract: process.env['TEZOS_MUMBAINET_TZIP1216CONTRACT_ADDRESS'] || knownTzip12BigMapOffChainContractPtMumbaii, + knownSaplingContract: process.env['TEZOS_MUMBAINET_SAPLINGCONTRACT_ADDRESS'] || knownSaplingContractPtMumbaii, + txRollupWithdrawContract: process.env['TEZOS_MUMBAINET_TX_ROLLUP_WITHDRAW_CONTRACT'] || '', + txRollupDepositContract: process.env['TEZOS_MUMBAINET_TX_ROLLUP_DEPOSIT_CONTRACT'] || '', + knownViewContract: process.env['TEZOS_MUMBAINET_ON_CHAIN_VIEW_CONTRACT'] || knownOnChainViewContractAddressPtMumbaii, + txRollupAddress: process.env['TEZOS_MUMBAINET_TXROLLUP_ADDRESS'] || txRollupAddressPtMumbaii, + protocol: Protocols.PtMumbaii, + signerConfig: defaultSecretKey +}; + const ghostnetSecretKey = { rpc: process.env['TEZOS_RPC_GHOSTNET'] || 'http://ecad-ghostnet-rolling:8732', pollingIntervalMilliseconds: process.env['POLLING_INTERVAL_MILLISECONDS'] || undefined, @@ -195,18 +234,22 @@ if (process.env['RUN_WITH_SECRET_KEY']) { providers.push(limanetSecretKey); } else if (process.env['RUN_LIMANET_WITH_SECRET_KEY']) { providers.push(limanetSecretKey); +} else if (process.env['RUN_MUMBAINET_WITH_SECRET_KEY']) { + providers.push(mumbainetSecretKey); } else if (process.env['RUN_GHOSTNET_WITH_SECRET_KEY']) { providers.push(ghostnetSecretKey); } else if (process.env['RUN_MONDAYNET_WITH_SECRET_KEY']) { providers.push(mondaynetSecretKey); } else if (process.env['LIMANET']) { providers.push(limanetEphemeral); +} else if (process.env['MUMBAINET']) { + providers.push(mumbainetEphemeral); } else if (process.env['GHOSTNET']) { providers.push(ghostnetEphemeral); } else if (process.env['MONDAYNET']) { providers.push(mondaynetEphemeral); } else { - providers.push(limanetEphemeral); + providers.push(limanetEphemeral, mumbainetEphemeral); } const setupForger = (Tezos: TezosToolkit, forger: ForgerType): void => { diff --git a/integration-tests/contract-deploy-having-ticket.spec.ts b/integration-tests/contract-deploy-having-ticket.spec.ts index 8ded80a129..1c3f6e8165 100644 --- a/integration-tests/contract-deploy-having-ticket.spec.ts +++ b/integration-tests/contract-deploy-having-ticket.spec.ts @@ -1,10 +1,8 @@ import { CONFIGS } from "./config"; import { ticketCode } from './data/code_with_ticket'; -import { Protocols } from "@taquito/taquito"; -CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { +CONFIGS().forEach(({ lib, rpc, setup }) => { const Tezos = lib; - const limanetAndAlpha = protocol === Protocols.PtLimaPtL || protocol === Protocols.ProtoALpha ? test: test.skip; describe(`Test origination of a token contract using: ${rpc}`, () => { @@ -13,7 +11,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { done(); }); - limanetAndAlpha('Originates a contract having ticket with init and the contract api', async (done) => { + it('Originates a contract having ticket with init and the contract api', async (done) => { const op = await Tezos.contract.originate({ code: ticketCode, init: `(Pair None None)` @@ -26,7 +24,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { done(); }); - limanetAndAlpha('Originates a contract having ticket with init in JSON and the contract api', async (done) => { + it('Originates a contract having ticket with init in JSON and the contract api', async (done) => { const op = await Tezos.contract.originate({ code: ticketCode, init: { prim: 'Pair', args: [ { prim: 'None' }, { prim: 'None' } ] } @@ -39,7 +37,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { done(); }); - limanetAndAlpha('Originates a contract having ticket with storage and the contract api', async (done) => { + it('Originates a contract having ticket with storage and the contract api', async (done) => { const op = await Tezos.contract.originate({ code: ticketCode, storage: { diff --git a/integration-tests/contract-increase-paid-storage-operation.spec.ts b/integration-tests/contract-increase-paid-storage-operation.spec.ts index 4ebeeec59e..f39f4f571a 100644 --- a/integration-tests/contract-increase-paid-storage-operation.spec.ts +++ b/integration-tests/contract-increase-paid-storage-operation.spec.ts @@ -1,9 +1,8 @@ import { CONFIGS } from './config'; -import { OpKind, Protocols } from '@taquito/taquito'; +import { OpKind } from '@taquito/taquito'; import { ligoSample } from './data/ligo-simple-contract'; -CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { - const limanetAndAlpha = (protocol === Protocols.PtLimaPtL || protocol === Protocols.ProtoALpha) ? test : test.skip; +CONFIGS().forEach(({ lib, rpc, setup }) => { const Tezos = lib; let simpleContractAddress: string; @@ -33,7 +32,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { done(); }); - limanetAndAlpha(`should be able to increase the paid storage of a contract successfully: ${rpc}`, async (done) => { + it(`should be able to increase the paid storage of a contract successfully: ${rpc}`, async (done) => { const paidSpaceBefore = await Tezos.rpc.getStoragePaidSpace(simpleContractAddress); const op = await Tezos.contract.increasePaidStorage({ @@ -51,7 +50,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { done(); }); - limanetAndAlpha(`should be able to include increasePaidStorage operation in a batch: ${rpc}`, async (done) => { + it(`should be able to include increasePaidStorage operation in a batch: ${rpc}`, async (done) => { const paidSpaceBefore = await Tezos.rpc.getStoragePaidSpace(simpleContractAddress); const op = await Tezos.contract @@ -81,7 +80,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { done(); }); - limanetAndAlpha(`should be able to include increasePaidStorage operation in a batch (different batch syntax): ${rpc}`, async (done) => { + it(`should be able to include increasePaidStorage operation in a batch (different batch syntax): ${rpc}`, async (done) => { const paidSpaceBefore = await Tezos.rpc.getStoragePaidSpace(simpleContractAddress); const op = await Tezos.contract.batch([ diff --git a/integration-tests/contract-originate-and-call-contract-lambda-rec.spec.ts b/integration-tests/contract-originate-and-call-contract-lambda-rec.spec.ts index 7c580730fb..3e374c6fd2 100644 --- a/integration-tests/contract-originate-and-call-contract-lambda-rec.spec.ts +++ b/integration-tests/contract-originate-and-call-contract-lambda-rec.spec.ts @@ -1,49 +1,47 @@ -import { Protocols } from "@taquito/taquito"; import { CONFIGS } from "./config"; import { recFactApplyStore, recursiveLambda, reduceMap } from "./data/lambda-rec"; -CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { - const Tezos = lib; - const limanetAndAlpha = protocol === Protocols.PtLimaPtL || protocol === Protocols.ProtoALpha ? test : test.skip; +CONFIGS().forEach(({ lib, rpc, setup }) => { + const Tezos = lib; - describe(`Test deploying and interacting with contracts having recursive lambda through the contract api using: ${rpc}`, () => { + describe(`Test deploying and interacting with contracts having recursive lambda through the contract api using: ${rpc}`, () => { - beforeEach(async (done) => { - await setup(true); - done(); - }) + beforeEach(async (done) => { + await setup(true); + done(); + }) - limanetAndAlpha('Verify that a contract having the LAMBDA_REC instruction in its code can be deployed', async (done) => { - const deployContract = await Tezos.contract.originate({ - code: recFactApplyStore, - storage: { 0: 3 } - }); + it('Verify that a contract having the LAMBDA_REC instruction in its code can be deployed', async (done) => { + const deployContract = await Tezos.contract.originate({ + code: recFactApplyStore, + storage: { 0: 3 } + }); - await deployContract.confirmation(); - expect(deployContract.hash).toBeDefined(); - expect(deployContract.status).toEqual('applied'); + await deployContract.confirmation(); + expect(deployContract.hash).toBeDefined(); + expect(deployContract.status).toEqual('applied'); - done(); - }); + done(); + }); - limanetAndAlpha('Verify that a contract entrypoint having a type lambda can be called with a recursive lambda', async (done) => { - const deployContract = await Tezos.contract.originate({ - code: reduceMap, - storage: [1] - }); + it('Verify that a contract entrypoint having a type lambda can be called with a recursive lambda', async (done) => { + const deployContract = await Tezos.contract.originate({ + code: reduceMap, + storage: [1] + }); - const contract = await deployContract.contract(); + const contract = await deployContract.contract(); - const op = await contract.methodsObject.default({ - 0: { prim: "Lambda_rec", args: recursiveLambda }, - 1: [1] - }).send(); + const op = await contract.methodsObject.default({ + 0: { prim: "Lambda_rec", args: recursiveLambda }, + 1: [1] + }).send(); - await op.confirmation(); - expect(op.hash).toBeDefined(); - expect(op.status).toEqual('applied'); + await op.confirmation(); + expect(op.hash).toBeDefined(); + expect(op.status).toEqual('applied'); - done(); - }); + done(); }); + }); }) diff --git a/integration-tests/contract-update-consensus-key-operation.spec.ts b/integration-tests/contract-update-consensus-key-operation.spec.ts index c9510a95a6..c057af3afb 100644 --- a/integration-tests/contract-update-consensus-key-operation.spec.ts +++ b/integration-tests/contract-update-consensus-key-operation.spec.ts @@ -1,8 +1,6 @@ -import { Protocols } from '@taquito/taquito'; import { CONFIGS } from './config'; -CONFIGS().forEach(({ lib, rpc, setup, createAddress, protocol }) => { - const limanetAndAlpha = (protocol === Protocols.PtLimaPtL || protocol === Protocols.ProtoALpha) ? test : test.skip; +CONFIGS().forEach(({ lib, rpc, setup, createAddress }) => { const Tezos = lib; @@ -29,7 +27,7 @@ CONFIGS().forEach(({ lib, rpc, setup, createAddress, protocol }) => { done(); }); - limanetAndAlpha('should be able to inject update_consensus_key operation', async (done) => { + it('should be able to inject update_consensus_key operation', async (done) => { const op = await Tezos.contract.updateConsensusKey({ pk }); await op.confirmation(); diff --git a/integration-tests/injecting-multiple-manager-operations-in-a-block.spec.ts b/integration-tests/injecting-multiple-manager-operations-in-a-block.spec.ts index 9ea32b94ce..95441c96d1 100644 --- a/integration-tests/injecting-multiple-manager-operations-in-a-block.spec.ts +++ b/integration-tests/injecting-multiple-manager-operations-in-a-block.spec.ts @@ -2,47 +2,47 @@ import { Protocols } from '@taquito/taquito'; import { CONFIGS } from "./config"; 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; + 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}`, () => { + describe(`Test injecting more than one manager operation in a block: ${rpc}`, () => { - beforeEach(async (done) => { - await setup() - done() - }) + beforeEach(async (done) => { + await setup(); + 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 }); + 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 }); - const [op1, op2] = await Promise.all([op1Promise, op2Promise]) + const [op1, op2] = await Promise.all([op1Promise, op2Promise]) - await op1.confirmation(); - await op2.confirmation(); + await op1.confirmation(); + await op2.confirmation(); - } catch (error: any) { - expect(error.message).toContain('Only one manager operation per manager per block allowed'); - } - done(); - }) + } catch (error: any) { + expect(error.message).toContain('Only one manager operation per manager per block allowed'); + } + 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 }); + 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]) + const [op1, op2] = await Promise.all([op1Promise, op2Promise]) - await op1.confirmation(); - await op2.confirmation(); + await op1.confirmation(); + await op2.confirmation(); - } catch (error: any) { - expect(error.message).toContain('mempool already contains a conflicting operation'); - } - done(); - }) - }); + } catch (error: any) { + expect(error.message).toContain('mempool already contains a conflicting operation'); + } + done(); + }) + }); }) diff --git a/integration-tests/known-contracts-PtLimaPtL.ts b/integration-tests/known-contracts-PtLimaPtL.ts index ed45cad41a..227e57a1e2 100644 --- a/integration-tests/known-contracts-PtLimaPtL.ts +++ b/integration-tests/known-contracts-PtLimaPtL.ts @@ -1,6 +1,6 @@ -export const knownContractPtLimaPtL = "KT1Q8j4ahiuMu6cTtD42JmUFNtdc6aE1ctUk"; -export const knownBigMapContractPtLimaPtL = "KT1STPt3btDjttzsZ7MBmQkkfU3FykeAgYnW"; -export const knownTzip12BigMapOffChainContractPtLimaPtL = "KT1Kh3xkT7dvn4ULqhwgxq1p4yz2kGx58o5E"; -export const knownSaplingContractPtLimaPtL = "KT1B1WJhcBYY1ZuWZmgbp2CsPFHEffNZVrEj"; -export const knownOnChainViewContractAddressPtLimaPtL = "KT1MU2tLa61FVUTa1HzVS6FZjVPBZQBhZabM"; -export const txRollupAddressPtLimaPtL = "txr1SNAYyB37mfJwqByczbbRbZj41yYzfDB9F"; \ No newline at end of file +export const knownContractPtLimaPtL = "KT1NiiuTpzeh3qvmpg6x1WoUK5GFA9peHqMR"; +export const knownBigMapContractPtLimaPtL = "KT19WjpKFLhkpnPfvzJCShyVxfiRfKuXx4js"; +export const knownTzip12BigMapOffChainContractPtLimaPtL = "KT1GnRJVaqvzjeeuhcsCUZmn96ZrN8pJ2GxV"; +export const knownSaplingContractPtLimaPtL = "KT1S321F21ZTqjxwC3MgJDE8M8aTX3234ZCY"; +export const knownOnChainViewContractAddressPtLimaPtL = "KT1CH64MzwB9E5XkgdR1s7ZamHYsJuTPkDnt"; +export const txRollupAddressPtLimaPtL = "txr1WtzBSTQMfLcGNPmMeDBUhNPjX7Vo3E5p3"; \ No newline at end of file diff --git a/integration-tests/known-contracts-PtMumbaii.ts b/integration-tests/known-contracts-PtMumbaii.ts new file mode 100644 index 0000000000..42504430a1 --- /dev/null +++ b/integration-tests/known-contracts-PtMumbaii.ts @@ -0,0 +1,6 @@ +export const knownContractPtMumbaii = "KT1Pt75B5Sgf5nz4m7GX1yGCA36pR2Lf6Eit"; +export const knownBigMapContractPtMumbaii = "KT1ToCtqCSAqK85sYmD3f1AUC1h17Ho9J8J4"; +export const knownTzip12BigMapOffChainContractPtMumbaii = "KT1AJwEfLhur9snYyv86GAXdoQZqygED3X3b"; +export const knownSaplingContractPtMumbaii = "KT1MU6HasZvDrnDk7TdNVGj9zFVfDDGGrkFD"; +export const knownOnChainViewContractAddressPtMumbaii = "KT1Mon6pBMP2M48tRSCAuSTgccsnwwG7PnHw"; +export const txRollupAddressPtMumbaii = "txr1YzCiyQKjiNykr3cHoD9AVJqn9wtq81Cuc"; \ No newline at end of file diff --git a/integration-tests/local-forging.spec.ts b/integration-tests/local-forging.spec.ts index bdcfa22822..f28c3ae93d 100644 --- a/integration-tests/local-forging.spec.ts +++ b/integration-tests/local-forging.spec.ts @@ -1,11 +1,10 @@ import { CONFIGS } from "./config"; import { commonCases, limaCases } from './data/allTestsCases'; import { LocalForger, ProtocolsHash } from '@taquito/local-forging' -import { Protocols, TezosToolkit } from "@taquito/taquito"; +import { TezosToolkit } from "@taquito/taquito"; CONFIGS().forEach(({ rpc, protocol }) => { const Tezos = new TezosToolkit(rpc); - const limanetAndAlpha = protocol === Protocols.PtLimaPtL || protocol === Protocols.ProtoALpha ? test: test.skip; describe(`Test local forger: ${rpc}`, () => { @@ -25,7 +24,7 @@ CONFIGS().forEach(({ rpc, protocol }) => { }); limaCases.forEach(({ name, operation, expected }) => { - limanetAndAlpha(`Should give the same result as when forging with the rpc: ${name} (${rpc})`, async done => { + it(`Should give the same result as when forging with the rpc: ${name} (${rpc})`, async done => { const localForger = new LocalForger(protocol as unknown as ProtocolsHash); const result = await localForger.forge(operation); const rpcResult = await Tezos.rpc.forgeOperations(operation); diff --git a/integration-tests/package.json b/integration-tests/package.json index 0bb9ef9ce6..f46fe5b479 100644 --- a/integration-tests/package.json +++ b/integration-tests/package.json @@ -4,6 +4,8 @@ "test:secret-key": "RUN_WITH_SECRET_KEY=true jest --runInBand", "test:limanet": "LIMANET=true jest", "test:limanet-secret-key": "RUN_LIMANET_WITH_SECRET_KEY=true jest --runInBand", + "test:mumbainet": "MUMBAINET=true jest", + "test:mumbainet-secret-key": "RUN_MUMBAINET_WITH_SECRET_KEY=true jest --runInBand", "test:originate-known-contracts": "node -r ts-node/register originate-known-contracts.ts", "originate-known-contracts-and-run-test": "node -r ts-node/register originate-known-contracts.ts && jest", "test:mondaynet": "MONDAYNET=true jest", diff --git a/integration-tests/rpc-get-protocol-constants.spec.ts b/integration-tests/rpc-get-protocol-constants.spec.ts index 4eed0bf0bb..e9d9f9cce3 100644 --- a/integration-tests/rpc-get-protocol-constants.spec.ts +++ b/integration-tests/rpc-get-protocol-constants.spec.ts @@ -1,11 +1,19 @@ import { Protocols } from '@taquito/taquito'; import { CONFIGS } from './config'; import BigNumber from 'bignumber.js'; -import { ConstantsResponseProto009, ConstantsResponseProto010, ConstantsResponseProto011, ConstantsResponseProto012, ConstantsResponseProto013, ConstantsResponseProto014, ConstantsResponseProto015 } from '@taquito/rpc'; +import { + ConstantsResponseProto009, + ConstantsResponseProto010, + ConstantsResponseProto011, + ConstantsResponseProto012, + ConstantsResponseProto013, + ConstantsResponseProto015 +} from '@taquito/rpc'; CONFIGS().forEach(({ lib, protocol, rpc }) => { const Tezos = lib; const limanet = (protocol === Protocols.PtLimaPtL) ? test : test.skip; + const mumbainet = (protocol === Protocols.PtMumbaii) ? test : test.skip; const alpha = (protocol === Protocols.ProtoALpha) ? test : test.skip; describe('Test fetching constants for all protocols on Mainnet', () => { @@ -695,6 +703,112 @@ CONFIGS().forEach(({ lib, protocol, rpc }) => { done(); }); + mumbainet(`successfully fetches all constants for mumbainet using ${rpc}`, async (done) => { + Tezos.setRpcProvider(rpc); + const constants: ConstantsResponseProto015 = await Tezos.rpc.getConstants(); + + expect(constants).toEqual({ + proof_of_work_nonce_size: 8, + nonce_length: 32, + nonce_revelation_threshold: 512, + max_anon_ops_per_block: 132, + max_operation_data_length: 32768, + max_proposals_per_delegate: 20, + preserved_cycles: 3, + blocks_per_cycle: 8192, + blocks_per_commitment: 64, + hard_gas_limit_per_operation: new BigNumber(1040000), + hard_gas_limit_per_block: new BigNumber(2600000), + proof_of_work_threshold: new BigNumber(-1), + seed_nonce_revelation_tip: new BigNumber(125000), + origination_size: 257, + cost_per_byte: new BigNumber(250), + hard_storage_limit_per_operation: new BigNumber(60000), + quorum_min: 2000, + quorum_max: 7000, + min_proposal_quorum: 500, + liquidity_baking_subsidy: new BigNumber(666666), + liquidity_baking_toggle_ema_threshold: 1000000000, + max_allowed_global_constants_depth: 10000, + max_micheline_bytes_limit: 50000, + max_micheline_node_count: 50000, + michelson_maximum_type_size: 2001, + blocks_per_stake_snapshot: 512, + baking_reward_fixed_portion: new BigNumber(2666666), + baking_reward_bonus_per_slot: new BigNumber(1143), + endorsing_reward_per_slot: new BigNumber(761), + max_operations_time_to_live: 240, + consensus_committee_size: 7000, + consensus_threshold: 4667, + minimal_participation_ratio: { + denominator: 3, + numerator: 2, + }, + max_slashing_period: 2, + frozen_deposits_percentage: 10, + double_baking_punishment: new BigNumber(640000000), + ratio_of_frozen_deposits_slashed_per_double_endorsement: { + denominator: 2, + numerator: 1, + }, + minimal_block_delay: new BigNumber(8), + delay_increment_per_round: new BigNumber(3), + dal_parametric: { + attestation_lag: 1, + feature_enable: false, + number_of_shards: 2048, + number_of_slots: 256, + page_size: 4096, + redundancy_factor: 16, + slot_size: 1048576, + availability_threshold: 50 + }, + minimal_stake: new BigNumber('6000000000'), + cache_layout_size: 3, + cache_sampler_state_cycles: 8, + cache_script_size: 100000000, + cache_stake_distribution_cycles: 8, + cycles_per_voting_period: 1, + smart_rollup_arith_pvm_enable: false, + smart_rollup_challenge_window_in_blocks: 80640, + smart_rollup_commitment_period_in_blocks: 60, + smart_rollup_enable: true, + smart_rollup_max_active_outbox_levels: 80640, + smart_rollup_max_lookahead_in_blocks: 172800, + smart_rollup_max_number_of_cemented_commitments: 5, + smart_rollup_max_number_of_messages_per_level: "1000000", + smart_rollup_max_number_of_parallel_games: 32, + smart_rollup_max_outbox_messages_per_level: 100, + smart_rollup_max_wrapped_proof_binary_size: 30000, + smart_rollup_message_size_limit: 4096, + smart_rollup_number_of_sections_in_dissection: 32, + smart_rollup_origination_size: 6314, + smart_rollup_stake_amount: "10000000000", + smart_rollup_timeout_period_in_blocks: 40320, + tx_rollup_commitment_bond: new BigNumber(10000000000), + tx_rollup_cost_per_byte_ema_factor: 120, + tx_rollup_enable: false, + tx_rollup_finality_period: 40000, + tx_rollup_hard_size_limit_per_inbox: 500000, + tx_rollup_hard_size_limit_per_message: 5000, + tx_rollup_max_commitments_count: 80100, + tx_rollup_max_inboxes_count: 40100, + tx_rollup_max_messages_per_inbox: 1010, + tx_rollup_max_ticket_payload_size: 2048, + tx_rollup_max_withdrawals_per_batch: 15, + tx_rollup_origination_size: 4000, + tx_rollup_rejection_max_proof_size: 30000, + tx_rollup_sunset_level: 10000000, + tx_rollup_withdraw_period: 40000, + vdf_difficulty: new BigNumber('2000000000'), + zk_rollup_enable: false, + zk_rollup_min_pending_to_process: 10, + zk_rollup_origination_size: 4000, + testnet_dictator: 'tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8' + }); + + done(); + }); alpha(`successfully fetches all constants for mondaynet using ${rpc}`, async (done) => { Tezos.setRpcProvider(rpc); diff --git a/integration-tests/rpc-nodes.spec.ts b/integration-tests/rpc-nodes.spec.ts index 2b5744272d..35e05610fb 100644 --- a/integration-tests/rpc-nodes.spec.ts +++ b/integration-tests/rpc-nodes.spec.ts @@ -20,10 +20,8 @@ CONFIGS().forEach( }) => { const Tezos = lib; - const limanetAndAlpha = protocol === Protocols.PtLimaPtL || protocol === Protocols.ProtoALpha ? test : test.skip; const Limanet = protocol === Protocols.PtLimaPtL ? it : it.skip; - const unrestrictedRPCNode = rpc.endsWith("ecadinfra.com") ? test.skip : test; beforeAll(async (done) => { @@ -424,13 +422,13 @@ CONFIGS().forEach( done(); }); - limanetAndAlpha('Verify that rpcClient.getStorageUsedSpace will retrieve the used space of a contract storage', async (done) => { + it('Verify that rpcClient.getStorageUsedSpace will retrieve the used space of a contract storage', async (done) => { const usedSpace = await rpcClient.getStorageUsedSpace(knownContract); expect(usedSpace).toBeDefined(); done(); }); - limanetAndAlpha('Verify that rpcClient.getStoragePaidSpace will retrieve the paid space of a contract storage', async (done) => { + it('Verify that rpcClient.getStoragePaidSpace will retrieve the paid space of a contract storage', async (done) => { const paidSpace = await rpcClient.getStoragePaidSpace(knownContract); expect(paidSpace).toBeDefined(); done(); diff --git a/integration-tests/wallet-deploy-having-ticket.spec.ts b/integration-tests/wallet-deploy-having-ticket.spec.ts index e7608c0000..aff75d2e96 100644 --- a/integration-tests/wallet-deploy-having-ticket.spec.ts +++ b/integration-tests/wallet-deploy-having-ticket.spec.ts @@ -1,11 +1,8 @@ import { CONFIGS } from "./config"; import { ticketCode, ticketStorage } from './data/code_with_ticket'; -import { ticketCodeProto14, ticketStorageProto14 } from './data/code_with_ticket_proto14'; -import { Protocols } from "@taquito/taquito"; -CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { +CONFIGS().forEach(({ lib, rpc, setup }) => { const Tezos = lib; - const limanetAndAlpha = protocol === Protocols.PtLimaPtL || protocol === Protocols.ProtoALpha ? test: test.skip; describe(`Test contract origination having ticket with init through wallet api using: ${rpc}`, () => { @@ -14,7 +11,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { done(); }); - limanetAndAlpha('Verify wallet.originate for a contract having ticket with init', async (done) => { + it('Verify wallet.originate for a contract having ticket with init', async (done) => { const op = await Tezos.wallet.originate({ code: ticketCode, init: ticketStorage @@ -26,7 +23,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { done(); }); - limanetAndAlpha('Verify wallet.originate having ticket with init in JSON', async (done) => { + it('Verify wallet.originate having ticket with init in JSON', async (done) => { const op = await Tezos.wallet.originate({ code: ticketCode, init: { prim: 'Pair', args: [ { prim: 'None' }, { prim: 'None' } ] } @@ -37,7 +34,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { done(); }); - limanetAndAlpha('Verify wallet.originate for a contract having ticket with storage', async (done) => { + it('Verify wallet.originate for a contract having ticket with storage', async (done) => { const op = await Tezos.wallet.originate({ code: ticketCode, storage: { diff --git a/integration-tests/wallet-increase-paid-storage-operation.spec.ts b/integration-tests/wallet-increase-paid-storage-operation.spec.ts index 9bcd2cba4b..ffe26375b4 100644 --- a/integration-tests/wallet-increase-paid-storage-operation.spec.ts +++ b/integration-tests/wallet-increase-paid-storage-operation.spec.ts @@ -1,9 +1,6 @@ import { CONFIGS } from './config'; -import { OpKind, Protocols } from '@taquito/taquito'; -import { ligoSample } from './data/ligo-simple-contract'; -CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { - const limanetAndAlpha = (protocol === Protocols.PtLimaPtL || protocol === Protocols.ProtoALpha) ? test : test.skip; +CONFIGS().forEach(({ lib, rpc, setup }) => { const Tezos = lib; let simpleContractAddress: string; @@ -32,7 +29,8 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { } done(); }); - limanetAndAlpha(`should be able to increase the paid storage of a contract successfully: ${rpc}`, async (done) => { + + it(`should be able to increase the paid storage of a contract successfully: ${rpc}`, async (done) => { const paidSpaceBefore = await Tezos.rpc.getStoragePaidSpace(simpleContractAddress); const op = await Tezos.wallet.increasePaidStorage({ @@ -50,7 +48,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => { done(); }); - limanetAndAlpha(`should be able to include increasePaidStorage operation in a batch: ${rpc}`, async (done) => { + it(`should be able to include increasePaidStorage operation in a batch: ${rpc}`, async (done) => { const paidSpaceBefore = await Tezos.rpc.getStoragePaidSpace(simpleContractAddress); const batch = await Tezos.wallet diff --git a/packages/taquito/src/constants.ts b/packages/taquito/src/constants.ts index e947d8b5a0..ae9754a512 100644 --- a/packages/taquito/src/constants.ts +++ b/packages/taquito/src/constants.ts @@ -34,6 +34,7 @@ export enum Protocols { PtJakart2 = 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', PtKathman = 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', PtLimaPtL = 'PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW', + PtMumbaii = 'PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc', ProtoALpha = 'ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK', } @@ -50,7 +51,8 @@ export const protocols = { '013': [Protocols.PtJakart2], '014': [Protocols.PtKathman], '015': [Protocols.PtLimaPtL], - '016': [Protocols.ProtoALpha] + '016': [Protocols.PtMumbaii], + '017': [Protocols.ProtoALpha], }; export enum ChainIds { @@ -66,4 +68,5 @@ export enum ChainIds { JAKARTANET2 = 'NetXLH1uAxK7CCh', KATHMANDUNET = 'NetXazhm4yetmff', LIMANET = 'NetXizpkH94bocH', + MUMBAINET = 'NetXQw6nWSnrJ5t', }