Skip to content

Commit

Permalink
remove kathmandu references (#2323)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsawali authored Jan 31, 2023
1 parent 9f08a07 commit fb3b6bd
Show file tree
Hide file tree
Showing 12 changed files with 15,111 additions and 1,200 deletions.
124 changes: 1 addition & 123 deletions integration-tests/data/allTestsCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ import {
example10,
} from './code_with_sapling';
import { ticketCode, ticketStorage } from './code_with_ticket';
import {
ticketCodeProto14,
ticketCode2Proto14,
ticketCode3Proto14,
ticketCode4Proto14,
ticketStorageProto14,
ticketStorage2Proto14,
ticketStorage3Proto14,
ticketStorage4Proto14,
} from './code_with_ticket_proto14';
import { genericCode, genericStorage } from './generic_contract';
import { tokenBigmapCode, tokenBigmapStorage } from './token_bigmap';
import { noAnnotCode, noAnnotInit } from './token_without_annotation';
Expand All @@ -32,7 +22,6 @@ import { codeViewsTopLevel, storageViewsTopLevel } from './contract_views_top_le
import { MichelsonV1Expression, OpKind } from '@taquito/rpc';
import { emitCode } from './code_with_emit';
import { lambdaRecCode } from './code_with_lambda_rec';
import { opMappingProto14 } from '../../packages/taquito-local-forging/src/proto14-kathmandu/constants-proto14'

function extractOp(
startIndex: number,
Expand Down Expand Up @@ -807,7 +796,7 @@ export const commonCases: TestCase[] = [
],
},
},
...extractOp(0, 151, opMappingProto14).map((op): TestCase => {
...extractOp(0, 154, opMapping).map((op): TestCase => {
return {
name: `Origination operation (${op})`,
operation: {
Expand Down Expand Up @@ -930,90 +919,6 @@ export const commonCases: TestCase[] = [
],
},
},
{
name: 'Origination where storage is a pair of 2 optional annotated tickets',
operation: {
branch: 'BLzyjjHKEKMULtvkpSHxuZxx6ei6fpntH2BTkYZiLgs8zLVstvX',
contents: [
{
kind: OpKind.ORIGINATION,
counter: '1',
source: 'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn',
fee: '10000',
gas_limit: '10',
storage_limit: '10',
balance: '0',
script: {
code: ticketCodeProto14,
storage: ticketStorageProto14,
},
},
],
},
},
{
name: 'Origination where parameter contains a pair having 3 args',
operation: {
branch: 'BLzyjjHKEKMULtvkpSHxuZxx6ei6fpntH2BTkYZiLgs8zLVstvX',
contents: [
{
kind: OpKind.ORIGINATION,
counter: '1',
source: 'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn',
fee: '10000',
gas_limit: '10',
storage_limit: '10',
balance: '0',
script: {
code: ticketCode2Proto14,
storage: ticketStorage2Proto14,
},
},
],
},
},
{
name: 'Origination where storage contains nested pairs and a ticket inside a big map',
operation: {
branch: 'BLzyjjHKEKMULtvkpSHxuZxx6ei6fpntH2BTkYZiLgs8zLVstvX',
contents: [
{
kind: OpKind.ORIGINATION,
counter: '1',
source: 'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn',
fee: '10000',
gas_limit: '10',
storage_limit: '10',
balance: '0',
script: {
code: ticketCode3Proto14,
storage: ticketStorage3Proto14,
},
},
],
},
},
{
name: 'Origination with ticket',
operation: {
branch: 'BLzyjjHKEKMULtvkpSHxuZxx6ei6fpntH2BTkYZiLgs8zLVstvX',
contents: [
{
kind: OpKind.ORIGINATION,
counter: '1',
source: 'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn',
fee: '10000',
gas_limit: '10',
storage_limit: '10',
balance: '0',
script: {
code: ticketCode4Proto14,
storage: ticketStorage4Proto14,
},
},
],
},
},
{
name: 'Origination with sapling_transaction in storage',
operation: {
Expand Down Expand Up @@ -1386,33 +1291,6 @@ export const commonCases: 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(152, 154, opMapping).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 TICKET`,
operation: {
Expand Down
42 changes: 15 additions & 27 deletions integration-tests/local-forging.spec.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,25 @@
import { CONFIGS } from "./config";
import { commonCases, limaCases } from './data/allTestsCases';
import { commonCases } from './data/allTestsCases';
import { LocalForger, ProtocolsHash } from '@taquito/local-forging'
import { TezosToolkit } from "@taquito/taquito";

CONFIGS().forEach(({ rpc, protocol }) => {
const Tezos = new TezosToolkit(rpc);
const Tezos = new TezosToolkit(rpc);

describe(`Test local forger: ${rpc}`, () => {
describe(`Test local forger: ${rpc}`, () => {

// all protocols
commonCases.forEach(({ name, operation, expected }) => {
// all protocols
commonCases.forEach(({ name, operation, expected }) => {
it(`Verify that .forge for local forge will return same result as for network forge for rpc: ${name} (${rpc})`, async done => {
const localForger = new LocalForger(protocol as unknown as ProtocolsHash);

it(`Verify that .forge for local forge will return same result as for network forge for 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);
expect(result).toEqual(rpcResult);
expect(await localForger.parse(result)).toEqual(expected || operation);

const result = await localForger.forge(operation);
const rpcResult = await Tezos.rpc.forgeOperations(operation);
expect(result).toEqual(rpcResult);
expect(await localForger.parse(result)).toEqual(expected || operation);

done();
});
});

limaCases.forEach(({ name, operation, expected }) => {
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);
expect(result).toEqual(rpcResult);
expect(await localForger.parse(result)).toEqual(expected || operation);
done();
});
});
done();
});
});
})
});
});
Loading

0 comments on commit fb3b6bd

Please sign in to comment.