Skip to content

Commit

Permalink
test: adjusted tests for paris2 protocol (#2980)
Browse files Browse the repository at this point in the history
  • Loading branch information
hui-an-yang authored Jun 3, 2024
1 parent 18bca78 commit 9bda597
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion apps/taquito-test-dapp/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ export const contractAddress = {
mainnet: "KT1ShtH2zCrKMuWGRejEd6RAcnePwxBQeMAN",
ghostnet: "KT1QKmcNBcfzVTXG2kBcE6XqXtEuYYUzMcT5",
oxfordnet: "KT1GYx1KDhMQt2GJEztRh8EyYxJUPM6fnAMM",
parisnet: "KT1LBQmSDGsRj4LFa2bsCsZLkGCtmRFVVcPh",
parisnet: "KT1E43cQefjM8fq7B5pEJFJoGbRmuNibDoBC",
};
84 changes: 42 additions & 42 deletions integration-tests/__tests__/contract/estimation-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
const estimate = await LowAmountTez.estimate.transfer({ to: await Tezos.signer.publicKeyHash(), amount: 0.019 });
expect(estimate.gasLimit).toEqual(101);
expect(estimate.storageLimit).toEqual(0);
expect(estimate.suggestedFeeMutez).toEqual(188);
expect(estimate.suggestedFeeMutez).toEqual(186);
expect(estimate.burnFeeMutez).toEqual(0);
expect(estimate.minimalFeeMutez).toEqual(168);
expect(estimate.totalCost).toEqual(168);
expect(estimate.usingBaseFeeMutez).toEqual(168);
expect(estimate.minimalFeeMutez).toEqual(166);
expect(estimate.totalCost).toEqual(166);
expect(estimate.usingBaseFeeMutez).toEqual(166);
expect(estimate.consumedMilligas).toEqual(100040);
});

it('Verify .estimate.transfer with unallocated destination', async () => {
const estimate = await LowAmountTez.estimate.transfer({ to: await (await createAddress()).signer.publicKeyHash(), amount: 0.017 });
expect(estimate.gasLimit).toEqual(101);
expect(estimate.storageLimit).toEqual(277);
expect(estimate.suggestedFeeMutez).toEqual(188);
expect(estimate.suggestedFeeMutez).toEqual(186);
expect(estimate.burnFeeMutez).toEqual(69250);
expect(estimate.minimalFeeMutez).toEqual(168);
expect(estimate.totalCost).toEqual(69418);
expect(estimate.usingBaseFeeMutez).toEqual(168);
expect(estimate.minimalFeeMutez).toEqual(166);
expect(estimate.totalCost).toEqual(69416);
expect(estimate.usingBaseFeeMutez).toEqual(166);
expect(estimate.consumedMilligas).toEqual(100040);
});

Expand All @@ -69,11 +69,11 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
});
expect(estimate.gasLimit).toEqual(677);
expect(estimate.storageLimit).toEqual(591);
expect(estimate.suggestedFeeMutez).toEqual(537);
expect(estimate.suggestedFeeMutez).toEqual(535);
expect(estimate.burnFeeMutez).toEqual(147750);
expect(estimate.minimalFeeMutez).toEqual(517);
expect(estimate.totalCost).toEqual(148267);
expect(estimate.usingBaseFeeMutez).toEqual(517);
expect(estimate.minimalFeeMutez).toEqual(515);
expect(estimate.totalCost).toEqual(148265);
expect(estimate.usingBaseFeeMutez).toEqual(515);
expect(estimate.consumedMilligas).toEqual(676402);
});

Expand All @@ -84,25 +84,25 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
});
expect(estimate.gasLimit).toEqual(100);
expect(estimate.storageLimit).toEqual(0);
expect(estimate.suggestedFeeMutez).toEqual(183);
expect(estimate.suggestedFeeMutez).toEqual(181);
expect(estimate.burnFeeMutez).toEqual(0);
expect(estimate.minimalFeeMutez).toEqual(163);
expect(estimate.totalCost).toEqual(163);
expect(estimate.usingBaseFeeMutez).toEqual(163);
expect(estimate.minimalFeeMutez).toEqual(161);
expect(estimate.totalCost).toEqual(161);
expect(estimate.usingBaseFeeMutez).toEqual(161);
expect(estimate.consumedMilligas).toEqual(100000);
});

it('Verify .estimate.transfer for internal transfer to allocated implicit', async () => {
const tx = contract.methods.do(MANAGER_LAMBDA.transferImplicit(knownBaker, 5)).toTransferParams();
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(1457);
expect(estimate.gasLimit).toEqual(1456);
expect(estimate.storageLimit).toEqual(0);
expect(estimate.suggestedFeeMutez).toEqual(396);
expect(estimate.suggestedFeeMutez).toEqual(394);
expect(estimate.burnFeeMutez).toEqual(0);
expect(estimate.minimalFeeMutez).toEqual(376);
expect(estimate.totalCost).toEqual(376);
expect(estimate.usingBaseFeeMutez).toEqual(376);
expect(estimate.consumedMilligas).toEqual(1456228);
expect(estimate.minimalFeeMutez).toEqual(374);
expect(estimate.totalCost).toEqual(374);
expect(estimate.usingBaseFeeMutez).toEqual(374);
expect(estimate.consumedMilligas).toEqual(1455798);
});

it('Verify .estimate.transfer for multiple internal transfers to unallocated account', async () => {
Expand All @@ -114,38 +114,38 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(1571);
expect(estimate.storageLimit).toEqual(534);
expect(estimate.suggestedFeeMutez).toEqual(467);
expect(estimate.suggestedFeeMutez).toEqual(465);
expect(estimate.burnFeeMutez).toEqual(133500);
expect(estimate.minimalFeeMutez).toEqual(447);
expect(estimate.totalCost).toEqual(133947);
expect(estimate.usingBaseFeeMutez).toEqual(447);
expect(estimate.consumedMilligas).toEqual(1570757);
expect(estimate.minimalFeeMutez).toEqual(445);
expect(estimate.totalCost).toEqual(133945);
expect(estimate.usingBaseFeeMutez).toEqual(445);
expect(estimate.consumedMilligas).toEqual(1570327);
});

it('Verify .estimate.transfer for internal origination', async () => {
const tx = contract.methods.do(originate()).toTransferParams();
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(1867);
expect(estimate.storageLimit).toEqual(337);
expect(estimate.suggestedFeeMutez).toEqual(443);
expect(estimate.suggestedFeeMutez).toEqual(441);
expect(estimate.burnFeeMutez).toEqual(84250);
expect(estimate.minimalFeeMutez).toEqual(423);
expect(estimate.totalCost).toEqual(84673);
expect(estimate.usingBaseFeeMutez).toEqual(423);
expect(estimate.consumedMilligas).toEqual(1866852);
expect(estimate.minimalFeeMutez).toEqual(421);
expect(estimate.totalCost).toEqual(84671);
expect(estimate.usingBaseFeeMutez).toEqual(421);
expect(estimate.consumedMilligas).toEqual(1866422);
});

it('Verify .estimate.transfer for multiple internal originations', async () => {
const tx = contract.methods.do(originate2()).toTransferParams();
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(2393);
expect(estimate.gasLimit).toEqual(2392);
expect(estimate.storageLimit).toEqual(654);
expect(estimate.suggestedFeeMutez).toEqual(561);
expect(estimate.suggestedFeeMutez).toEqual(559);
expect(estimate.burnFeeMutez).toEqual(163500);
expect(estimate.minimalFeeMutez).toEqual(541);
expect(estimate.totalCost).toEqual(164041);
expect(estimate.usingBaseFeeMutez).toEqual(541);
expect(estimate.consumedMilligas).toEqual(2392005);
expect(estimate.minimalFeeMutez).toEqual(539);
expect(estimate.totalCost).toEqual(164039);
expect(estimate.usingBaseFeeMutez).toEqual(539);
expect(estimate.consumedMilligas).toEqual(2391575);
// Do the actual operation
const op2 = await contract.methods.do(originate2()).send();
await op2.confirmation();
Expand Down Expand Up @@ -176,11 +176,11 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
let estimate = await LowAmountTez.estimate.transfer({ to: await Tezos.signer.publicKeyHash(), mutez: true, amount: amt - (1382 + getRevealFee(await LowAmountTez.signer.publicKeyHash())) });
expect(estimate.gasLimit).toEqual(101);
expect(estimate.storageLimit).toEqual(0);
expect(estimate.suggestedFeeMutez).toEqual(187);
expect(estimate.suggestedFeeMutez).toEqual(185);
expect(estimate.burnFeeMutez).toEqual(0);
expect(estimate.minimalFeeMutez).toEqual(167);
expect(estimate.totalCost).toEqual(167);
expect(estimate.usingBaseFeeMutez).toEqual(167);
expect(estimate.minimalFeeMutez).toEqual(165);
expect(estimate.totalCost).toEqual(165);
expect(estimate.usingBaseFeeMutez).toEqual(165);
expect(estimate.consumedMilligas).toEqual(100040);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ProtoGreaterOrEqual } from '@taquito/michel-codec';

CONFIGS().forEach(({ lib, rpc, setup, knownBaker, protocol }) => {
const Tezos = lib;
const parisAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.PtParisBQ) ? test : test.skip;
const parisAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.PtParisBx) ? test : test.skip;

describe(`Staking pseudo operations: ${rpc}`, () => {

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/__tests__/local-forging.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ProtoGreaterOrEqual } from '@taquito/michel-codec';

CONFIGS().forEach(({ rpc, protocol }) => {
const Tezos = new TezosToolkit(rpc);
const parisAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.PtParisBQ) ? test : test.skip
const parisAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.PtParisBx) ? test : test.skip

describe(`Test local forger: ${rpc}`, () => {
parisCases.forEach(({ name, operation, expected }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ConstantsResponseProto019, ConstantsResponseProto020 } from '@taquito/r

CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
const Tezos = lib;
const parisnet = (networkType == NetworkType.TESTNET && protocol === Protocols.PtParisBQ) ? test : test.skip;
const parisnet = (networkType == NetworkType.TESTNET && protocol === Protocols.PtParisBx) ? test : test.skip;
const weeklynet = (networkType == NetworkType.TESTNET && protocol === Protocols.ProtoALpha) ? test : test.skip;
describe('Test fetching constants for all protocols on Mainnet', () => {
const rpcUrl = 'https://mainnet.ecadinfra.com/';
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/__tests__/rpc/nodes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CONFIGS().forEach(
}) => {
const Tezos = lib;
const unrestrictedRPCNode = rpc.endsWith("ecadinfra.com") ? test.skip : test;
const parisAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.PtParisBQ) ? test : test.skip;
const parisAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.PtParisBx) ? test : test.skip;

let ticketContract: DefaultContractType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { InvalidStakingAddressError, InvalidFinalizeUnstakeAmountError } from '@

CONFIGS().forEach(({ lib, rpc, setup, protocol, knownBaker }) => {
const Tezos = lib;
const parisAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.PtParisBQ) ? test : test.skip;
const parisAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.PtParisBx) ? test : test.skip;
describe(`Test staking pseudo operations using: ${rpc}`, () => {
beforeAll(async () => {
await setup(true);
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { RpcClient, RpcClientCache } from '@taquito/rpc';
import { KnownContracts } from './known-contracts';
import { knownContractsProtoALph } from './known-contracts-ProtoALph';
import { knownContractsPtGhostnet } from './known-contracts-PtGhostnet';
import { knownContractsPtParisBQ } from './known-contracts-PtParisBQ';
import { knownContractsPtParisBx } from './known-contracts-PtParisBx';
import { knownContractsPtNairobi } from './known-contracts-PtNairobi';

const nodeCrypto = require('crypto');
Expand Down Expand Up @@ -132,9 +132,9 @@ const defaultConfig = ({
const parisnetEphemeral: Config =
defaultConfig({
networkName: 'PARISNET',
protocol: Protocols.PtParisBQ,
protocol: Protocols.PtParisBx,
defaultRpc: 'http://parisnet.i.ecadinfra.com:8732/',
knownContracts: knownContractsPtParisBQ,
knownContracts: knownContractsPtParisBx,
signerConfig: defaultEphemeralConfig('https://keygen.ecadinfra.com/parisnet')
});

Expand All @@ -153,7 +153,7 @@ const nairobinetSecretKey: Config =
const ghostnetEphemeral: Config =
defaultConfig({
networkName: 'GHOSTNET',
protocol: Protocols.ProxfordY,
protocol: Protocols.PtParisBx,
defaultRpc: 'http://ecad-ghostnet-rolling-2.i.tez.ie:8732',
knownContracts: knownContractsPtGhostnet,
signerConfig: defaultEphemeralConfig('https://keygen.ecadinfra.com/ghostnet')
Expand Down
8 changes: 0 additions & 8 deletions integration-tests/known-contracts-PtParisBQ.ts

This file was deleted.

8 changes: 8 additions & 0 deletions integration-tests/known-contracts-PtParisBx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { KnownContracts } from './known-contracts';
export const knownContractsPtParisBx: KnownContracts = {
contract: "KT1ThHYHrNMiSuMG2Ba1HtHTWYyRtojWn44b",
bigMapContract: "KT1ACeLXs4fA3fakG4vhNumSfT7HxaApKjE3",
tzip12BigMapOffChainContract: "KT1HSPysYK1G2wLGPXjgbYTqpDyv49U3xVEo",
saplingContract: "KT1TirpKfRqAW1jXAr3RwAZB2kF3r5FJHuST",
onChainViewContractAddress: "KT1Ev43gMu5kwHNYp2kg6TXbQZtyKGMu2U9a",
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export * from './interface';
export { VERSION } from './version';
export { ProtocolsHash } from './protocols';

const PROTOCOL_CURRENT = ProtocolsHash.PtParisBQ;
const PROTOCOL_CURRENT = ProtocolsHash.PtParisBx;

export function getCodec(codec: CODEC, _proto: ProtocolsHash) {
return {
Expand Down
6 changes: 3 additions & 3 deletions packages/taquito-rpc/test/taquito-rpc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3097,7 +3097,7 @@ describe('RpcClient test', () => {
it('should query the right url and property for operation, proto 20, attestation_with_dal', async () => {
httpBackend.createRequest.mockReturnValue(
Promise.resolve({
protocol: 'PtParisBQscdCm6Cfow6ndeU6wKJyA3aV1j4D3gQBQMsTQyJCrz',
protocol: 'PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ',
chain_id: 'NetXo8SqH1c38SS',
hash: 'BKsCfYZrh417adJiKbGsyhVG2XrvUBJDhhkCAkZQzWzkEHCejXr',
header: {
Expand All @@ -3121,7 +3121,7 @@ describe('RpcClient test', () => {
operations: [
[
{
protocol: 'PtParisBQscdCm6Cfow6ndeU6wKJyA3aV1j4D3gQBQMsTQyJCrz',
protocol: 'PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ',
chain_id: 'NetXo8SqH1c38SS',
hash: 'opSmHyeasw4QcJ4Jc2qi6arNeSQMhFRjHBdFYWXGoMydLkgVRtb',
branch: 'BLHyjaqV2FhuHLQL3CBjWJqgZZ77BxcNxh3ehXcNYMQjjqAPwqA',
Expand Down Expand Up @@ -3164,7 +3164,7 @@ describe('RpcClient test', () => {
it('should query the right url and property for operation, proto 20, dal_publish_commitment', async () => {
httpBackend.createRequest.mockReturnValue(
Promise.resolve({
protocol: 'PtParisBQscdCm6Cfow6ndeU6wKJyA3aV1j4D3gQBQMsTQyJCrz',
protocol: 'PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ',
chain_id: 'NetXo8SqH1c38SS',
hash: 'BKsCfYZrh417adJiKbGsyhVG2XrvUBJDhhkCAkZQzWzkEHCejXr',
header: {
Expand Down

0 comments on commit 9bda597

Please sign in to comment.