diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c14f028623..faa86c4120 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,6 +45,8 @@ jobs: include: - testnet: nairobinet testnet_uppercase: NAIROBINET + - testnet: oxfordnet + testnet_uppercase: OXFORDNET steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -73,6 +75,10 @@ jobs: testnet: nairobinet testnet_uppercase: NAIROBINET flextesa_docker_image: oxheadalpha/flextesa:20230607 + - protocol: Oxford + testnet: oxfordnet + testnet_uppercase: OXFORDNET + flextesa_docker_image: oxheadalpha/flextesa:20230915 steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 diff --git a/apps/taquito-test-dapp/package.json b/apps/taquito-test-dapp/package.json index 37b2fc2720..4ec25f5917 100644 --- a/apps/taquito-test-dapp/package.json +++ b/apps/taquito-test-dapp/package.json @@ -1,7 +1,7 @@ { "name": "taquito-test-dapp-vite", "private": true, - "version": "17.3.1", + "version": "18.0.0-RC.0", "type": "module", "scripts": { "dev": "vite", @@ -25,9 +25,9 @@ }, "dependencies": { "@airgap/beacon-sdk": "4.0.10", - "@taquito/beacon-wallet": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/beacon-wallet": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "buffer": "^6.0.3", "svelte-select": "^4.4.7", "vite-compatible-readable-stream": "^3.6.1" diff --git a/apps/taquito-test-dapp/src/App.svelte b/apps/taquito-test-dapp/src/App.svelte index cc7f65b418..2ad712ccda 100644 --- a/apps/taquito-test-dapp/src/App.svelte +++ b/apps/taquito-test-dapp/src/App.svelte @@ -11,16 +11,14 @@ let layout: Layout; // https://ide.ligolang.org/p/RL93C86hftTTCNGU0ykLMw | https://ide.ligolang.org/p/61ENTorA4PSfQg-jhpu0jA - // https://better-call.dev/florencenet/KT1PzUGbdKaN332Smfd1ExpdKQ7BSzzJRqJ4/operations - // https://better-call.dev/granadanet/KT1T836HqhBu9waqmknStVDCXu2WogZtzsNz/operations - // https://better-call.dev/hangzhounet/KT1T2gL26SwYMxpkR5SZT1pHRBF84knfw8Cg/operations - // https://better-call.dev/ithacanet/KT1QKmcNBcfzVTXG2kBcE6XqXtEuYYUzMcT5/operations - // https://better-call.dev/mumbainet/KT1Tkm7U3NS9JWgeCGywrRTSQdLZJvDSgD5Z/operations + // https://better-call.dev/ghostnet/KT1QKmcNBcfzVTXG2kBcE6XqXtEuYYUzMcT5/operations + // https://better-call.dev/nairobinet/KT1WoyF3wpUGRm6fbmmm1qKmpfneq1iijMT8/operations + // https://better-call.dev/oxfordnet/KT1A2o9bDfzfmZW9npuWD5UtjUTqqZwDf24x/operations let browser = ""; let availableNetworks = [ { value: "ghostnet", label: "Ghostnet", group: "current testnets" }, - { value: "mumbainet", label: "Mumbainet", group: "current testnets" }, + { value: "oxfordnet", label: "Oxfordnet", group: "current testnets" }, { value: "nairobinet", label: "Nairobinet", group: "current testnets" }, { value: "mainnet", label: "Mainnet", group: "mainnet" }, { value: "dailynet", label: "Dailynet", group: "other testnets" }, @@ -48,8 +46,8 @@ case "ghostnet": store.updateNetworkType(NetworkType.GHOSTNET); break; - case "mumbainet": - store.updateNetworkType(NetworkType.MUMBAINET); + case "oxfordnet": + store.updateNetworkType(NetworkType.OXFORDNET); break; case "nairobinet": store.updateNetworkType(NetworkType.NAIROBINET); diff --git a/apps/taquito-test-dapp/src/config.ts b/apps/taquito-test-dapp/src/config.ts index 9d12294df6..786907d3c3 100644 --- a/apps/taquito-test-dapp/src/config.ts +++ b/apps/taquito-test-dapp/src/config.ts @@ -1,10 +1,9 @@ import { NetworkType } from "@airgap/beacon-sdk"; export const rpcUrl = { - mumbainet: "https://mumbainet.ecadinfra.com/", - nairobinet: "https://nairobinet.ecadinfra.com/", ghostnet: "https://ghostnet.ecadinfra.com/", - ithacanet: "https://ithacanet.ecadinfra.com/", + oxfordnet: "https://oxfordnet.ecadinfra.com/", + nairobinet: "https://nairobinet.ecadinfra.com/", mainnet: "https://mainnet.ecadinfra.com", //"https://mainnet-tezos.giganode.io" custom: "https://ghostnet.ecadinfra.com/" }; @@ -14,10 +13,9 @@ export const defaultMatrixNode = "beacon-node-1.sky.papers.tech"; export const defaultNetworkType = NetworkType.GHOSTNET; export const contractAddress = { - mainnet: "KT1ShtH2zCrKMuWGRejEd6RAcnePwxBQeMAN", - ithacanet: "KT1QKmcNBcfzVTXG2kBcE6XqXtEuYYUzMcT5", ghostnet: "KT1QKmcNBcfzVTXG2kBcE6XqXtEuYYUzMcT5", + oxfordnet: "KT1A2o9bDfzfmZW9npuWD5UtjUTqqZwDf24x", + nairobinet: "KT1WoyF3wpUGRm6fbmmm1qKmpfneq1iijMT8", + mainnet: "KT1ShtH2zCrKMuWGRejEd6RAcnePwxBQeMAN", custom: "KT1T2gL26SwYMxpkR5SZT1pHRBF84knfw8Cg", - mumbainet: "KT1Tkm7U3NS9JWgeCGywrRTSQdLZJvDSgD5Z", - nairobinet: "KT1Tkm7U3NS9JWgeCGywrRTSQdLZJvDSgD5Z" // TODO: originate the contract and update this. }; diff --git a/cspell.json b/cspell.json index 1ed410f95f..8ba11d35e3 100644 --- a/cspell.json +++ b/cspell.json @@ -12,6 +12,7 @@ "Bjorsell", "Boissonneault", "camelcase", + "cooldown", "crios", "dailynet", "delphinet", @@ -51,10 +52,15 @@ "nairobibox", "nairobinet", "octez", + "oxfordbox", + "oxfordnet", "oxheadalpha", + "preattestation", "precommit", + "preendorsement", "println", "Protofire", + "Proxford", "PtNairobi", "rollups", "Roxane", @@ -69,6 +75,7 @@ "tezbridge", "tezos", "ticketer", + "timelock", "toolbelt", "TORU", "typecheck", diff --git a/docs/consensus_key.md b/docs/consensus_key.md index 7b9b84b478..49d4314ea2 100644 --- a/docs/consensus_key.md +++ b/docs/consensus_key.md @@ -3,7 +3,7 @@ title: Consensus Keys author: Davis Sawali & Hui-An Yang --- -The "consensus key" feature allows bakers to use a different key, called the consensus key. It will allow for baking and signing consensus operations (i.e. pre-endorsements and endorsements). For more detailed information on consensus keys, refer to [this documentation](https://tezos.gitlab.io/protocols/015_lima.html?highlight=update%20consensus%20key#consensus-key) +The "consensus key" feature allows bakers to use a different key, called the consensus key. It will allow for baking and signing consensus operations (i.e. pre-endorsements/pre-attestation and endorsements/attestation). For more detailed information on consensus keys, refer to [this documentation](https://tezos.gitlab.io/protocols/015_lima.html?highlight=update%20consensus%20key#consensus-key) Starting from Lima protocol, these 2 new operations will be available: diff --git a/docs/inmemory_signer.md b/docs/inmemory_signer.md index a80abd8cd5..d7ac5f9d62 100644 --- a/docs/inmemory_signer.md +++ b/docs/inmemory_signer.md @@ -41,7 +41,7 @@ The `fromSecretKey` method takes a secret that is base58 encoded as a parameter. ```js live noInline // import { TezosToolkit } from '@taquito/taquito' // import { InMemorySigner } from '@taquito/signer' -// const Tezos = new TezosToolkit('https://nairobinet.ecadinfra.com'); +// const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com'); InMemorySigner.fromSecretKey('edsk2rKA8YEExg9Zo2qNPiQnnYheF1DhqjLVmfKdxiFfu5GyGRZRnb') .then((theSigner) => { @@ -58,7 +58,7 @@ InMemorySigner.fromSecretKey('edsk2rKA8YEExg9Zo2qNPiQnnYheF1DhqjLVmfKdxiFfu5GyGR ```js live noInline // import { TezosToolkit } from '@taquito/taquito' // import { InMemorySigner } from '@taquito/signer' -// const Tezos = new TezosToolkit('https://nairobinet.ecadinfra.com'); +// const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com'); InMemorySigner.fromSecretKey('spsk2Fiz7sGP5fNMJrokp6ynTa4bcFbsRhw58FHXbNf5ProDNFJ5Xq') .then((theSigner) => { @@ -78,7 +78,7 @@ When required, Taquito offers the `b58cencode` function allowing to encode the s // import { b58cencode, prefix, Prefix } from '@taquito/utils'; // import { TezosToolkit } from '@taquito/taquito' // import { InMemorySigner } from '@taquito/signer' -// const Tezos = new TezosToolkit('https://nairobinet.ecadinfra.com'); +// const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com'); const b58encodedSecret = b58cencode( '7c842c15c8b0c8fd228e6cb5302a50201f41642dd36b699003fb3c857920bc9d', @@ -119,7 +119,7 @@ Here are three examples with encrypted private keys where the passphrase used is ```js live noInline // import { TezosToolkit } from '@taquito/taquito' // import { InMemorySigner } from '@taquito/signer' -// const Tezos = new TezosToolkit('https://nairobinet.ecadinfra.com'); +// const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com'); InMemorySigner.fromSecretKey( 'edesk1GXwWmGjXiLHBKxGBxwmNvG21vKBh6FBxc4CyJ8adQQE2avP5vBB57ZUZ93Anm7i4k8RmsHaPzVAvpnHkFF', @@ -139,7 +139,7 @@ InMemorySigner.fromSecretKey( ```js live noInline // import { TezosToolkit } from '@taquito/taquito' // import { InMemorySigner } from '@taquito/signer' -// const Tezos = new TezosToolkit('https://nairobinet.ecadinfra.com'); +// const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com'); InMemorySigner.fromSecretKey( 'spesk24UQkAiJk8X6AufNtRv1WWPp2BAssEgmijCTQPMgUXweSKPmLdbyAjPmCG1pR2dC9P5UZZVeZcb7zVodUHZ', @@ -159,7 +159,7 @@ InMemorySigner.fromSecretKey( ```js live noInline // import { TezosToolkit } from '@taquito/taquito' // import { InMemorySigner } from '@taquito/signer' -// const Tezos = new TezosToolkit('https://nairobinet.ecadinfra.com'); +// const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com'); InMemorySigner.fromSecretKey( 'p2esk28hoUE2J88QNFj2aDX2pjzL7wcVh2g8tkEwtWWguby9M3FHUgSbzvF2Sd7wQ4Kd8crFwvto6gF3otcBuo4T', @@ -188,15 +188,15 @@ With ed25519 default derivation path (Reminder Must be hardened with either h or ```js live noInline // import { TezosToolkit } from '@taquito/taquito // import { InMemorySigner } from '@taquito/signer' - // const Tezos = new TezosToolkit('https://nairobinet.ecadinfra.com'); - - // ed25519 must have all hardened paths - + // const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com'); + + // ed25519 must have all hardened paths + // using all default values password = '' curve = 'ed25519' and derivationPath "44'/1729'/0'/0'" const params = { mnemonic: 'author crumble medal dose ribbon permit ankle sport final hood shadow vessel horn hawk enter zebra prefer devote captain during fly found despair business' } - + const signer = InMemorySigner.fromMnemonic(params); Tezos.setSignerProvider(signer) @@ -212,7 +212,7 @@ With a non-default derivation path non-hardened with a tz2 address ```js live noInline // import { TezosToolkit } from '@taquito/taquito // import { InMemorySigner } from '@taquito/signer' - // const Tezos = new TezosToolkit('https://nairobinet.ecadinfra.com'); + // const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com'); const params = { mnemonic: 'author crumble medal dose ribbon permit ankle sport final hood shadow vessel horn hawk enter zebra prefer devote captain during fly found despair business', diff --git a/docs/maps_bigmaps.md b/docs/maps_bigmaps.md index 034134ded3..461a08ede9 100644 --- a/docs/maps_bigmaps.md +++ b/docs/maps_bigmaps.md @@ -28,7 +28,7 @@ Michelson offers two variants of `Maps` that are semantically the same but have This example builds on the Ligo Lang Taco Shop learning resources. -The storage of the contract used in the following example is a map where a key is a natural number (a `nat`), and a value is a pair composed of two values representing the quantity of stock and `tez` tokens, respectively. The contract's source code is available [here](https://ligolang.org/docs/tutorials/get-started/tezos-taco-shop-smart-contract#making-sure-we-get-paid-for-our-tacos). In the example, the contract is originated with initial values using the `MichelsonMap` class' `set` method. +The storage of the contract used in the following example is a map where the key is a natural number (nat), and the value is a pair composed of two values representing the quantity of stock and `tez` tokens, respectively. The contract code is available [here](https://ligolang.org/docs/tutorials/get-started/tezos-taco-shop-smart-contract#making-sure-we-get-paid-for-our-tacos). In the example, the contract is originated with initial values using the `MichelsonMap` class' `set` method. -| Provider | Details | -|------------------|------------------------------------------------------------------------| -| MIDL.dev | https://midl.dev/tezos-rpc/ | +| Provider | Details | +|------------------|-----------------------------------| +| MIDL.dev | https://midl.dev/tezos-rpc/ | | TezTools.io | https://t.me/teztools (Telegram) | -| Exaion | https://node.exaion.com | +| Exaion | https://node.exaion.com | *If you are aware of a private node missing from our list or our information is inaccurate, please help us by submitting an issue or pull request on our GitHub page.* diff --git a/docs/rpc_nodes_integration_test.md b/docs/rpc_nodes_integration_test.md index edc77b8312..1d8720d699 100644 --- a/docs/rpc_nodes_integration_test.md +++ b/docs/rpc_nodes_integration_test.md @@ -5,77 +5,109 @@ author: Roxane Letourneau ## Steps to run the tests -1. The RPC nodes' integration tests are disabled by default. +1. The RPC nodes' integration tests are disabled by default. Remove `./rpc-nodes.spec.ts` from `"testPathIgnorePatterns"` in the package.json. - **nairobinet**: `npm run test:nairobinet rpc-nodes.spec.ts` + **oxfordnet**: `npm run test:oxfordnet rpc-nodes.spec.ts` **When all endpoints are accessible for a node, you will obtain:** ``` Test calling all methods from RPC node: https://a-node - ✓ Get the head block hash (1376 ms) - ✓ List the ancestors of the head block (1010 ms) - ✓ Access the balance of an address (1024 ms) - ✓ Access the data of a contract (1022 ms) - ✓ Access the code and data of a contract (1096 ms) - ✓ Access the complete status of a contract (1057 ms) - ✓ Access the manager key of a contract (1023 ms) - ✓ Access the delegate of a contract (1023 ms) - ✓ Access the value associated with a key in a big map (3927 ms) - ✓ Fetches information about a delegate from RPC (1590 ms) - ✓ Get all constants from RPC (938 ms) - ✓ Get all the information about a block (1021 ms) - ✓ Get the whole block header (1125 ms) - ✓ Get all the metadata associated to the block (918 ms) - ✓ Retrieves the list of delegates allowed to bake a block (912 ms) - ✓ Retrieves the list of delegates allowed to endorse a block (971 ms) - ✓ Get ballots casted so far during a voting period (1059 ms) - ✓ Get sum of ballots casted so far during a voting period (904 ms) - ✓ Get current period kind (907 ms) - ✓ Get current proposal under evaluation (986 ms) - ✓ Get current expected quorum (920 ms) - ✓ List of delegates with their voting weight, in number of rolls (923 ms) - ✓ List of proposals with number of supporters (1023 ms) - ✓ Forge an operation returning the unsigned bytes (1026 ms) - ✓ Inject an operation in node and broadcast it (1127 ms) - ✓ Simulate the validation of an operation (1022 ms) - ✓ Get the list of entrypoints of the contract (1023 ms) - ✓ Get chain ID (896 ms) - ✓ Run an operation without signature checks (948 ms) + ✓ Verify that rpcClient.getBlockHash returns the head block hash (64 ms) + ✓ Verify that rpcClient.getLiveBlocks returns the ancestors of the head block (85 ms) + ✓ Verify that rpcClient.getBalance returns the spendable balance of knownBaker, excluding frozen bonds (74 ms) + ✓ Verify that rpcClient.getStorage returns the storage data of knowContract (67 ms) + ✓ Verify that rpcClient.getScript returns the script data of knownContract (88 ms) + ✓ Verify that rpcClient.getNormalizedScript returns the script of the knownContract and normalize it using the requested unparsing mode (56 ms) + ✓ Verify that rpcClient.getContract returns the complete status of knownContract (66 ms) + ✓ Verify that rpcClient.getManagerKey returns the manager key of the knownBaker (76 ms) + ✓ Verify that rpcClient.getDelegate returns the delegate of the knownBaker (54 ms) + ✓ Verify that rpcClient.getBigMapExpr(deprecated) returns the value associated with encoded expression in a big map (330 ms) + ✓ Verify that rpcClient.getDelegates returns everything about a delegate (71 ms) + ✓ verify that rpcClient.getVotingInfo returns the knownBaker voting power found in the listings of the current voting period (57 ms) + ✓ Verify that rpcClient.getConstants returns all constants from RPC (65 ms) + ✓ Verify that rpcClient.getBlock returns all the information about a block (82 ms) + ✓ Verify that rpcClient.getBlockHeader returns the whole block header (68 ms) + ✓ Verify that rpcClient.getBlockMetadata returns all metadata associated to the block (71 ms) + ✓ Verify that rpcClient.getBakingRights retrieves the list of delegates allowed to bake a block (53 ms) + ✓ Verify that rpcClient.getAttestationRights(deprecated) retrieves the list of delegates allowed to attest a block (70 ms) + ✓ Verify that rpcClient.getEndorsingRights(deprecated) retrieves the list of delegates allowed to endorse a block (68 ms) + ✓ Verify that rpcClient.getBallotList returns ballots casted so far during a voting period (51 ms) + ✓ Verify that rpcClient.getBallots returns sum of ballots casted so far during a voting period (66 ms) + ✓ Verify that rpcClient.getCurrentPeriod returns current period kind (61 ms) + ✓ Verify that rpcClient.getCurrentProposal returns current proposal under evaluation (71 ms) + ✓ Verify that rpcClient.getCurrentQuorum returns current expected quorum (57 ms) + ✓ Verify that rpcClient.getVotesListings returns list of delegates with their voting weight, in number of rolls (58 ms) + ✓ Verify that rpcClient.getProposals returns list of proposals with number of supporters (65 ms) + ✓ Verify that rpcClient.forgeOperations forges an operation and returns the unsigned bytes (84 ms) + ✓ Verify that rpcClient.injectOperation injects an operation in node and broadcast it (50 ms) + ✓ Verify that rpcClient.preapplyOperations simulates the validation of an operation (260 ms) + ✓ Verify that rpcClient.getEntrypoints for known contract returns list of entrypoints of the contract (57 ms) + ✓ Verify that rpcClient.getChainId returns chain ID (55 ms) + ✓ Verify that rpcClient.runOperation runs an operation without signature checks (60 ms) + ✓ Verify that rpcClient.simulateOperation simulates an operation without signature checks (62 ms) + ✓ Verify that rpcClient.runView executes tzip4 views (108 ms) + ✓ Verify that rpcClient.runScriptView executes michelson view (118 ms) + ✓ Verify that rpcClient.getSuccessorPeriod will get the voting period of next block (53 ms) + ✓ Verify that rpcClient.getSaplingDiffById will access the value associated with a sapling state ID (109 ms) + ✓ Verify that rpcClient.getSaplingDiffByContract will access the value associated with a sapling state (57 ms) + ✓ Verify that rpcClient.getProtocols will list past and present Tezos protocols (58 ms) + ✓ Verify that rpcClient.getStorageUsedSpace will retrieve the used space of a contract storage (55 ms) + ✓ Verify that rpcClient.getStoragePaidSpace will retrieve the paid space of a contract storage (63 ms) + ✓ Verify that rpcClient.ticketBalance will retrieve the specified ticket owned by the given contract (55 ms) + ✓ Verify that rpcClient.allTicketBalances will retrieve all tickets owned by the given contract (55 ms) + ✓ Verify that rpcClient.getPendingOperations version1 will retrieve the pending operations in mempool with property applied (1221 ms) + ✓ Verify that rpcClient.getPendingOperations version2 will retrieve the pending operations in mempool with property validated (892 ms) ``` -**Otherwise, you will see which endpoints do not work for a specific node:** +**Otherwise, you will see which endpoints do not work for a specific node:** ``` Test calling all methods from RPC node: https://another-node - ✓ Get the head block hash (888 ms) - ✓ List the ancestors of the head block (782 ms) - ✓ Access the balance of an address (779 ms) - ✓ Access the data of a contract (636 ms) - ✓ Access the code and data of a contract (801 ms) - ✓ Access the complete status of a contract (638 ms) - ✓ Access the manager key of a contract (771 ms) - ✓ Access the delegate of a contract (682 ms) - ✓ Access the value associated with a key in a big map (4200 ms) - ✓ Fetches information about a delegate from RPC (739 ms) - ✓ Get all constants from RPC (633 ms) - ✓ Get all the information about a block (673 ms) - ✓ Get the whole block header (648 ms) - ✓ Get all the metadata associated to the block (646 ms) - ✓ Retrieves the list of delegates allowed to bake a block (814 ms) - ✓ Retrieves the list of delegates allowed to endorse a block (649 ms) - ✕ Get ballots casted so far during a voting period (634 ms) - ✕ Get sum of ballots casted so far during a voting period (707 ms) - ✕ Get current period kind (766 ms) - ✕ Get current proposal under evaluation (654 ms) - ✕ Get current expected quorum (639 ms) - ✕ List of delegates with their voting weight, in number of rolls (630 ms) - ✕ List of proposals with number of supporters (699 ms) - ✓ Forge an operation returning the unsigned bytes (641 ms) - ✓ Inject an operation in node and broadcast it (655 ms) - ✓ Simulate the validation of an operation (653 ms) - ✓ Get the list of entrypoints of the contract (625 ms) - ✓ Get chain ID (636 ms) - ✓ Run an operation without signature checks (626 ms) + ✓ Verify that rpcClient.getBlockHash returns the head block hash (64 ms) + ✓ Verify that rpcClient.getLiveBlocks returns the ancestors of the head block (85 ms) + ✓ Verify that rpcClient.getBalance returns the spendable balance of knownBaker, excluding frozen bonds (74 ms) + ✓ Verify that rpcClient.getStorage returns the storage data of knowContract (67 ms) + ✓ Verify that rpcClient.getScript returns the script data of knownContract (88 ms) + ✓ Verify that rpcClient.getNormalizedScript returns the script of the knownContract and normalize it using the requested unparsing mode (56 ms) + ✓ Verify that rpcClient.getContract returns the complete status of knownContract (66 ms) + ✓ Verify that rpcClient.getManagerKey returns the manager key of the knownBaker (76 ms) + ✓ Verify that rpcClient.getDelegate returns the delegate of the knownBaker (54 ms) + ✓ Verify that rpcClient.getBigMapExpr(deprecated) returns the value associated with encoded expression in a big map (330 ms) + ✓ Verify that rpcClient.getDelegates returns everything about a delegate (71 ms) + ✓ verify that rpcClient.getVotingInfo returns the knownBaker voting power found in the listings of the current voting period (57 ms) + ✓ Verify that rpcClient.getConstants returns all constants from RPC (65 ms) + ✓ Verify that rpcClient.getBlock returns all the information about a block (82 ms) + ✓ Verify that rpcClient.getBlockHeader returns the whole block header (68 ms) + ✓ Verify that rpcClient.getBlockMetadata returns all metadata associated to the block (71 ms) + ✓ Verify that rpcClient.getBakingRights retrieves the list of delegates allowed to bake a block (53 ms) + ✓ Verify that rpcClient.getAttestationRights(deprecated) retrieves the list of delegates allowed to attest a block (70 ms) + ✓ Verify that rpcClient.getEndorsingRights(deprecated) retrieves the list of delegates allowed to endorse a block (68 ms) + ✓ Verify that rpcClient.getBallotList returns ballots casted so far during a voting period (51 ms) + ✓ Verify that rpcClient.getBallots returns sum of ballots casted so far during a voting period (66 ms) + ✓ Verify that rpcClient.getCurrentPeriod returns current period kind (61 ms) + ✓ Verify that rpcClient.getCurrentProposal returns current proposal under evaluation (71 ms) + ✓ Verify that rpcClient.getCurrentQuorum returns current expected quorum (57 ms) + ✓ Verify that rpcClient.getVotesListings returns list of delegates with their voting weight, in number of rolls (58 ms) + ✓ Verify that rpcClient.getProposals returns list of proposals with number of supporters (65 ms) + ✓ Verify that rpcClient.forgeOperations forges an operation and returns the unsigned bytes (84 ms) + ✓ Verify that rpcClient.injectOperation injects an operation in node and broadcast it (50 ms) + ✓ Verify that rpcClient.preapplyOperations simulates the validation of an operation (260 ms) + ✓ Verify that rpcClient.getEntrypoints for known contract returns list of entrypoints of the contract (57 ms) + ✓ Verify that rpcClient.getChainId returns chain ID (55 ms) + ✓ Verify that rpcClient.runOperation runs an operation without signature checks (60 ms) + ✓ Verify that rpcClient.simulateOperation simulates an operation without signature checks (62 ms) + ✓ Verify that rpcClient.runView executes tzip4 views (108 ms) + ✓ Verify that rpcClient.runScriptView executes michelson view (118 ms) + ✓ Verify that rpcClient.getSuccessorPeriod will get the voting period of next block (53 ms) + ✓ Verify that rpcClient.getSaplingDiffById will access the value associated with a sapling state ID (109 ms) + ✓ Verify that rpcClient.getSaplingDiffByContract will access the value associated with a sapling state (57 ms) + ✓ Verify that rpcClient.getProtocols will list past and present Tezos protocols (58 ms) + ✓ Verify that rpcClient.getStorageUsedSpace will retrieve the used space of a contract storage (55 ms) + ✓ Verify that rpcClient.getStoragePaidSpace will retrieve the paid space of a contract storage (63 ms) + ✓ Verify that rpcClient.ticketBalance will retrieve the specified ticket owned by the given contract (55 ms) + ✓ Verify that rpcClient.allTicketBalances will retrieve all tickets owned by the given contract (55 ms) + ✓ Verify that rpcClient.getPendingOperations version1 will retrieve the pending operations in mempool with property applied (1221 ms) + ✓ Verify that rpcClient.getPendingOperations version2 will retrieve the pending operations in mempool with property validated (892 ms) ``` \ No newline at end of file diff --git a/docs/rpc_package.md b/docs/rpc_package.md index fdab4086d4..4cf27205f7 100644 --- a/docs/rpc_package.md +++ b/docs/rpc_package.md @@ -96,7 +96,7 @@ const packedData = await client.packData({ data: { string: 'test' }, type: { pri console.log('-- Packed data:', packedData); ``` -You can simulate the `PACK` instruction from Michelson with the `packData` method. +You can simulate the `PACK` instruction from Michelson with the `packData` method. This function will execute Tzip4 views normally referred to as 'Lambda Views'. You can learn more about Tzip4 [here](https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-4/tzip-4.md#view-entrypoints) ```js @@ -111,16 +111,6 @@ const view = await client.runView({ }); ``` -You can obtain the `Origination Proof` for the `smart_rollup_originate` batch operation (not needed for the `smart_rollup_originate` alone) - -This function will obtain the proof needed for the `smart_rollup_originate` batch method -```js -const originationProof = await client.getOriginationProof({ - kernel: 'your kernel', - kind: 'PVM kind' -}) -``` - ## Full documentation diff --git a/docs/smart_rollups.md b/docs/smart_rollups.md index efb75fd3dd..4fb49f43da 100644 --- a/docs/smart_rollups.md +++ b/docs/smart_rollups.md @@ -1,13 +1,13 @@ --- title: Smart Rollups -author: Davis Sawali +author: Davis Sawali --- # Smart Optimistic Rollups Rollups are a permissionless scaling implementation for the Tezos blockchain. The idea is that anyone can originate and operate one or more rollups, increasing the overall throughput of the Tezos blockchain. -In Taquito, we have implemented some of the operations included in Mumbai protocol update in regards to smart rollups. In this document, we will go through the operations we support. We also won't go too detailed on how rollups work behind the scenes, if you'd like to understand the feature a bit deeper, you can refer to [this document](https://tezos.gitlab.io/mumbai/smart_rollups.html). +In Taquito, we have implemented some smart rollup operations first introduced in Mumbai protocol. In this document, we will go through the operations we support. We also won't go too detailed on how rollups work behind the scenes, if you'd like to understand the feature a bit deeper, you can refer to [this document](https://tezos.gitlab.io/oxford/smart_rollups.html). ## `smart_rollup_originate` @@ -27,11 +27,10 @@ await op.confirmation(); ##### please note - `pvmKind` at this time the only PVM supported is `wasm_2_0_0` -- `kernel` is passed as a hexadecimal string examples can be found at [this tezos docs endpoint](https://tezos.gitlab.io/mumbai/smart_rollups.html?highlight=smart%20rollup%20originate#id1) -- `parametersType` is a MichelsonV1Expression to define the type. -- **Please note** `originationProof` is needed origination in `batch` which can be obtained with the `rpc.getOriginationProof({kernel, kind: PVMKind})` +- `kernel` is passed as a hexadecimal string examples can be found at [this tezos docs endpoint](https://tezos.gitlab.io/oxford/smart_rollups.html?highlight=smart%20rollup%20originate#id1) +- `parametersType` is a MichelsonV1Expression to define the type. -For more information in regards to Smart Rollup Origination please refer to the this [link](https://tezos.gitlab.io/mumbai/smart_rollups.html?highlight=smart%20rollup%20originate#id1) +For more information in regards to Smart Rollup Origination please refer to the this [link](https://tezos.gitlab.io/oxford/smart_rollups.html?highlight=smart%20rollup%20originate#id1) ## `smart_rollup_add_messages` @@ -43,15 +42,15 @@ The main use case of sending messages, is usually to denote contract calls. Thes MESSAGE='[{\ "destination" : "${CONTRACT}", \ "parameters" : "\"Hello world\"", \ - "entrypoint" : "default" + "entrypoint" : "default" }]' -``` +``` If you read closely, the message includes a `destination`, a `parameter`, and an `entrypoint` property. All components needed to **call an entrypoint** of a contract. These messages can then be claimed back into L1 as a legitimate contract call using the `smart_rollup_execute_outbox_message` operation which we will go over in another section of this doc. -for more information, refer to [this document](https://tezos.gitlab.io/mumbai/smart_rollups.html#sending-an-external-inbox-message) +for more information, refer to [this document](https://tezos.gitlab.io/oxford/smart_rollups.html#sending-an-external-inbox-message) ### Example ```typescript @@ -64,4 +63,4 @@ const op = await Tezos.contract.smartRollupAddMessages({ await op.confirmation(); ``` -- `message` property receives an array of encoded outbox messages. For more information on how to encode or what message gets encoded, refer to [this document](https://tezos.gitlab.io/mumbai/smart_rollups.html#sending-an-external-inbox-message) +- `message` property receives an array of encoded outbox messages. For more information on how to encode or what message gets encoded, refer to [this document](https://tezos.gitlab.io/oxford/smart_rollups.html#sending-an-external-inbox-message) diff --git a/docs/smartcontracts.md b/docs/smartcontracts.md index 572d0cfe9f..915b3a45e4 100644 --- a/docs/smartcontracts.md +++ b/docs/smartcontracts.md @@ -58,7 +58,7 @@ const main = ([action, store] : [parameter, storage]) : return_ => { You can view this contract and deploy it to a testnet using the [Ligo WebIDE][2] -### Counter Contract Michelson source code +### Counter Contract Michelson code ``` { parameter (or (or (int %decrement) (int %increment)) (unit %reset)) ; diff --git a/docs/tx_rollups.md b/docs/tx_rollups.md deleted file mode 100644 index 82c737ce9c..0000000000 --- a/docs/tx_rollups.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Transaction Optimistic Rollups -id: tx_rollups -author: Davis Sawali ---- - -A Transaction Optimistic Rollup (TORU) is an experimental temporary scaling solution to help Tezos developers and users get acquainted with the idea of working with rollups. - -This is a trimmed, more concise documentation of how to do TORU operations in Taquito. If you aren't yet familiar with rollup node interactions, please refer to this [documentation](https://tezos.gitlab.io/alpha/transaction_rollups.html?highlight=transaction%20rollups#transaction-rollups) by Nomadic Labs. - -TORU currently supports the transferring of funds in the form of [tickets](https://tezostaquito.io/docs/tickets). Fund (or ticket) transfers can be done from: -- Layer-1 to layer 2 (deposit) -- Layer-2 to layer 2 (transfer) -- Layer-2 to layer-1 (withdrawal) - -Taquito currently supports **layer-1** operations that facilitate deposits and withdrawals to and from the rollup node. - -## Deposits -To be able to interact or transfer funds on layer-2, you will first need to deposit an amount to an existing layer-2 (tz4) address. - -Depositing tickets from layer-1 to layer-2 can be done via a smart contract that facilitates the transfer to a tz4 address in a specified rollup node. - -An example of such contract can be found [here](https://tezos.gitlab.io/alpha/transaction_rollups.html?highlight=transaction%20rollups#depositing-assets-on-a-rollup) - -Assuming the contract has been originated, interacting with the contract in Taquito would look something like this: -```javascript -const Tezos = new TezosToolkit('https://jakartanet.ecadinfra.com'); - -const deposit = Tezos.contract.at(SMART_CONTRACT_ADDRESS); - -const op = await deposit.methods.default( - 'foobar', - '15', - 'tz4Jxn8MpRndqWUzkuZbQKmE3aNWJzYsSEso', - 'txr1c9XcfmiLSWeqDPamPytns2ZXvwgYA7EpA' -); - -const confirmation = await op.confirmation(); - -console.log(op.hash); -console.log(op.operationResults); -``` -The `default` entrypoint takes in 4 arguments: -- `foobar` is the ticket string -- `15` is the quantity of a ticket string -- `tz4Jxn8MpRndqWUzkuZbQKmE3aNWJzYsSEso` is the layer-2 address that will be the deposit recipient -- `txr1c9XcfmiLSWeqDPamPytns2ZXvwgYA7EpA` is the rollup node id - -If the deposit is successful, you will be returned an operation hash that can be accessed via `op.hash` - -You also might want to look at `op.operationResults` to retrieve the `ticket_hash`. A ticket hash should look something like this: `exprtz9FgfdzufUADVsvP8Gj8d8PZr9RsBEjZ5GQKM8Kp5cKWww7di` - -## Transfer -The exchange of assets in the form of tickets can be done from a layer-2 (`tz4`) address to another layer-2 address. Not to be confused with the `transfer_ticket` operation, this layer-2 operation will not be supported in Taquito. This may change in the future with SCORU (Smart Contract Optimistic Rollups). - -For instructions on how to conduct a transfer in layer-2 using the rollup client, refer to this [documentation](https://tezos.gitlab.io/alpha/transaction_rollups.html?highlight=transaction%20rollups#exchanging-assets-inside-a-rollup) by Nomadic Labs. - -## Withdrawal -A withdrawal of assets from layer-2 back to layer-1 can be done in several steps. - -The first step is to perform a `withdraw` in layer-2 to a layer-1 address in the rollup client. -``` -tezos-tx-rollup-client-alpha withdraw ${qty} of ${ticket_hash} from ${l2_src} to ${l1_dst} -``` - -- `${qty}` is the quantity of a ticket string that you would like to withdraw -- `${ticket_hash}` is the ticket hash that was returned by a deposit -- `${l2_src}` is the BLS pair of keys generated with `tezos-client bls gen key`; or in other words, the tz4 address that holds the tickets -- `${l1_dst}` is the layer-1 address you would like to withdraw the tickets to - -After a successful withdrawal, your assets will exist back in layer-1 in the form of tickets after the [finality period](#Glossary) ends. - -:::warning -Please note that this first step is a layer-2 operation which Taquito does not currently support. -::: - - - -The second step is to use a Tezos operation that will transfer these tickets to a smart contract. You can use your own contracts to process the tickets as you'd like (e.g. allow access to XTZ existing in the tickets, etc). - -This second step is called a `Transfer Ticket` operation, which Taquito supports. - -``` -const Tezos = new TezosToolkit('https://jakartanet.ecadinfra.com'); - -const op = await Tezos.contract.transferTicket({ - ticketContents: { "string": "foobar" }, - ticketTy: { "prim": "string" } , - ticketTicketer: 'KT1AL8we1Bfajn2M7i3gQM5PJEuyD36sXaYb', - ticketAmount: 5, - destination: KT1SUT2TBFPCknkBxLqM5eJZKoYVY6mB26Fg, - entrypoint: 'default', -}); -``` -- `ticket_amount` is the amount that you would like to transfer to the smart contract -- `destination` is the address of the smart contract you would like to transfer the tickets to -- `entrypoint` is the entrypoint of the destination smart contract -- `ticket_contents`, `ticket_ty`, and `ticket_ticketer` can be retrieved from running this command using the rollup client (see [documentation](https://tezos.gitlab.io/alpha/transaction_rollups.html?highlight=transaction%20rollups#exchanging-assets-inside-a-rollup)) -``` -tezos-tx-rollup-client-alpha rpc get "/context/head/tickets/${ticket_hash}" -``` - -## Glossary -- `Layer-1` refers to our main protocol networks related to on-chain transactions -- `Layer-2` refers to rollup nodes deployed by any individual/group to receive transactions off-chain -- `TORU` is short for Transactional Optimistic Rollup; the experimental, temporary introduction for rollup nodes -- `SCORU` is short for Smart Contract Optimistic Rollup; the more 'permanent' solution that has yet to be be released -- `Finality Period` refers to the number of blocks needed for the chain to finalize transactions on a rollup node (40,000 blocks on mainnet and testnets, 10 blocks on Mondaynet and Dailynet for ease of testing and demo purposes). See [documentation](https://tezos.gitlab.io/alpha/transaction_rollups.html?highlight=transaction%20rollups#commitments-and-rejections). diff --git a/docs/wallet_API.md b/docs/wallet_API.md index bac206731b..af868d9e96 100644 --- a/docs/wallet_API.md +++ b/docs/wallet_API.md @@ -161,7 +161,7 @@ const wallet = new TempleWallet('MyAwesomeDapp'); The class constructor takes one parameter, the name of your dapp (this will be used later in the transaction confirmation pop-up). After the instantiation, we can connect the wallet by calling the `connect` method: ```js -await wallet.connect('mainnet' | 'mumbainet' | 'nairobinet' | 'ghostnet' | 'mondaynet' | 'sandbox'); +await wallet.connect('mainnet' | 'oxfordnet' | 'nairobinet' | 'ghostnet' | 'mondaynet' | 'sandbox'); ``` (Temple used to be called Thanos and some Taquito code still uses the name Thanos.) diff --git a/example/example-streamer-custom-retry-logic.ts b/example/example-streamer-custom-retry-logic.ts index 7009bcd7a5..4dd6b0a41e 100644 --- a/example/example-streamer-custom-retry-logic.ts +++ b/example/example-streamer-custom-retry-logic.ts @@ -20,6 +20,10 @@ async function example() { ) as any })); + const bakeAttestationFilter = { + and: [{ source: 'tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m' }, { kind: 'attestation' }] + } + const bakerEndorsementFilter = { and: [{ source: 'tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m' }, { kind: 'endorsement' }] } @@ -29,7 +33,7 @@ async function example() { } tezos.stream.subscribeOperation({ - or: [bakerEndorsementFilter, bakerDelegation] + or: [bakeAttestationFilter, bakerEndorsementFilter, bakerDelegation] }) } diff --git a/example/example-streamer.ts b/example/example-streamer.ts index 9653adad81..91d61bee55 100644 --- a/example/example-streamer.ts +++ b/example/example-streamer.ts @@ -6,6 +6,10 @@ async function example() { tezos.setStreamProvider(tezos.getFactory(PollingSubscribeProvider)({ shouldObservableSubscriptionRetry: true, pollingIntervalMilliseconds: 15000 })); try { + const bakerAttestationFilter = { + and: [{ source: 'tz1bQMn5xYFbX6geRxqvuAiTywsCtNywawxH' }, { kind: 'attestation' }] + } + const bakerEndorsementFilter = { and: [{ source: 'tz1bQMn5xYFbX6geRxqvuAiTywsCtNywawxH' }, { kind: 'endorsement' }] } @@ -15,7 +19,7 @@ async function example() { } const sub = tezos.stream.subscribeOperation({ - or: [bakerEndorsementFilter, bakerDelegation] + or: [bakerAttestationFilter, bakerEndorsementFilter, bakerDelegation] }) sub.on('data', console.log) diff --git a/example/package.json b/example/package.json index 64aa223229..d8ace890ff 100644 --- a/example/package.json +++ b/example/package.json @@ -1,7 +1,7 @@ { "name": "@taquito/example", "private": true, - "version": "17.3.1", + "version": "18.0.0-RC.0", "scripts": { "example": "node -r ts-node/register --preserve-symlinks example-node.ts", "example:activation": "node -r ts-node/register --preserve-symlinks example-activate.ts", @@ -41,16 +41,16 @@ }, "dependencies": { "@ledgerhq/hw-transport-node-hid": "^6.27.3", - "@taquito/ledger-signer": "^17.3.1", - "@taquito/local-forging": "^17.3.1", - "@taquito/michel-codec": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/sapling": "^17.3.1", - "@taquito/signer": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/tzip16": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/ledger-signer": "^18.0.0-RC.0", + "@taquito/local-forging": "^18.0.0-RC.0", + "@taquito/michel-codec": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/sapling": "^18.0.0-RC.0", + "@taquito/signer": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/tzip16": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0" }, "devDependencies": { diff --git a/integration-tests/README.md b/integration-tests/README.md index e6667b784f..52b08ddb00 100644 --- a/integration-tests/README.md +++ b/integration-tests/README.md @@ -1,12 +1,12 @@ # Taquito Integration Tests -The `taquito/integration-tests` directory contains the integration test suite for Taquito. These tests are executed against live Tezos testnets, ensuring a comprehensive evaluation of various Taquito use cases. +The `taquito/integration-tests` directory contains the integration test suite for Taquito. These tests are executed against live Tezos testnets, ensuring a comprehensive evaluation of various Taquito use cases. The tests may also be run using Flextesa. This is useful for testing new features not in current test nets and for testing features around governance that benefit from shortened block processing times. As well Flextesa tests offer a secondary confirmation of the test net results. -Internally Taquito is tested with tests running in parallel. This is achieved using an application that generates new keys and funds them as needed per test. -The application is not publicly available. External users, therefore, must run the Taquito Integration Tests in sequence, one test at a time. +Internally Taquito is tested with tests running in parallel. This is achieved using an application that generates new keys and funds them as needed per test. +The application is not publicly available. External users, therefore, must run the Taquito Integration Tests in sequence, one test at a time. ## Running Integration Tests Against a Tezos Testnet @@ -37,7 +37,7 @@ Depending on the current Tezos upgrade cycle, multiple testnet networks may be c ``` -NAIROBINET=true npm run test +OXFORDNET=true npm run test ``` ## Configuration @@ -52,7 +52,7 @@ If different testnets are configured in the `config.ts` file, you can run tests ``` -npm run test:nairobinet contract-with-bigmap-init.spec.ts +npm run test:oxfordnet contract-with-bigmap-init.spec.ts ``` @@ -60,7 +60,7 @@ Or for a specific test within a test file: ``` -npm run test:nairobinet -- -t "Verify contract.originate for a contract and call deposit method with unit param" +npm run test:oxfordnet -- -t "Verify contract.originate for a contract and call deposit method with unit param" ``` @@ -70,7 +70,7 @@ npm run test:nairobinet -- -t "Verify contract.originate for a contract and call To run tests against a node that is not pre-configured in Taquito, use: -`export TEZOS_RPC_NAIROBINET='http://localhost:8732'`. +`export TEZOS_RPC_OXFORDNET='http://localhost:8732'`. ## Using a Secret Key Instead of the Keygen API @@ -79,7 +79,7 @@ By default, the integration tests use an ephemeral key managed by the Keygen API ``` -npm run test:nairobinet-secret-key contract-with-bigmap-init.spec.ts +npm run test:oxfordnet-secret-key contract-with-bigmap-init.spec.ts ``` @@ -126,31 +126,31 @@ from the top level. This will export the following environment variables: ```sh -RUN_NAIROBINET_WITH_SECRET_KEY=true +RUN_OXFORDNET_WITH_SECRET_KEY=true SECRET_KEY=edsk3RFgDiCt7tWB2oe96w1eRw72iYiiqZPLu9nnEY23MYRp2d8Kkx -TEZOS_RPC_NAIROBINET=http://localhost:20000 +TEZOS_RPC_OXFORDNET=http://localhost:20000 POLLING_INTERVAL_MILLISECONDS=100 RPC_CACHE_MILLISECONDS=0 TEZOS_BAKER=tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb ``` -### 2. Start a Flextesa sandbox to run a local Nairobi testnet +### 2. Start a Flextesa sandbox to run a local Oxford testnet Start the docker container, which encapsulates the flextesa_sandbox: ```sh -docker run --rm --name flextesa_sandbox --detach -p 20000:20000 oxheadalpha/flextesa:latest nairobibox start +docker run --rm --name flextesa_sandbox --detach -p 20000:20000 oxheadalpha/flextesa:latest oxfordbox start ``` -The default block time is 5 seconds. If we want to simulate Nairobi block times, we could use +The default block time is 5 seconds. If we want to simulate Oxford block times, we could use ```sh -docker run --rm --name flextesa_sandbox --detach -e block_time=8 -p 20000:20000 oxheadalpha/flextesa:latest nairobibox start +docker run --rm --name flextesa_sandbox --detach -e block_time=8 -p 20000:20000 oxheadalpha/flextesa:latest oxfordbox start ``` @@ -164,21 +164,23 @@ Flextesa is the "Flexible Tezos Sandbox" and effectively enables you to run a lo *Note: It is no longer necessary to `cd` into the `integration-tests/` directory* -To run the integration tests, use the command `npm run integration-tests`. The integration test suite will execute all tests against the current Tezos protocol (Nairobi) sandbox and typically also against the previous and next protocol testnets. You can find specific test targets in the `scripts` property in the `integration-tests/package.json` file. +To run the integration tests, use the command `npm run integration-tests`. The integration test suite will execute all tests against the current Tezos protocol (Oxford) sandbox and typically also against the previous and next protocol testnets. You can find specific test targets in the `scripts` property in the `integration-tests/package.json` file. -Remember that the first time you run the integration tests, `docker` will download the required image, which might take some time. +Remember that the first time you run the integration tests, `docker` will download the required image, which might take some time. -Before running the tests, make sure the file `~/taquito/integration-tests/known-contracts-PtNairobi.ts` includes the following: +Before running the tests, make sure the file `~/taquito/integration-tests/known-contracts-PtOxfordS.ts` includes the following: ```bash -export const knownContractPtNairobi = "KT1GrzF7DSNc7LrLmS7RNaLrBQqyYHyoMzwR"; -export const knownBigMapContractPtNairobi = "KT1Twd6GBBqHEFhzvBDEn4JiUopttq2WjdnF"; -export const knownTzip12BigMapOffChainContractPtNairobi = "KT1WZUqEKZ4TMW75FKpqod4HwB4ts7wbnsFh"; -export const knownSaplingContractPtNairobi = "KT1VNnD8NWx9ep2gxsHbzrmahrWsKpZb3xGY"; -export const knownOnChainViewContractAddressPtNairobi = "KT19eNryXTuVgH6s6cUc1a5LyjSamdBw4JXo"; +export const knownContractsProxfordS: KnownContracts = { + contract: "KT1TU9LydXWri8CBTQmzwnwjCm3dK8jt1LQA", + bigMapContract: "KT1MYLamQavaVMYqgn9f4gMgHzEZfQD73qYs", + tzip12BigMapOffChainContract: "KT1XX1JK4C7aPL2joE7nfeWRwPdrJYwroAUa", + saplingContract: "KT1MfFxdU3kpXMSmHZN4tYBbYkGRAbLt5Q1Y", + onChainViewContractAddress: "KT1TYMtN2yFQDmk82VFymQeZapp6BF1NsZ7B" +}; ``` @@ -197,7 +199,7 @@ When running Flextesa tests, you must pass the Jest config `--runInBand`, as the ```bash -npm -w integration-tests run test:originate-known-contracts && npm -w integration-tests run test:nairobinet-secret-key --runInBand +npm -w integration-tests run test:originate-known-contracts && npm -w integration-tests run test:oxfordnet-secret-key --runInBand ``` @@ -205,7 +207,7 @@ If you're running the tests for a second time in the same session, you don't nee ```bash -npm -w --runInBand integration-tests run test:nairobinet-secret-key +npm -w --runInBand integration-tests run test:oxfordnet-secret-key ``` @@ -213,7 +215,7 @@ Some tests might fail due to test data discrepancies, such as changes in RPC end ```bash -npm -w integration-tests run test:nairobinet-secret-key -- --runInBand --testPathIgnorePatterns='ledger-signer-failing-tests.spec.ts|ledger-signer.spec.ts|contract-estimation-tests.spec.ts|rpc-get-protocol-constants.spec.ts|' +npm -w integration-tests run test:oxfordnet-secret-key -- --runInBand --testPathIgnorePatterns='ledger-signer-failing-tests.spec.ts|ledger-signer.spec.ts|contract-estimation-tests.spec.ts|rpc-get-protocol-constants.spec.ts|' ``` @@ -221,7 +223,7 @@ You can also avoid slow-running tests. For example, if you want not to run the ` ```bash -npm -w integration-tests run test:nairobinet-secret-key -- --runInBand --testPathIgnorePatterns='ledger-signer-failing-tests.spec.ts|ledger-signer.spec.ts|contract-estimation-tests.spec.ts|rpc-get-protocol-constants.spec.ts|sapling-batched-transactions.spec.ts| sapling-transactions-contract-with-multiple-sapling-states.spec.ts|sapling-transactions-contract-with-single-state.spec.ts|sapling-transactions-proof-using-proving-key.spec.ts' +npm -w integration-tests run test:oxfordnet-secret-key -- --runInBand --testPathIgnorePatterns='ledger-signer-failing-tests.spec.ts|ledger-signer.spec.ts|contract-estimation-tests.spec.ts|rpc-get-protocol-constants.spec.ts|sapling-batched-transactions.spec.ts| sapling-transactions-contract-with-multiple-sapling-states.spec.ts|sapling-transactions-contract-with-single-state.spec.ts|sapling-transactions-proof-using-proving-key.spec.ts' ``` @@ -231,25 +233,25 @@ Upon successfully starting the tests with contract origination, you should see t ```bash integration-tests@16.1.2 test:originate-known-contracts node -r ts-node/register originate-known-contracts.ts -PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf -knownContract address: KT1CX4Qbkfy4N9fgRD5L7RPZW9ByydfKxh5t -::set-output name=knownContractAddress::KT1CX4Qbkfy4N9fgRD5L7RPZW9Byv2ycodEBUxHWoRkWHFBht -knownBigMapContract address: KT1NN9wjEDzrpcXynvA1L97Y5JCT7ebyjPNj -::set-output name=knownBigMapContractAddress::KT1NN9wjEDzrpcXynvA1L97Y5JCT7ebyjPNj -knownTzip12BigMapOffChainContract address: KT1UXPQiyHR4AesmD4QYefprVXH21JrGefnQ -::set-output name=knownTzip12BigMapOffChainContractAddress::KT1UXPQiyHR4AesmD4QYefprVXH21JrGefnQ -knownSaplingContract address: KT1Hkdt7v2ycodEBUxHWoRkWHFBhtutgmVDU -::set-output name=knownSaplingContractAddress::KT1Hkdt7v2ycodEBUxHWoRkWHFBhtutgmVDU -knownOnChainViewContractAddress address: KT1JirmFdgjttrm6wgwRxFGfwrP3twT5Y7CT -::set-output name=knownOnChainViewContractAddressAddress::KT1JirmFdgjttrm6wgwRxFGfwrP3twT5Y7CT +ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8 +knownContract address: KT1TU9LydXWri8CBTQmzwnwjCm3dK8jt1LQA +::set-output name=knownContractAddress::KT1TU9LydXWri8CBTQmzwnwjCm3dK8jt1LQA +knownBigMapContract address: KT1MYLamQavaVMYqgn9f4gMgHzEZfQD73qYs +::set-output name=knownBigMapContractAddress::KT1MYLamQavaVMYqgn9f4gMgHzEZfQD73qYs +knownTzip12BigMapOffChainContract address: KT1XX1JK4C7aPL2joE7nfeWRwPdrJYwroAUa +::set-output name=knownTzip12BigMapOffChainContractAddress::KT1XX1JK4C7aPL2joE7nfeWRwPdrJYwroAUa +knownSaplingContract address: KT1MfFxdU3kpXMSmHZN4tYBbYkGRAbLt5Q1Y +::set-output name=knownSaplingContractAddress::KT1MfFxdU3kpXMSmHZN4tYBbYkGRAbLt5Q1Y +knownOnChainViewContractAddress address: KT1TYMtN2yFQDmk82VFymQeZapp6BF1NsZ7B +::set-output name=knownOnChainViewContractAddressAddress::KT1TYMtN2yFQDmk82VFymQeZapp6BF1NsZ7B Public Key Hash : tz1YPSCGWXwBdTncK2aCctSZAXWvGsGwVJqU Initial Balance : 90856887.13687 XTZ Final Balance : 90856909.589235 XTZ Total XTZ Spent : -22.452365 XTZ -> integration-tests@16.1.2 test:nairobinet-secret-key -> RUN_NAIROBINET_WITH_SECRET_KEY=true jest --runInBand +> integration-tests@16.1.2 test:oxfordnet-secret-key +> RUN_OXFORDNET_WITH_SECRET_KEY=true jest --runInBand RUNS ./contract-manager-scenario.spec.ts PASS ./contract-manager-scenario.spec.ts (6.167 s) ``` @@ -258,12 +260,12 @@ PASS ./contract-manager-scenario.spec.ts (6.167 s) We provide a shell script `integration-tests/sandbox-bakers.sh` for setting up and running a mini net of bakers with Flextesa. The default values for the sandbox include - - blocks_per_voting_period=12 - - extra_dummy_proposals_batch_size=2 - - extra_dummy_proposals_batch_level=2,4 + - blocks_per_voting_period=12 + - extra_dummy_proposals_batch_size=2 + - extra_dummy_proposals_batch_level=2,4 - number_of_bootstrap_accounts=2 -Before running the script, make sure the file `~/taquito/integration-tests/known-contracts-PtNairobi.ts` is populated. Stop the `baking-sandbox` docker process before running the script again. +Before running the script, make sure the file `~/taquito/integration-tests/known-contracts-ProxfordS.ts` is populated. Stop the `baking-sandbox` docker process before running the script again. To run this script, save it as `integration-tests/sandbox-bakers.sh` and execute it with the required arguments: @@ -273,7 +275,7 @@ chmod +x sandbox-bakers.sh ``` for example, ```bash -./sandbox-bakers.sh oxheadalpha/flextesa:20230313 Nairobi nairobinet NAIROBINET +./sandbox-bakers.sh oxheadalpha/flextesa:20230313 Oxford oxfordnet OXFORDNET ``` Create an alias to make interacting with the flextesa node easier @@ -291,18 +293,18 @@ For baking, check for baking rights ```bash! tcli show address alice # get the pkh tcli rpc get /chains/main/blocks/head/metadata | jq .level_info,.protocol # get the cycle -tcli rpc get /chains/main/blocks/head/helpers/baking_rights\?cycle=\&delegate=\&max_round=7 +tcli rpc get /chains/main/blocks/head/helpers/baking_rights\?cycle=\&delegate=\&max_round=7 ``` Since the cycles fly by in this setup, check for rights a few cycles ahead .. -Then +Then ```bash! tcli bake for alice ``` You should see something like: ```bash! -May 11 20:14:39.014 - 017-PtNairobi.baker.transitions: received new head BLr6cAaj2oM2ibakFp8zZMNEbpcSAZ94WhzeV57njD7NrnaYrZU at -May 11 20:14:39.014 - 017-PtNairobi.baker.transitions: level 1152, round 0 +May 11 20:14:39.014 - 018-Proxford.baker.transitions: received new head BLr6cAaj2oM2ibakFp8zZMNEbpcSAZ94WhzeV57njD7NrnaYrZU at +May 11 20:14:39.014 - 018-Proxford.baker.transitions: level 1152, round 0 Block BLCjrRGMJxZEBoZaxafUHcTCNBnmGzRfX2Qf5qru2XtAhiNEsun (1153) injected ``` @@ -326,7 +328,7 @@ Keygen->>+Redis: Create lease entry in Redis (with expiry date) Keygen-->>+User: Return Ephemeral Key Lease ID User->>+User: Create a remote signer with Lease ID -loop +loop User->>+Keygen: Sign Operation Keygen->>+Redis: Retrieve private key to sign based on Lease ID Keygen->>+Keygen: Sign user data diff --git a/integration-tests/config.ts b/integration-tests/config.ts index 968c8413e2..eef522d134 100644 --- a/integration-tests/config.ts +++ b/integration-tests/config.ts @@ -8,6 +8,7 @@ import { KnownContracts } from './known-contracts'; import { knownContractsProtoALph } from './known-contracts-ProtoALph'; import { knownContractsPtGhostnet } from './known-contracts-PtGhostnet'; import { knownContractsPtNairobi } from './known-contracts-PtNairobi'; +import { knownContractsProxfordS } from './known-contracts-ProxfordS'; const nodeCrypto = require('crypto'); @@ -23,7 +24,7 @@ enum ForgerType { COMPOSITE = 'composite', } -export const isSandbox = (config: {rpc: string}) => { +export const isSandbox = (config: { rpc: string }) => { return config.rpc.includes('localhost') || config.rpc.includes('0.0.0.0') || config.rpc.includes('127.0.0.1'); } @@ -143,12 +144,24 @@ const nairobinetEphemeral: Config = }); const nairobinetSecretKey: Config = - { ...nairobinetEphemeral, ...{ signerConfig: defaultSecretKey }, ...{ defaultRpc: 'http://ecad-nairobinet-full:8732' } }; + { ...nairobinetEphemeral, ...{ signerConfig: defaultSecretKey }, ...{ defaultRpc: 'http://ecad-nairobinet-full:8732' } }; + +const oxfordnetEphemeral: Config = + defaultConfig({ + networkName: 'OXFORDNET', + protocol: Protocols.ProxfordS, + defaultRpc: 'http://ecad-oxfordnet-full.i.tez.ie:8732', + knownContracts: knownContractsProxfordS, + signerConfig: defaultEphemeralConfig('https://keygen.ecadinfra.com/oxfordnet') + }); + +const oxfordnetSecretKey: Config = + { ...oxfordnetEphemeral, ...{ signerConfig: defaultSecretKey } }; const ghostnetEphemeral: Config = defaultConfig({ networkName: 'GHOSTNET', - protocol: Protocols.PtMumbai2, + protocol: Protocols.PtNairobi, defaultRpc: 'http://ecad-ghostnet-rolling:8732', knownContracts: knownContractsPtGhostnet, signerConfig: defaultEphemeralConfig('https://keygen.ecadinfra.com/ghostnet') @@ -172,21 +185,25 @@ const mondaynetSecretKey: Config = const providers: Config[] = []; if (process.env['RUN_WITH_SECRET_KEY']) { - providers.push(nairobinetSecretKey); + providers.push(oxfordnetSecretKey); } else if (process.env['RUN_NAIROBINET_WITH_SECRET_KEY']) { providers.push(nairobinetSecretKey); +} else if (process.env['RUN_OXFORDNET_WITH_SECRET_KEY']) { + providers.push(oxfordnetSecretKey); } 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['NAIROBINET']) { providers.push(nairobinetEphemeral); +} else if (process.env['OXFORDNET']) { + providers.push(oxfordnetEphemeral); } else if (process.env['GHOSTNET']) { providers.push(ghostnetEphemeral); } else if (process.env['MONDAYNET']) { providers.push(mondaynetEphemeral); } else { - providers.push(nairobinetEphemeral); + providers.push(oxfordnetEphemeral); } const setupForger = (Tezos: TezosToolkit, forger: ForgerType): void => { @@ -248,13 +265,13 @@ const setupWithSecretKey = async (Tezos: TezosToolkit, signerConfig: SecretKeyCo }; const configurePollingInterval = (Tezos: TezosToolkit, pollingIntervalMilliseconds: string | undefined) => { - if(pollingIntervalMilliseconds) { + if (pollingIntervalMilliseconds) { Tezos.setStreamProvider(Tezos.getFactory(PollingSubscribeProvider)({ pollingIntervalMilliseconds: Number(pollingIntervalMilliseconds) })); } } const configureRpcCache = (rpc: string, rpcCacheMilliseconds: string) => { - if(rpcCacheMilliseconds === '0') { + if (rpcCacheMilliseconds === '0') { return new TezosToolkit(rpc); } else { return new TezosToolkit(new RpcClientCache(new RpcClient(rpc), Number(rpcCacheMilliseconds))); diff --git a/integration-tests/contract-batch-smart-rollup-originate.spec.ts b/integration-tests/contract-batch-smart-rollup-originate.spec.ts index 9fbb4b0685..3cdfbc2e14 100644 --- a/integration-tests/contract-batch-smart-rollup-originate.spec.ts +++ b/integration-tests/contract-batch-smart-rollup-originate.spec.ts @@ -13,14 +13,12 @@ CONFIGS().forEach(({ lib, rpc, setup }) => { it('should be able to batch smart rollup originate with other operations', async (done) => { const kernel = '23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a' - const originationProof = await Tezos.rpc.getOriginationProof({ kernel, kind: PvmKind.WASM2}) const batch = Tezos.contract .batch() .withSmartRollupOriginate({ pvmKind: PvmKind.WASM2, kernel, - originationProof, parametersType: { prim: 'bytes' }, }) .withOrigination({ diff --git a/integration-tests/contract-estimation-tests.spec.ts b/integration-tests/contract-estimation-tests.spec.ts index e9d5f58ece..0d9cc4e4bf 100644 --- a/integration-tests/contract-estimation-tests.spec.ts +++ b/integration-tests/contract-estimation-tests.spec.ts @@ -106,7 +106,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => { expect(estimate.minimalFeeMutez).toEqual(472); expect(estimate.totalCost).toEqual(472); expect(estimate.usingBaseFeeMutez).toEqual(472); - expect(estimate.consumedMilligas).toEqual(1356735); + expect(estimate.consumedMilligas).toEqual(1356465); done(); }); @@ -117,14 +117,14 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => { 50) ).toTransferParams(); const estimate = await LowAmountTez.estimate.transfer(tx); - expect(estimate.gasLimit).toEqual(1572); + expect(estimate.gasLimit).toEqual(1571); expect(estimate.storageLimit).toEqual(514); expect(estimate.suggestedFeeMutez).toEqual(643); expect(estimate.burnFeeMutez).toEqual(128500); expect(estimate.minimalFeeMutez).toEqual(543); expect(estimate.totalCost).toEqual(129043); expect(estimate.usingBaseFeeMutez).toEqual(543); - expect(estimate.consumedMilligas).toEqual(1471270); + expect(estimate.consumedMilligas).toEqual(1471000); done(); }); @@ -138,7 +138,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => { expect(estimate.minimalFeeMutez).toEqual(519); expect(estimate.totalCost).toEqual(79769); expect(estimate.usingBaseFeeMutez).toEqual(519); - expect(estimate.consumedMilligas).toEqual(1767848); + expect(estimate.consumedMilligas).toEqual(1767578); done(); }); @@ -152,7 +152,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => { expect(estimate.minimalFeeMutez).toEqual(637); expect(estimate.totalCost).toEqual(159137); expect(estimate.usingBaseFeeMutez).toEqual(637); - expect(estimate.consumedMilligas).toEqual(2293496); + expect(estimate.consumedMilligas).toEqual(2293226); // Do the actual operation const op2 = await contract.methods.do(originate2()).send(); await op2.confirmation(); diff --git a/integration-tests/contract-failing-noop.spec.ts b/integration-tests/contract-failing-noop.spec.ts index 6edb02da10..48a20d9c45 100644 --- a/integration-tests/contract-failing-noop.spec.ts +++ b/integration-tests/contract-failing-noop.spec.ts @@ -1,34 +1,32 @@ import { InMemorySigner } from "@taquito/signer"; import { CONFIGS, defaultSecretKey, isSandbox } from "./config"; -import { OpKind, Protocols, TezosToolkit } from "@taquito/taquito"; +import { OpKind, TezosToolkit } from "@taquito/taquito"; import { verifySignature } from "@taquito/utils"; -CONFIGS().forEach(({ rpc, setup, protocol}) => { +CONFIGS().forEach(({ setup, rpc, lib }) => { + const testnet = isSandbox({ rpc }) ? it.skip : it; + let Tezos: TezosToolkit + let signer = new InMemorySigner(defaultSecretKey.secret_key) - const Tezos = new TezosToolkit(rpc); - Tezos.setSignerProvider(new InMemorySigner(defaultSecretKey.secret_key)); - const nairobinet = !isSandbox({ rpc }) && protocol === Protocols.PtNairobi ? it : it.skip; - - describe(`Test failing_noop through contract api, based on head, and secret_key using: ${rpc}`, () => { - beforeEach(async (done) => { + describe(`Test failing_noop through contract api, based on head, and secret_key`, () => { + beforeAll(async (done) => { await setup(); + Tezos = new TezosToolkit('https://mainnet-archive.ecadinfra.com/'); + Tezos.setSignerProvider(signer); done(); }); - nairobinet('Verify that the contract.failingNoop result is as expected when the block and secret key are kept constant', async (done) => { + testnet('Verify that the contract.failingNoop result is as expected when the block and secret key are kept constant', async (done) => { const signed = await Tezos.contract.failingNoop({ arbitrary: "48656C6C6F20576F726C64", // Hello World basedOnBlock: 0, }); - // This test is skipped from flextesa because the genesis block hash is not guaranteed to stay the same - // The signature will change if the hash of the genesis block changes (maybe when switching to a testnet based on a new protocol). - // Also it depends on the signing key. - // So if any of them changes, the expected values need to be adjusted + expect(signed).toEqual({ - bytes: 'df2788eed43ab680c8a2b79969ce4de93b9768cd2786a85ebdfba90ca7612638110000000b48656c6c6f20576f726c64', - signature: 'spsig1QVVCiQ6aN2zmut2wKTg4zWLoP9ia4qUY2hBo21odA7P25gqfieFWJMyntaJWmyrd6v3mgjKF5n4d2wcaB3LxkLmd1MoJQ', + bytes: '8fcf233671b6a04fcf679d2a381c2544ea6c1ea29ba6157776ed8424c7ccd00b110000000b48656c6c6f20576f726c64', + signature: 'spsig1Q6oLPX3mTUpUJJAFKhFdvrc8HwNBABjFpKWLfs91uDtSsLLWgbSLZpZFA7BsTPabYxghXQkKx1ogDTRcRQoKYaFX6aGLt', signedContent: { - branch: 'BMQZWtQjSpyJZBVHbABEmVP9VG8yEZPZ3wNftwZdXt6A33ZYatj', + branch: 'BLockGenesisGenesisGenesisGenesisGenesisf79b5d1CoW2', contents: [{ kind: OpKind.FAILING_NOOP, arbitrary: '48656C6C6F20576F726C64' @@ -39,9 +37,11 @@ CONFIGS().forEach(({ rpc, setup, protocol}) => { }); }); - describe(`Test failing_noop through contract api using: ${rpc}`, () => { - beforeEach(async (done) => { + describe(`Test failing_noop through contract api using: ${rpc}`, () => { + beforeAll(async (done) => { await setup(); + Tezos = lib + Tezos.setSignerProvider(signer); done(); }); diff --git a/integration-tests/contract-smart-rollup-originate.spec.ts b/integration-tests/contract-smart-rollup-originate.spec.ts index 75a5660cd7..7b25b7f3d2 100644 --- a/integration-tests/contract-smart-rollup-originate.spec.ts +++ b/integration-tests/contract-smart-rollup-originate.spec.ts @@ -20,7 +20,6 @@ CONFIGS().forEach(({ lib, rpc, setup }) => { await op.confirmation(); expect(op.status).toEqual('applied'); - expect(op.originationProof).toBeDefined(); expect(op.kernel).toEqual('23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a'); done(); }); diff --git a/integration-tests/data/allTestsCases.ts b/integration-tests/data/allTestsCases.ts index 7fb8213441..87857f764e 100644 --- a/integration-tests/data/allTestsCases.ts +++ b/integration-tests/data/allTestsCases.ts @@ -22,6 +22,7 @@ import { codeViewsTopLevel, storageViewsTopLevel } from './contract_views_top_le import { MichelsonV1Expression, OpKind, PvmKind } from '@taquito/rpc'; import { emitCode } from './code_with_emit'; import { lambdaRecCode } from './code_with_lambda_rec'; +import { timelockCode, timelockStorage, timelockExpected } from './timelock-flip-contract'; function extractOp( startIndex: number, @@ -82,7 +83,7 @@ export const nairobiCases: TestCase[] = [ ], }, }, -]; +] export const commonCases: TestCase[] = [ { @@ -1171,21 +1172,6 @@ export const commonCases: TestCase[] = [ ], }, }, - { - name: 'Endorsement', - operation: { - branch: 'BLzyjjHKEKMULtvkpSHxuZxx6ei6fpntH2BTkYZiLgs8zLVstvX', - contents: [ - { - kind: OpKind.ENDORSEMENT, - slot: 0, - level: 66299, - round: 5, - block_payload_hash: 'vh3FEkypvxUYLwjGYd2Sme7aWyfX8npDsqxcL6imVpBWnAZeNn2n', - }, - ], - }, - }, { name: `Origination of a contract that contains the instructions SUB_MUTEZ`, operation: { @@ -1348,30 +1334,6 @@ export const commonCases: TestCase[] = [ ], }, }, - { - name: `Origination of a smart_rollup_originate operation`, - operation: { - branch: 'BLxGBu48ybnWvZoaVLyXV4XVnhdeDc9V2NcB9wsegQniza6mxvX', - contents: [ - { - kind: OpKind.SMART_ROLLUP_ORIGINATE, - source: 'tz1h5DrMhmdrGMpb3qkykU1RmCWoTYAkFJPu', - fee: '1496', - counter: '3969', - gas_limit: '2849', - storage_limit: '6572', - pvm_kind: PvmKind.WASM2, - kernel: - '23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a', - origination_proof: - '0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea18030fab8a3adde4b553c4d391e9cd19ee13b17941c1f49c040d621bbfbea964993810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9', - parameters_ty: { - prim: 'bytes', - }, - }, - ], - } - }, { name: `Origination of a smart_rollup_add_messages operation`, operation: { @@ -1425,3 +1387,82 @@ export const commonCases: TestCase[] = [ } } ]; + +export const oxfordCases: TestCase[] = [ + { + name: 'Attestation', + operation: { + branch: 'BLzyjjHKEKMULtvkpSHxuZxx6ei6fpntH2BTkYZiLgs8zLVstvX', + contents: [ + { + kind: OpKind.ATTESTATION, + slot: 0, + level: 66299, + round: 5, + block_payload_hash: 'vh3FEkypvxUYLwjGYd2Sme7aWyfX8npDsqxcL6imVpBWnAZeNn2n', + }, + ], + }, + }, + { + name: `Origination of a smart_rollup_originate operation`, + operation: { + branch: 'BLxGBu48ybnWvZoaVLyXV4XVnhdeDc9V2NcB9wsegQniza6mxvX', + contents: [ + { + kind: OpKind.SMART_ROLLUP_ORIGINATE, + source: 'tz1h5DrMhmdrGMpb3qkykU1RmCWoTYAkFJPu', + fee: '1496', + counter: '3969', + gas_limit: '2849', + storage_limit: '6572', + pvm_kind: PvmKind.WASM2, + kernel: + '23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a', + parameters_ty: { + prim: 'bytes', + }, + }, + ], + } + }, + { + name: 'Origination of a contract that contains the types chest, chest_key and the instruction OPEN_CHEST', + operation: { + branch: 'BMV9bffK5yjWCJgUJBsoTRifb4SsAYbkCVwVkKbJHffJYn7ePBL', + contents: [ + { + kind: OpKind.ORIGINATION, + counter: '1', + source: 'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn', + fee: '10000', + gas_limit: '10', + storage_limit: '10', + balance: '0', + script: { + code: timelockCode, + storage: timelockStorage, + }, + }, + ], + }, + expected: { + branch: 'BMV9bffK5yjWCJgUJBsoTRifb4SsAYbkCVwVkKbJHffJYn7ePBL', + contents: [ + { + kind: OpKind.ORIGINATION, + counter: '1', + source: 'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn', + fee: '10000', + gas_limit: '10', + storage_limit: '10', + balance: '0', + script: { + code: timelockExpected, + storage: timelockStorage, + }, + }, + ], + }, + } +] diff --git a/integration-tests/data/code_with_ticket_transfer.ts b/integration-tests/data/code_with_ticket_transfer.ts index 49ed36b2b2..47d2ad4268 100644 --- a/integration-tests/data/code_with_ticket_transfer.ts +++ b/integration-tests/data/code_with_ticket_transfer.ts @@ -1,5 +1,4 @@ -// https://gitlab.com/tezos/tezos/-/blob/master/tezt/tests/expected/tickets.ml/Mumbai-%20Send%20tickets%20between%20originated%20contracts%20and%20implicit%20accounts.out - +// https://gitlab.com/tezos/tezos/-/blob/master/tezt/tests/expected/tickets.ml/Alpha-%20Send%20tickets%20between%20originated%20contracts%20and%20implicit%20accounts.out export const ticketsSendTz = `{ parameter (pair address nat) ;storage unit ;code { CAR ; UNPAIR ; CONTRACT (ticket string) ; IF_NONE { PUSH string "Contract not found" ; FAILWITH } { PUSH mutez 0 ; DIG 2 ; PUSH string "Ticket" ; TICKET ; ASSERT_SOME ; TRANSFER_TOKENS ; PUSH unit Unit ; NIL operation ; DIG 2 ; CONS ; PAIR } } }` export const ticketsBagTz = `{ parameter (or (ticket %save string) (address %send)) ; storage (list (ticket string)) ; code { UNPAIR ; IF_LEFT { CONS ; NIL operation ; PAIR } { SWAP ; IF_CONS { DIG 2 ; CONTRACT %ticket (ticket string) ; ASSERT_SOME ; PUSH mutez 0 ; DIG 2 ; TRANSFER_TOKENS ; NIL operation ; SWAP ; CONS ; PAIR } { PUSH string "no ticket to send" ; FAILWITH } } } }` export const ticketsBlackholeTz = `{ parameter (ticket %ticket string) ; storage unit ; code { CDR ; NIL operation ; PAIR } }` diff --git a/integration-tests/data/contract-txr1-address.ts b/integration-tests/data/contract-txr1-address.ts deleted file mode 100644 index b8942c78cf..0000000000 --- a/integration-tests/data/contract-txr1-address.ts +++ /dev/null @@ -1,52 +0,0 @@ -export const contractWithTxr1Address = [{ - "prim": "parameter", - "args": [ - { - "prim": "or", - "args": [ - { - "prim": "map", - "args": [{ "prim": "address" }, { "prim": "int" }], - "annots": ["%setAddressMap"] - }, - { - "prim": "set", "args": [{ "prim": "address" }], - "annots": ["%setAddressSet"] - }] - } - ] -}, -{ - "prim": "storage", - "args": [ - { - "prim": "pair", - "args": - [{ - "prim": "map", - "args": [{ "prim": "address" }, { "prim": "int" }], - "annots": ["%addressMap"] - }, - { - "prim": "set", "args": [{ "prim": "address" }], - "annots": ["%addressSet"] - }] - } - ] -}, -{ - "prim": "code", - "args": [ - [{ "prim": "UNPAIR" }, - { - "prim": "IF_LEFT", - "args": - [[{ "prim": "SWAP" }, { "prim": "CDR" }, { "prim": "SWAP" }, - { "prim": "PAIR" }], - [{ "prim": "SWAP" }, { "prim": "CAR" }, { "prim": "PAIR" }]] - }, - { "prim": "NIL", "args": [{ "prim": "operation" }] }, - { "prim": "PAIR" }] - ] - -}] diff --git a/integration-tests/data/metadataViews.ts b/integration-tests/data/metadataViews.ts index c8a9c23e0c..b3fe89a501 100644 --- a/integration-tests/data/metadataViews.ts +++ b/integration-tests/data/metadataViews.ts @@ -42,8 +42,7 @@ export const metadataViewsExample1 = { michelsonStorageView: { returnType: { prim: 'bytes', - args: [], - annots: [ '%returnedBytes' ] + args: [] }, code: [ { @@ -66,12 +65,7 @@ export const metadataViewsExample1 = { annots: [] } ], - annotations: [ - { - name: '%returnedBytes', - description: 'A bytes constant.' - } - ] + annotations: [] } } ] @@ -83,8 +77,7 @@ export const metadataViewsExample1 = { michelsonStorageView: { returnType: { prim: 'bytes', - args: [], - annots: [ '%returnedBytes' ] + args: [] }, code: [ { @@ -108,12 +101,7 @@ export const metadataViewsExample1 = { annots: [] } ], - annotations: [ - { - name: '%returnedBytes', - description: 'A bytes constant.' - } - ] + annotations: [] } } ] @@ -126,7 +114,6 @@ export const metadataViewsExample1 = { returnType: { prim: 'bytes', args: [], - annots: [ '%returnedBytes' ] }, code: [ { @@ -150,12 +137,7 @@ export const metadataViewsExample1 = { annots: [] } ], - annotations: [ - { - name: '%returnedBytes', - description: 'A bytes constant.' - } - ] + annotations: [] } } ] @@ -168,7 +150,6 @@ export const metadataViewsExample1 = { returnType: { prim: 'bytes', args: [], - annots: [ '%returnedBytes' ] }, code: [ { @@ -192,12 +173,7 @@ export const metadataViewsExample1 = { annots: [] } ], - annotations: [ - { - name: '%returnedBytes', - description: 'A bytes constant.' - } - ] + annotations: [] } } ] @@ -210,7 +186,6 @@ export const metadataViewsExample1 = { returnType: { prim: 'bytes', args: [], - annots: [ '%returnedBytes' ] }, code: [ { @@ -234,12 +209,7 @@ export const metadataViewsExample1 = { annots: [] } ], - annotations: [ - { - name: '%returnedBytes', - description: 'A bytes constant.' - } - ] + annotations: [] } } ] @@ -276,7 +246,7 @@ export const metadataViewsExample2 = { { michelsonStorageView: { parameter: { prim: 'int', args: [], annots: [ '%the_decisive_argument' ] }, - returnType: { prim: 'int', args: [], annots: [ '%negative_even_number' ] }, + returnType: { prim: 'int', args: [] }, code: [ { prim: 'CAR', args: [], annots: [] }, { prim: 'DUP', args: [], annots: [] }, @@ -303,10 +273,6 @@ export const metadataViewsExample2 = { { name: '%the_decisive_argument', description: 'The integer argument if >0 this will fail.' - }, - { - name: '%negative_even_number', - description: 'The result, if any, is twice the argument (%the_decisive_argument).' } ] } @@ -602,18 +568,13 @@ export const metadataViewsExample2 = { implementations: [ { michelsonStorageView: { - returnType: { prim: 'address', args: [], annots: [ '%ret' ] }, + returnType: { prim: 'address', args: [] }, code: [ { prim: 'DROP', args: [], annots: [] }, { prim: 'SELF', args: [], annots: [] }, { prim: 'ADDRESS', args: [], annots: [] } ], - annotations: [ - { - name: '%ret', - description: 'The address of the (any) contract, re-obtained in Michelson.' - } - ] + annotations: [] } } ] diff --git a/integration-tests/data/timelock-flip-contract.ts b/integration-tests/data/timelock-flip-contract.ts new file mode 100644 index 0000000000..a1157f0ffd --- /dev/null +++ b/integration-tests/data/timelock-flip-contract.ts @@ -0,0 +1,854 @@ +// https://gitlab.com/tezos/tezos/-/blob/master/src/proto_alpha/lib_protocol/contracts/timelock_flip.tz?ref_type=heads + +export const timelockStorage = { + "prim": "Pair", + "args": [ + { + "int": "0" + }, + { + "prim": "Pair", + "args": [ + { + "bytes": "e0d984a0e19fd7e7a4ac90dc9bf7e59288e8d8b0a0ca8bf988cae8fa90dbc584c2ee91a1f5d1a1d8d695f58bd1c7b1e4c0b9f384918a89dfd4eff5c3fbaff7e5d68de19088c5fdc08286f18bc7d1c4f99590f3bfd881c68d97bf91d2d4d2ded688d993e59b8aac84b798eed496a1e2dff9cfc1e3c793a8eea1fbf3a8c6c895bb8d8dedded3ed80b4848cb9ddb0c2f1ea98b8a6c3b6c691f2e787afc9bc8dd386a4b08392bbb7c1b6cdbaa6ec98a1fc96ecb287d5f6e39892aea199f4bf91e89bb8e7b58dc4f5d5bfec88ba99d1efc7c98aabe6bebbeeb4b589a383a6f581e69edbe2a4e7db8cb7e4ab8390b6f7c4c6ba9ee7c1f8d7e0f2aba5bf97cdbb85ca8dd0f7dff8fd95a1a9a68dd3b283a5f9fc93a2e7acafc4cbbeb3b2f8fe8faf97c5d2fae681081fe2a28ce94b55c47fe6a2927dc36c403067a86e36a163000000001a7c31a45bcb9934e3089cbc023a0bebe815ee2f646a0d344469f7" + }, + { + "prim": "Pair", + "args": [ + { + "bytes": "01" + }, + { + "bytes": "01" + } + ] + } + ] + } + ] +} + +export const timelockCode = [ + { + "prim": "storage", + "args": [ + { + "prim": "pair", + "args": [ + { + "prim": "nat", + "annots": [ + "%level" + ] + }, + { + "prim": "chest" + }, + { + "prim": "bytes", + "annots": [ + "%guess" + ] + }, + { + "prim": "bytes", + "annots": [ + "%result" + ] + } + ] + } + ] + }, + { + "prim": "parameter", + "args": [ + { + "prim": "or", + "args": [ + { + "prim": "chest", + "annots": [ + "%initialize_game" + ] + }, + { + "prim": "or", + "args": [ + { + "prim": "bytes", + "annots": [ + "%guess" + ] + }, + { + "prim": "chest_key", + "annots": [ + "%finish_game" + ] + } + ] + } + ] + } + ] + }, + { + "prim": "code", + "args": [ + [ + { + "prim": "UNPAIR", + "args": [ + { + "int": "5" + } + ] + }, + { + "prim": "IF_LEFT", + "args": [ + [ + { + "prim": "DIP", + "args": [ + [ + { + "prim": "DROP", + "args": [ + { + "int": "4" + } + ] + } + ] + ] + }, + { + "prim": "PUSH", + "args": [ + { + "prim": "bytes" + }, + { + "bytes": "A0" + } + ] + }, + { + "prim": "DUP" + }, + { + "prim": "PAIR" + }, + { + "prim": "SWAP" + }, + { + "prim": "LEVEL" + }, + { + "prim": "PAIR", + "args": [ + { + "int": "3" + } + ] + } + ], + [ + { + "prim": "IF_LEFT", + "args": [ + [ + { + "prim": "SWAP" + }, + { + "prim": "DUP" + }, + { + "prim": "PUSH", + "args": [ + { + "prim": "nat" + }, + { + "int": "10" + } + ] + }, + { + "prim": "ADD" + }, + { + "prim": "LEVEL" + }, + { + "prim": "COMPARE" + }, + { + "prim": "LE" + }, + { + "prim": "IF", + "args": [ + [ + { + "prim": "DIP", + "args": [ + { + "int": "2" + }, + [ + { + "prim": "PUSH", + "args": [ + { + "prim": "bytes" + }, + { + "bytes": "B0" + } + ] + } + ] + ] + }, + { + "prim": "DIP", + "args": [ + [ + { + "prim": "PAIR" + }, + { + "prim": "SWAP" + }, + { + "prim": "PAIR" + } + ] + ] + }, + { + "prim": "PAIR" + }, + { + "prim": "DIP", + "args": [ + [ + { + "prim": "DROP", + "args": [ + { + "int": "2" + } + ] + } + ] + ] + } + ], + [ + { + "prim": "SWAP" + }, + { + "prim": "DROP" + }, + { + "prim": "PAIR", + "args": [ + { + "int": "4" + } + ] + } + ] + ] + } + ], + [ + { + "prim": "DIP", + "args": [ + { + "int": "4" + }, + [ + { + "prim": "DROP" + } + ] + ] + }, + { + "prim": "DUP", + "args": [ + { + "int": "3" + } + ] + }, + { + "prim": "SWAP" + }, + { + "prim": "DIP", + "args": [ + { + "int": "2" + }, + [ + { + "prim": "PUSH", + "args": [ + { + "prim": "nat" + }, + { + "int": "1024" + } + ] + } + ] + ] + }, + { + "prim": "OPEN_CHEST" + }, + [ + { + "prim": "IF_NONE", + "args": [ + [ + { + "prim": "PUSH", + "args": [ + { + "prim": "bytes" + }, + { + "bytes": "10" + } + ] + } + ], + [ + { + "prim": "DUP", + "args": [ + { + "int": "4" + } + ] + }, + { + "prim": "COMPARE" + }, + { + "prim": "EQ" + }, + { + "prim": "IF", + "args": [ + [ + { + "prim": "PUSH", + "args": [ + { + "prim": "bytes" + }, + { + "bytes": "00" + } + ] + } + ], + [ + { + "prim": "PUSH", + "args": [ + { + "prim": "bytes" + }, + { + "bytes": "01" + } + ] + } + ] + ] + } + ] + ] + } + ], + { + "prim": "DIG", + "args": [ + { + "int": "3" + } + ] + }, + { + "prim": "PAIR" + }, + { + "prim": "DIG", + "args": [ + { + "int": "2" + } + ] + }, + { + "prim": "PAIR" + }, + { + "prim": "DIG", + "args": [ + { + "int": "1" + } + ] + }, + { + "prim": "PAIR" + } + ] + ] + } + ] + ] + }, + { + "prim": "NIL", + "args": [ + { + "prim": "operation" + } + ] + }, + { + "prim": "PAIR" + } + ] + ] + } +] + +// parse bytes will be lowercased ref https://github.com/ecadlabs/taquito/pull/1623 +export const timelockExpected = [ + { + "prim": "storage", + "args": [ + { + "prim": "pair", + "args": [ + { + "prim": "nat", + "annots": [ + "%level" + ] + }, + { + "prim": "chest" + }, + { + "prim": "bytes", + "annots": [ + "%guess" + ] + }, + { + "prim": "bytes", + "annots": [ + "%result" + ] + } + ] + } + ] + }, + { + "prim": "parameter", + "args": [ + { + "prim": "or", + "args": [ + { + "prim": "chest", + "annots": [ + "%initialize_game" + ] + }, + { + "prim": "or", + "args": [ + { + "prim": "bytes", + "annots": [ + "%guess" + ] + }, + { + "prim": "chest_key", + "annots": [ + "%finish_game" + ] + } + ] + } + ] + } + ] + }, + { + "prim": "code", + "args": [ + [ + { + "prim": "UNPAIR", + "args": [ + { + "int": "5" + } + ] + }, + { + "prim": "IF_LEFT", + "args": [ + [ + { + "prim": "DIP", + "args": [ + [ + { + "prim": "DROP", + "args": [ + { + "int": "4" + } + ] + } + ] + ] + }, + { + "prim": "PUSH", + "args": [ + { + "prim": "bytes" + }, + { + "bytes": "a0" + } + ] + }, + { + "prim": "DUP" + }, + { + "prim": "PAIR" + }, + { + "prim": "SWAP" + }, + { + "prim": "LEVEL" + }, + { + "prim": "PAIR", + "args": [ + { + "int": "3" + } + ] + } + ], + [ + { + "prim": "IF_LEFT", + "args": [ + [ + { + "prim": "SWAP" + }, + { + "prim": "DUP" + }, + { + "prim": "PUSH", + "args": [ + { + "prim": "nat" + }, + { + "int": "10" + } + ] + }, + { + "prim": "ADD" + }, + { + "prim": "LEVEL" + }, + { + "prim": "COMPARE" + }, + { + "prim": "LE" + }, + { + "prim": "IF", + "args": [ + [ + { + "prim": "DIP", + "args": [ + { + "int": "2" + }, + [ + { + "prim": "PUSH", + "args": [ + { + "prim": "bytes" + }, + { + "bytes": "b0" + } + ] + } + ] + ] + }, + { + "prim": "DIP", + "args": [ + [ + { + "prim": "PAIR" + }, + { + "prim": "SWAP" + }, + { + "prim": "PAIR" + } + ] + ] + }, + { + "prim": "PAIR" + }, + { + "prim": "DIP", + "args": [ + [ + { + "prim": "DROP", + "args": [ + { + "int": "2" + } + ] + } + ] + ] + } + ], + [ + { + "prim": "SWAP" + }, + { + "prim": "DROP" + }, + { + "prim": "PAIR", + "args": [ + { + "int": "4" + } + ] + } + ] + ] + } + ], + [ + { + "prim": "DIP", + "args": [ + { + "int": "4" + }, + [ + { + "prim": "DROP" + } + ] + ] + }, + { + "prim": "DUP", + "args": [ + { + "int": "3" + } + ] + }, + { + "prim": "SWAP" + }, + { + "prim": "DIP", + "args": [ + { + "int": "2" + }, + [ + { + "prim": "PUSH", + "args": [ + { + "prim": "nat" + }, + { + "int": "1024" + } + ] + } + ] + ] + }, + { + "prim": "OPEN_CHEST" + }, + [ + { + "prim": "IF_NONE", + "args": [ + [ + { + "prim": "PUSH", + "args": [ + { + "prim": "bytes" + }, + { + "bytes": "10" + } + ] + } + ], + [ + { + "prim": "DUP", + "args": [ + { + "int": "4" + } + ] + }, + { + "prim": "COMPARE" + }, + { + "prim": "EQ" + }, + { + "prim": "IF", + "args": [ + [ + { + "prim": "PUSH", + "args": [ + { + "prim": "bytes" + }, + { + "bytes": "00" + } + ] + } + ], + [ + { + "prim": "PUSH", + "args": [ + { + "prim": "bytes" + }, + { + "bytes": "01" + } + ] + } + ] + ] + } + ] + ] + } + ], + { + "prim": "DIG", + "args": [ + { + "int": "3" + } + ] + }, + { + "prim": "PAIR" + }, + { + "prim": "DIG", + "args": [ + { + "int": "2" + } + ] + }, + { + "prim": "PAIR" + }, + { + "prim": "DIG", + "args": [ + { + "int": "1" + } + ] + }, + { + "prim": "PAIR" + } + ] + ] + } + ] + ] + }, + { + "prim": "NIL", + "args": [ + { + "prim": "operation" + } + ] + }, + { + "prim": "PAIR" + } + ] + ] + } +] \ No newline at end of file diff --git a/integration-tests/known-contracts-ProxfordS.ts b/integration-tests/known-contracts-ProxfordS.ts new file mode 100644 index 0000000000..ca2f4719ae --- /dev/null +++ b/integration-tests/known-contracts-ProxfordS.ts @@ -0,0 +1,8 @@ +import { KnownContracts } from './known-contracts'; +export const knownContractsProxfordS: KnownContracts = { + contract: "KT1TU9LydXWri8CBTQmzwnwjCm3dK8jt1LQA", + bigMapContract: "KT1MYLamQavaVMYqgn9f4gMgHzEZfQD73qYs", + tzip12BigMapOffChainContract: "KT1XX1JK4C7aPL2joE7nfeWRwPdrJYwroAUa", + saplingContract: "KT1MfFxdU3kpXMSmHZN4tYBbYkGRAbLt5Q1Y", + onChainViewContractAddress: "KT1TYMtN2yFQDmk82VFymQeZapp6BF1NsZ7B" +}; diff --git a/integration-tests/known-contracts-PtMumbai2.ts b/integration-tests/known-contracts-PtMumbai2.ts deleted file mode 100644 index 70b3d80206..0000000000 --- a/integration-tests/known-contracts-PtMumbai2.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { KnownContracts } from './known-contracts'; -export const knownContractsPtMumbai2: KnownContracts = { - contract: "KT1XFiUYC36XSeLTanGJwZxqLzsxz9zquLFB", - bigMapContract: "KT1KbbvszHoWVSS8Nzh9yLgvRBDkzVjKmCtj", - tzip12BigMapOffChainContract: "KT1KKU19PxFbQUT9sBJS8KwYCVaXAzYsTkUK", - saplingContract: "KT1UHkJDY1CWAgYZJR1NkxXv27gsuu7hC77R", - onChainViewContractAddress: "KT1JxWH1vtMiTcvg4AdhTaGmyHt2oBb71tzW" -}; diff --git a/integration-tests/local-forging.spec.ts b/integration-tests/local-forging.spec.ts index 72a7573cd5..facc34154e 100644 --- a/integration-tests/local-forging.spec.ts +++ b/integration-tests/local-forging.spec.ts @@ -1,16 +1,27 @@ import { CONFIGS } from "./config"; -import { commonCases, nairobiCases } from './data/allTestsCases'; +import { commonCases, nairobiCases, oxfordCases } from './data/allTestsCases'; import { LocalForger, ProtocolsHash } from '@taquito/local-forging' import { Protocols, TezosToolkit } from "@taquito/taquito"; CONFIGS().forEach(({ rpc, protocol }) => { const Tezos = new TezosToolkit(rpc); const nairobinet = protocol === Protocols.PtNairobi ? it : it.skip; + const oxfordnet = protocol === Protocols.ProxfordS ? it : it.skip; describe(`Test local forger: ${rpc}`, () => { - // all protocols nairobiCases.forEach(({ name, operation, expected }) => { - nairobinet(`Verify that .forge for local forge will return same result as for network forge for rpc: ${name} (${rpc})`, async done => { + // Oxford has removed to forge set and unset deposit limit ops in rpcForger. + // We removed them in localForger .forge, but keep the .parse logic for now. + nairobinet(`Verify that .parse for local forge will return same operation that rpc forge for rpc: ${name} (${rpc})`, async done => { + const localForger = new LocalForger(protocol as unknown as ProtocolsHash); + const rpcResult = await Tezos.rpc.forgeOperations(operation); + expect(await localForger.parse(rpcResult)).toEqual(expected || operation); + + done(); + }); + }); + oxfordCases.forEach(({ name, operation, expected }) => { + oxfordnet(`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); @@ -20,7 +31,7 @@ CONFIGS().forEach(({ rpc, protocol }) => { done(); }); }); - + // 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); diff --git a/integration-tests/package.json b/integration-tests/package.json index 9e360a5c16..bcbc40477d 100644 --- a/integration-tests/package.json +++ b/integration-tests/package.json @@ -4,32 +4,34 @@ "test:secret-key": "RUN_WITH_SECRET_KEY=true jest --runInBand", "test:nairobinet": "NAIROBINET=true jest", "test:nairobinet-secret-key": "RUN_NAIROBINET_WITH_SECRET_KEY=true jest --runInBand", + "test:oxfordnet": "OXFORDNET=true jest", + "test:oxfordnet-secret-key": "RUN_OXFORDNET_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", "test:mondaynet-secret-key": "RUN_MONDAYNET_WITH_SECRET_KEY=true jest --runInBand", "test": "jest" }, - "version": "17.3.1", + "version": "18.0.0-RC.0", "dependencies": { "@ledgerhq/devices": "6.20.0", "@ledgerhq/hw-transport": "6.28.8", "@ledgerhq/hw-transport-node-hid": "6.27.21", "@ledgerhq/hw-transport-node-hid-noevents": "6.27.19", - "@taquito/contracts-library": "^17.3.1", - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/local-forging": "^17.3.1", - "@taquito/michel-codec": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/remote-signer": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/sapling": "^17.3.1", - "@taquito/signer": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/tzip12": "^17.3.1", - "@taquito/tzip16": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/contracts-library": "^18.0.0-RC.0", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/local-forging": "^18.0.0-RC.0", + "@taquito/michel-codec": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/remote-signer": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/sapling": "^18.0.0-RC.0", + "@taquito/signer": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/tzip12": "^18.0.0-RC.0", + "@taquito/tzip16": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0", "bip39": "3.0.4", "blakejs": "^1.2.1" diff --git a/integration-tests/polling-subscribe-provider.spec.ts b/integration-tests/polling-subscribe-provider.spec.ts index ce32757a7a..e44313275e 100644 --- a/integration-tests/polling-subscribe-provider.spec.ts +++ b/integration-tests/polling-subscribe-provider.spec.ts @@ -4,7 +4,7 @@ import { localForger } from '@taquito/local-forging'; import { send } from 'process'; import { validateAddress } from '@taquito/utils'; -/* mainContract.jsligo: This is the source code for the main contract. +/* mainContract.jsligo: This is the code for the main contract. If you need to change the main contract, you can change this, use the ligo compiler to compile it, and update both the Michelson code below and the jsligo here. const _mainContractJsLigo = `type storage = int diff --git a/integration-tests/rpc-get-protocol-constants.spec.ts b/integration-tests/rpc-get-protocol-constants.spec.ts index c3d3daa09f..8cd29d71e5 100644 --- a/integration-tests/rpc-get-protocol-constants.spec.ts +++ b/integration-tests/rpc-get-protocol-constants.spec.ts @@ -10,12 +10,14 @@ import { ConstantsResponseProto015, ConstantsResponseProto016, ConstantsResponseProto017, + ConstantsResponseProto018, } from '@taquito/rpc'; CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => { const Tezos = lib; - const nairobinet = (networkType == NetworkType.TESTNET && protocol === Protocols.PtNairobi) ? test : test.skip; - const mondaynet = (networkType == NetworkType.TESTNET && protocol === Protocols.ProtoALpha) ? test : test.skip; + const oxfordnet = (networkType == NetworkType.TESTNET && protocol === Protocols.ProxfordS) ? test : test.skip; + const alpha = (networkType == NetworkType.TESTNET && protocol === Protocols.ProtoALpha) ? test : test.skip; + describe('Test fetching constants for all protocols on Mainnet', () => { const rpcUrl = 'https://mainnet-archive.ecadinfra.com/'; @@ -802,13 +804,8 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => { done(); }); - - }); - - describe(`Fetch constants for testnet`, () => { - nairobinet(`successfully fetches all constants for nairobinet using ${rpc}`, async (done) => { - Tezos.setRpcProvider(rpc); - const constants: ConstantsResponseProto017 = await Tezos.rpc.getConstants(); + it(`successfully fetches Proto17 constants at level 4178617`, async (done) => { + const constants: ConstantsResponseProto017 = await Tezos.rpc.getConstants({ block: '4178617' }); expect(constants).toEqual({ proof_of_work_nonce_size: 8, @@ -824,32 +821,32 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => { smart_rollup_max_wrapped_proof_binary_size: 30000, smart_rollup_message_size_limit: 4096, smart_rollup_max_number_of_messages_per_level: '1000000', - preserved_cycles: 3, - blocks_per_cycle: 8192, - blocks_per_commitment: 64, + preserved_cycles: 5, + blocks_per_cycle: 16384, + blocks_per_commitment: 128, nonce_revelation_threshold: 512, - blocks_per_stake_snapshot: 512, - cycles_per_voting_period: 1, + blocks_per_stake_snapshot: 1024, + cycles_per_voting_period: 5, hard_gas_limit_per_operation: new BigNumber(1040000), hard_gas_limit_per_block: new BigNumber(2600000), - proof_of_work_threshold: new BigNumber(-1), + proof_of_work_threshold: new BigNumber(281474976710655), minimal_stake: new BigNumber(6000000000), - vdf_difficulty: new BigNumber(10000000000), + vdf_difficulty: new BigNumber(8000000000), seed_nonce_revelation_tip: new BigNumber(125000), origination_size: 257, - baking_reward_fixed_portion: new BigNumber(2666666), - baking_reward_bonus_per_slot: new BigNumber(1143), - endorsing_reward_per_slot: new BigNumber(761), + baking_reward_fixed_portion: new BigNumber(5000000), + baking_reward_bonus_per_slot: new BigNumber(2143), + endorsing_reward_per_slot: new BigNumber(1428), 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_subsidy: new BigNumber(1250000), liquidity_baking_toggle_ema_threshold: 1000000000, max_operations_time_to_live: 240, - minimal_block_delay: new BigNumber(8), - delay_increment_per_round: new BigNumber(3), + minimal_block_delay: new BigNumber(15), + delay_increment_per_round: new BigNumber(8), consensus_committee_size: 7000, consensus_threshold: 4667, minimal_participation_ratio: { @@ -863,7 +860,6 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => { numerator: 1, denominator: 2 }, - testnet_dictator: 'tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8', cache_script_size: 100000000, cache_stake_distribution_cycles: 8, cache_sampler_state_cycles: 8, @@ -881,7 +877,7 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => { tx_rollup_cost_per_byte_ema_factor: 120, tx_rollup_max_ticket_payload_size: 2048, tx_rollup_rejection_max_proof_size: 30000, - tx_rollup_sunset_level: 10000000, + tx_rollup_sunset_level: 3473409, dal_parametric: { feature_enable: false, number_of_slots: 256, @@ -896,6 +892,103 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => { smart_rollup_enable: true, smart_rollup_arith_pvm_enable: false, smart_rollup_origination_size: 6314, + smart_rollup_challenge_window_in_blocks: 80640, + smart_rollup_stake_amount: '10000000000', + smart_rollup_commitment_period_in_blocks: 60, + smart_rollup_max_lookahead_in_blocks: 172800, + smart_rollup_max_active_outbox_levels: 80640, + smart_rollup_max_outbox_messages_per_level: 100, + smart_rollup_number_of_sections_in_dissection: 32, + smart_rollup_timeout_period_in_blocks: 40320, + smart_rollup_max_number_of_cemented_commitments: 5, + smart_rollup_max_number_of_parallel_games: 32, + zk_rollup_enable: false, + zk_rollup_origination_size: 4000, + zk_rollup_min_pending_to_process: 10 + }); + + done(); + }) + + }); + describe(`Fetch constants for testnet`, () => { + oxfordnet(`successfully fetches all constants for oxford using ${rpc}`, async (done) => { + Tezos.setRpcProvider(rpc); + const constants: ConstantsResponseProto018 = await Tezos.rpc.getConstants(); + + expect(constants).toEqual({ + proof_of_work_nonce_size: 8, + nonce_length: 32, + max_anon_ops_per_block: 132, + max_operation_data_length: 32768, + max_proposals_per_delegate: 20, + max_micheline_node_count: 50000, + max_micheline_bytes_limit: 50000, + max_allowed_global_constants_depth: 10000, + cache_layout_size: 3, + michelson_maximum_type_size: 2001, + smart_rollup_max_wrapped_proof_binary_size: 30000, + smart_rollup_message_size_limit: 4096, + smart_rollup_max_number_of_messages_per_level: '1000000', + preserved_cycles: 3, + blocks_per_cycle: 8192, + blocks_per_commitment: 64, + nonce_revelation_threshold: 512, + blocks_per_stake_snapshot: 512, + cycles_per_voting_period: 1, + hard_gas_limit_per_operation: new BigNumber(1040000), + hard_gas_limit_per_block: new BigNumber(2600000), + proof_of_work_threshold: new BigNumber(-1), + minimal_stake: new BigNumber(6000000000), + minimal_frozen_stake: '600000000', + vdf_difficulty: new BigNumber(10000000000), + origination_size: 257, + issuance_weights: { + base_total_issued_per_minute: '85007812', + baking_reward_fixed_portion_weight: 5120, + baking_reward_bonus_weight: 5120, + attesting_reward_weight: 10240, + liquidity_baking_subsidy_weight: 1280, + seed_nonce_revelation_tip_weight: 1, + vdf_revelation_tip_weight: 1, + }, + 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_toggle_ema_threshold: 1000000000, + max_operations_time_to_live: 240, + minimal_block_delay: new BigNumber(8), + delay_increment_per_round: new BigNumber(3), + consensus_committee_size: 7000, + consensus_threshold: 4667, + minimal_participation_ratio: { + numerator: 2, + denominator: 3 + }, + max_slashing_period: 2, + limit_of_delegation_over_baking: 9, + percentage_of_frozen_deposits_slashed_per_double_baking: 10, + percentage_of_frozen_deposits_slashed_per_double_attestation: 50, + testnet_dictator: "tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8", + cache_script_size: 100000000, + cache_stake_distribution_cycles: 8, + cache_sampler_state_cycles: 8, + dal_parametric: { + feature_enable: false, + number_of_slots: 256, + attestation_lag: 4, + attestation_threshold: 50, + blocks_per_epoch: 8, + redundancy_factor: 16, + page_size: 4096, + slot_size: 1048576, + number_of_shards: 2048 + }, + smart_rollup_enable: true, + smart_rollup_arith_pvm_enable: false, + smart_rollup_origination_size: 6314, smart_rollup_challenge_window_in_blocks: 40, smart_rollup_stake_amount: '10000000000', smart_rollup_commitment_period_in_blocks: 20, @@ -906,17 +999,50 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => { smart_rollup_timeout_period_in_blocks: 500, smart_rollup_max_number_of_cemented_commitments: 5, smart_rollup_max_number_of_parallel_games: 32, + smart_rollup_reveal_activation_level: { + dal_page: 2147483646, + metadata: 0, + raw_data: { + Blake2B: 0, + }, + }, zk_rollup_enable: false, zk_rollup_origination_size: 4000, - zk_rollup_min_pending_to_process: 10 + zk_rollup_min_pending_to_process: 10, + zk_rollup_max_ticket_payload_size: 2048, + global_limit_of_staking_over_baking: 5, + edge_of_staking_over_delegation: 2, + adaptive_issuance_launch_ema_threshold: 100000000, + adaptive_rewards_params: { + issuance_ratio_min: { + numerator: '1', + denominator: '2000' + }, + issuance_ratio_max: { + numerator: '1', + denominator: '20' + }, + max_bonus: '50000000000000', + growth_rate: '115740740', + center_dz: { + numerator: '1', + denominator: '2' + }, + radius_dz: { + numerator: '1', + denominator: '50' + } + } + + }); done(); }); - mondaynet(`successfully fetches all constants for mondaynet using ${rpc}`, async (done) => { + alpha(`successfully fetches all constants for mondaynet using ${rpc}`, async (done) => { Tezos.setRpcProvider(rpc); - const constants: ConstantsResponseProto016 = await Tezos.rpc.getConstants(); + const constants: ConstantsResponseProto017 = await Tezos.rpc.getConstants(); expect(constants).toEqual({ adaptive_issuance_launch_ema_threshold: 10000000, diff --git a/integration-tests/rpc-nodes.spec.ts b/integration-tests/rpc-nodes.spec.ts index a90cb9042d..3975629d65 100644 --- a/integration-tests/rpc-nodes.spec.ts +++ b/integration-tests/rpc-nodes.spec.ts @@ -1,6 +1,6 @@ -import { CONFIGS } from './config'; -import { DefaultContractType } from "@taquito/taquito"; -import { RpcClientCache, RpcClient, RPCRunViewParam, RPCRunScriptViewParam, PendingOperations, PvmKind } from '@taquito/rpc'; +import { CONFIGS, NetworkType } from './config'; +import { DefaultContractType, Protocols } from "@taquito/taquito"; +import { RpcClientCache, RpcClient, RPCRunViewParam, RPCRunScriptViewParam, PendingOperationsV1, PendingOperationsV2, PvmKind } from '@taquito/rpc'; import { encodeExpr } from '@taquito/utils'; import { Schema } from '@taquito/michelson-encoder'; import { tokenBigmapCode, tokenBigmapStorage } from './data/token_bigmap'; @@ -20,6 +20,7 @@ CONFIGS().forEach( }) => { const Tezos = lib; const unrestrictedRPCNode = rpc.endsWith("ecadinfra.com") ? test.skip : test; + const oxfordnetAndAlpha = protocol === Protocols.ProxfordS || protocol === Protocols.ProtoALpha ? test : test.skip; let ticketContract: DefaultContractType; @@ -52,61 +53,61 @@ CONFIGS().forEach( const rpcClient = new RpcClientCache(new RpcClient(rpc)); describe(`Test calling all methods from RPC node: ${rpc}`, () => { - it('Verify rpcClient.getBlockHash returns the head block hash', async (done) => { + it('Verify that rpcClient.getBlockHash returns the head block hash', async (done) => { const blockHash = await rpcClient.getBlockHash(); expect(blockHash).toBeDefined(); done(); }); - it('Verify rpcClient.getLiveBlocks returns the ancestors of the head block', async (done) => { + it('Verify that rpcClient.getLiveBlocks returns the ancestors of the head block', async (done) => { const liveBlocks = await rpcClient.getLiveBlocks(); expect(liveBlocks).toBeDefined(); done(); }); - it(`Verify rpcClient.getBalance for known baker returns the balance of the address`, async (done) => { + it(`Verify that rpcClient.getBalance returns the spendable balance of knownBaker, excluding frozen bonds`, async (done) => { const balance = await rpcClient.getBalance(knownBaker); expect(balance).toBeDefined(); done(); }); - it(`Verify that rpcClient.getStorage for know contract returns the data of a contract`, async (done) => { + it(`Verify that rpcClient.getStorage returns the storage data of knowContract`, async (done) => { const storage = await rpcClient.getStorage(knownContract); expect(storage).toBeDefined(); done(); }); - it(`Verify that rpcClient.getScript for know contract returns the code and data of a contract`, async (done) => { + it(`Verify that rpcClient.getScript returns the script data of knownContract`, async (done) => { const script = await rpcClient.getScript(knownContract); expect(script).toBeDefined(); done(); }); - it(`Verify that rpcClient.getNormalizedScript for known contract returns the script of the contract and normalize it using the requested unparsing mode`, async (done) => { + it(`Verify that rpcClient.getNormalizedScript returns the script of the knownContract and normalize it using the requested unparsing mode`, async (done) => { const script = await rpcClient.getNormalizedScript(knownContract); expect(script).toBeDefined(); done(); }); - it(`Verify that rpcClient.getContract returns the complete status of a contract`, async (done) => { + it(`Verify that rpcClient.getContract returns the complete status of knownContract`, async (done) => { const contract = await rpcClient.getContract(knownContract); expect(contract).toBeDefined(); done(); }); - it(`Verify that rpcClient.getManagerKey for known baker returns the manager key of the contract`, async (done) => { + it(`Verify that rpcClient.getManagerKey returns the manager key of the knownBaker`, async (done) => { const managerKey = await rpcClient.getManagerKey(knownBaker); expect(managerKey).toBeDefined(); done(); }); - it(`Verify that rpcClient.getDelegate for known baker returns the delegate of the contract`, async (done) => { + it(`Verify that rpcClient.getDelegate returns the delegate of the knownBaker`, async (done) => { const delegate = await rpcClient.getDelegate(knownBaker); expect(delegate).toBeDefined(); done(); }); - it(`Verify that rpcClient.getBigMapExpr for encoded expression returns the value associated with a key in a big map`, async (done) => { + it(`Verify that rpcClient.getBigMapExpr(deprecated) returns the value associated with encoded expression in a big map`, async (done) => { const schema = new Schema({ prim: 'big_map', args: [ @@ -136,13 +137,13 @@ CONFIGS().forEach( done(); }); - it(`Verify that rpcClient.getDelegates for known baker returns information about a delegate from RPC`, async (done) => { + it(`Verify that rpcClient.getDelegates returns everything about a delegate`, async (done) => { const delegates = await rpcClient.getDelegates(knownBaker); expect(delegates).toBeDefined(); done(); }); - it(`Fetches voting information about a delegate from RPC`, async (done) => { + it(`verify that rpcClient.getVotingInfo returns the knownBaker voting power found in the listings of the current voting period`, async (done) => { const votinInfo = await rpcClient.getVotingInfo(knownBaker); expect(votinInfo).toBeDefined(); done(); @@ -160,7 +161,7 @@ CONFIGS().forEach( done(); }); - it('Verify that rpcClient.getBlockHeader returns whole block header', async (done) => { + it('Verify that rpcClient.getBlockHeader returns the whole block header', async (done) => { const blockHeader = await rpcClient.getBlockHeader(); expect(blockHeader).toBeDefined(); done(); @@ -182,7 +183,20 @@ CONFIGS().forEach( done(); }); - unrestrictedRPCNode('Verify that rpcClient.getEndorsingRights retrieves the list of delegates allowed to endorse a block', async (done) => { + unrestrictedRPCNode('Verify that rpcClient.getAttestationRights retrieves the list of delegates allowed to attest a block', async (done) => { + const attestRights = await rpcClient.getAttestationRights(); + expect(attestRights).toBeDefined(); + expect(attestRights[0].delegates).toBeDefined(); + expect(attestRights[0].delegates![0].delegate).toBeDefined(); + expect(typeof attestRights[0].delegates![0].delegate).toEqual('string'); + expect(attestRights[0].delegates![0].attestation_power).toBeDefined(); + expect(typeof attestRights[0].delegates![0].attestation_power).toEqual('number'); + expect(attestRights[0].delegates![0].first_slot).toBeDefined(); + expect(typeof attestRights[0].delegates![0].first_slot).toEqual('number'); + done(); + }); + + unrestrictedRPCNode('Verify that rpcClient.getEndorsingRights(deprecated) retrieves the list of delegates allowed to endorse a block', async (done) => { const endorsingRights = await rpcClient.getEndorsingRights(); expect(endorsingRights).toBeDefined(); expect(endorsingRights[0].delegates).toBeDefined(); @@ -488,25 +502,25 @@ CONFIGS().forEach( done(); }); - it('Verify that rpcClient.getPendingOperations will retrieve the pending operations in mempool', async (done) => { - const pendingOperations: PendingOperations = await rpcClient.getPendingOperations(); - expect(pendingOperations).toBeDefined(); - expect(pendingOperations.applied).toBeInstanceOf(Array); - expect(pendingOperations.refused).toBeInstanceOf(Array); - expect(pendingOperations.outdated).toBeInstanceOf(Array); - expect(pendingOperations.branch_delayed).toBeInstanceOf(Array); - expect(pendingOperations.branch_refused).toBeInstanceOf(Array); + it('Verify that rpcClient.getPendingOperations version1 will retrieve the pending operations in mempool with property applied', async (done) => { + const pendingOperations1 = await rpcClient.getPendingOperations() as PendingOperationsV1; + expect(pendingOperations1).toBeDefined(); + expect(pendingOperations1.applied).toBeInstanceOf(Array); + expect(pendingOperations1.refused).toBeInstanceOf(Array); + expect(pendingOperations1.outdated).toBeInstanceOf(Array); + expect(pendingOperations1.branch_delayed).toBeInstanceOf(Array); + expect(pendingOperations1.branch_refused).toBeInstanceOf(Array); done(); }); - it('Verify that rpcClient.getOriginationProof will retrieve the proof needed for smart rollup originate', async (done) => { - const proof = await rpcClient.getOriginationProof({ - kernel: '23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a', - kind: PvmKind.WASM2 - }) - const hexRegex = RegExp('^[a-fA-F0-9]+$'); - expect(proof).toBeDefined(); - expect(hexRegex.test(proof)).toEqual(true); + oxfordnetAndAlpha('Verify that rpcClient.getPendingOperations version2 will retrieve the pending operations in mempool with property validated', async (done) => { + const pendingOperations2 = await rpcClient.getPendingOperations({ version: '2' }) as PendingOperationsV2; + expect(pendingOperations2).toBeDefined(); + expect(pendingOperations2.validated).toBeInstanceOf(Array); + expect(pendingOperations2.refused).toBeInstanceOf(Array); + expect(pendingOperations2.outdated).toBeInstanceOf(Array); + expect(pendingOperations2.branch_delayed).toBeInstanceOf(Array); + expect(pendingOperations2.branch_refused).toBeInstanceOf(Array); done(); }) }); diff --git a/integration-tests/sandbox-env.sh b/integration-tests/sandbox-env.sh index a1c08ca0ea..15687a9c35 100755 --- a/integration-tests/sandbox-env.sh +++ b/integration-tests/sandbox-env.sh @@ -1,7 +1,7 @@ #!/bin/sh -export RUN_NAIROBINET_WITH_SECRET_KEY=true +export RUN_OXFORDNET_WITH_SECRET_KEY=true export SECRET_KEY=edsk3RFgDiCt7tWB2oe96w1eRw72iYiiqZPLu9nnEY23MYRp2d8Kkx -export TEZOS_RPC_NAIROBINET=http://localhost:20000 +export TEZOS_RPC_OXFORDNET=http://localhost:20000 export POLLING_INTERVAL_MILLISECONDS=100 export RPC_CACHE_MILLISECONDS=0 export TEZOS_BAKER=tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb diff --git a/integration-tests/wallet-failing-noop.spec.ts b/integration-tests/wallet-failing-noop.spec.ts index 4ca5058057..a5c0eabf18 100644 --- a/integration-tests/wallet-failing-noop.spec.ts +++ b/integration-tests/wallet-failing-noop.spec.ts @@ -1,34 +1,33 @@ import { InMemorySigner } from "@taquito/signer"; import { CONFIGS, defaultSecretKey, isSandbox } from "./config"; -import { OpKind, Protocols, TezosToolkit } from "@taquito/taquito"; +import { OpKind, TezosToolkit } from "@taquito/taquito"; import { verifySignature } from "@taquito/utils"; -CONFIGS().forEach(({ rpc, setup, protocol}) => { +CONFIGS().forEach(({ setup, rpc, lib }) => { + const testnet = isSandbox({ rpc }) ? it.skip : it; + let Tezos: TezosToolkit + let signer = new InMemorySigner(defaultSecretKey.secret_key) - const Tezos = new TezosToolkit(rpc); - Tezos.setSignerProvider(new InMemorySigner(defaultSecretKey.secret_key)); - const nairobinet = !isSandbox({ rpc }) && protocol === Protocols.PtNairobi ? it : it.skip; - - describe(`Test failing_noop through wallet api, based on head, and secret_key using: ${rpc}`, () => { - beforeEach(async (done) => { + describe(`Test failing_noop through wallet api, based on head, and secret_key`, () => { + beforeAll(async (done) => { await setup(); + Tezos = new TezosToolkit('https://mainnet-archive.ecadinfra.com/'); + Tezos.setSignerProvider(signer); done(); }); - nairobinet('Verify that the wallet.signFailingNoop result is as expected when the block and private key are kept constant', async done => { + testnet('Verify that the wallet.signFailingNoop result is as expected when the block and private key are kept constant', async done => { const signed = await Tezos.wallet.signFailingNoop({ arbitrary: "48656C6C6F20576F726C64", // Hello World basedOnBlock: 0, }); - // This test is skipped from flextesa because the genesis block hash is not guaranteed to stay the same - // The signature will change if the hash of the genesis block changes (maybe when switching to a testnet based on a new protocol). - // Also it depends on the signing key. - // So if any of them changes, the expected values need to be adjusted + + expect(signed).toEqual({ - bytes: 'df2788eed43ab680c8a2b79969ce4de93b9768cd2786a85ebdfba90ca7612638110000000b48656c6c6f20576f726c64', - signature: 'spsig1QVVCiQ6aN2zmut2wKTg4zWLoP9ia4qUY2hBo21odA7P25gqfieFWJMyntaJWmyrd6v3mgjKF5n4d2wcaB3LxkLmd1MoJQ', + bytes: '8fcf233671b6a04fcf679d2a381c2544ea6c1ea29ba6157776ed8424c7ccd00b110000000b48656c6c6f20576f726c64', + signature: 'spsig1Q6oLPX3mTUpUJJAFKhFdvrc8HwNBABjFpKWLfs91uDtSsLLWgbSLZpZFA7BsTPabYxghXQkKx1ogDTRcRQoKYaFX6aGLt', signedContent: { - branch: 'BMQZWtQjSpyJZBVHbABEmVP9VG8yEZPZ3wNftwZdXt6A33ZYatj', + branch: 'BLockGenesisGenesisGenesisGenesisGenesisf79b5d1CoW2', contents: [{ kind: OpKind.FAILING_NOOP, arbitrary: '48656C6C6F20576F726C64' @@ -39,9 +38,11 @@ CONFIGS().forEach(({ rpc, setup, protocol}) => { }); }); - describe(`Test failing_noop through wallet api using: ${rpc}`, () => { - beforeEach(async (done) => { + describe(`Test failing_noop through wallet api using: ${rpc}`, () => { + beforeAll(async (done) => { await setup(); + Tezos = lib; + Tezos.setSignerProvider(signer); done(); }); diff --git a/lerna.json b/lerna.json index a1c8b64c6a..dba0218575 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "useWorkspaces": true, "useNx": true, - "version": "17.3.1" + "version": "18.0.0-RC.0" } diff --git a/package-lock.json b/package-lock.json index 42a7627aed..1834594662 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,12 +57,12 @@ }, "apps/taquito-test-dapp": { "name": "taquito-test-dapp-vite", - "version": "17.3.1", + "version": "18.0.0-RC.0", "dependencies": { "@airgap/beacon-sdk": "4.0.10", - "@taquito/beacon-wallet": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/beacon-wallet": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "buffer": "^6.0.3", "svelte-select": "^4.4.7", "vite-compatible-readable-stream": "^3.6.1" @@ -97,19 +97,19 @@ }, "example": { "name": "@taquito/example", - "version": "17.3.1", + "version": "18.0.0-RC.0", "dependencies": { "@ledgerhq/hw-transport-node-hid": "^6.27.3", - "@taquito/ledger-signer": "^17.3.1", - "@taquito/local-forging": "^17.3.1", - "@taquito/michel-codec": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/sapling": "^17.3.1", - "@taquito/signer": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/tzip16": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/ledger-signer": "^18.0.0-RC.0", + "@taquito/local-forging": "^18.0.0-RC.0", + "@taquito/michel-codec": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/sapling": "^18.0.0-RC.0", + "@taquito/signer": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/tzip16": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0" }, "devDependencies": { @@ -118,26 +118,26 @@ } }, "integration-tests": { - "version": "17.3.1", + "version": "18.0.0-RC.0", "dependencies": { "@ledgerhq/devices": "6.20.0", "@ledgerhq/hw-transport": "6.28.8", "@ledgerhq/hw-transport-node-hid": "6.27.21", "@ledgerhq/hw-transport-node-hid-noevents": "6.27.19", - "@taquito/contracts-library": "^17.3.1", - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/local-forging": "^17.3.1", - "@taquito/michel-codec": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/remote-signer": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/sapling": "^17.3.1", - "@taquito/signer": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/tzip12": "^17.3.1", - "@taquito/tzip16": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/contracts-library": "^18.0.0-RC.0", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/local-forging": "^18.0.0-RC.0", + "@taquito/michel-codec": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/remote-signer": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/sapling": "^18.0.0-RC.0", + "@taquito/signer": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/tzip12": "^18.0.0-RC.0", + "@taquito/tzip16": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0", "bip39": "3.0.4", "blakejs": "^1.2.1" @@ -26418,17 +26418,17 @@ }, "packages/taquito": { "name": "@taquito/taquito", - "version": "17.3.1", + "version": "18.0.0-RC.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/local-forging": "^17.3.1", - "@taquito/michel-codec": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/local-forging": "^18.0.0-RC.0", + "@taquito/michel-codec": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0", "rxjs": "^7.8.1" }, @@ -26477,12 +26477,12 @@ }, "packages/taquito-beacon-wallet": { "name": "@taquito/beacon-wallet", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { "@airgap/beacon-dapp": "4.0.10", - "@taquito/core": "^17.3.1", - "@taquito/taquito": "^17.3.1" + "@taquito/core": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0" }, "devDependencies": { "@types/bluebird": "^3.5.36", @@ -26520,13 +26520,13 @@ }, "packages/taquito-contracts-library": { "name": "@taquito/contracts-library", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0" }, "devDependencies": { @@ -26577,7 +26577,7 @@ }, "packages/taquito-core": { "name": "@taquito/core", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "engines": { "node": ">=16" @@ -26585,10 +26585,10 @@ }, "packages/taquito-http-utils": { "name": "@taquito/http-utils", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { - "@taquito/core": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", "axios": "0.26.0" }, "devDependencies": { @@ -26639,14 +26639,14 @@ }, "packages/taquito-ledger-signer": { "name": "@taquito/ledger-signer", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { "@ledgerhq/hw-transport": "^6.28.8", "@stablelib/blake2b": "^1.0.1", - "@taquito/core": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "buffer": "^6.0.3" }, "devDependencies": { @@ -26697,15 +26697,15 @@ }, "packages/taquito-local-forging": { "name": "@taquito/local-forging", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0" }, "devDependencies": { - "@taquito/rpc": "^17.3.1", + "@taquito/rpc": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/estree": "^1.0.0", "@types/jest": "^26.0.23", @@ -26757,10 +26757,10 @@ }, "packages/taquito-michel-codec": { "name": "@taquito/michel-codec", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "MIT", "dependencies": { - "@taquito/core": "^17.3.1" + "@taquito/core": "^18.0.0-RC.0" }, "devDependencies": { "@types/bluebird": "^3.5.36", @@ -26820,21 +26820,21 @@ } }, "packages/taquito-michel-codec/pack-test-tool": { - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { - "@taquito/rpc": "^17.3.1", + "@taquito/rpc": "^18.0.0-RC.0", "yargs": "^16.2.0" } }, "packages/taquito-michelson-encoder": { "name": "@taquito/michelson-encoder", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0", "fast-json-stable-stringify": "^2.1.0" }, @@ -26885,15 +26885,15 @@ }, "packages/taquito-remote-signer": { "name": "@taquito/remote-signer", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { "@stablelib/blake2b": "^1.0.1", "@stablelib/ed25519": "^1.0.3", - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "typedarray-to-buffer": "^4.0.0" }, "devDependencies": { @@ -26944,12 +26944,12 @@ }, "packages/taquito-rpc": { "name": "@taquito/rpc", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0" }, "devDependencies": { @@ -26999,17 +26999,17 @@ }, "packages/taquito-sapling": { "name": "@taquito/sapling", - "version": "17.3.1", + "version": "18.0.0-RC.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { "@airgap/sapling-wasm": "0.0.9", "@stablelib/nacl": "^1.0.3", "@stablelib/random": "^1.0.1", - "@taquito/core": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0", "bip39": "3.0.4", "blakejs": "^1.2.1", @@ -27236,7 +27236,7 @@ }, "packages/taquito-signer": { "name": "@taquito/signer", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { "@stablelib/blake2b": "^1.0.1", @@ -27245,9 +27245,9 @@ "@stablelib/nacl": "^1.0.4", "@stablelib/pbkdf2": "^1.0.1", "@stablelib/sha512": "^1.0.1", - "@taquito/core": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/bn.js": "^5.1.1", "bip39": "3.0.4", "elliptic": "^6.5.4", @@ -27304,13 +27304,13 @@ }, "packages/taquito-tzip12": { "name": "@taquito/tzip12", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/tzip16": "^17.3.1" + "@taquito/core": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/tzip16": "^18.0.0-RC.0" }, "devDependencies": { "@types/bluebird": "^3.5.36", @@ -27360,15 +27360,15 @@ }, "packages/taquito-tzip16": { "name": "@taquito/tzip16", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0", "crypto-js": "^4.1.1" }, @@ -27421,12 +27421,12 @@ }, "packages/taquito-utils": { "name": "@taquito/utils", - "version": "17.3.1", + "version": "18.0.0-RC.0", "license": "Apache-2.0", "dependencies": { "@stablelib/blake2b": "^1.0.1", "@stablelib/ed25519": "^1.0.3", - "@taquito/core": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", "@types/bs58check": "^2.1.0", "bignumber.js": "^9.1.0", "blakejs": "^1.2.1", @@ -32068,8 +32068,8 @@ "version": "file:packages/taquito-beacon-wallet", "requires": { "@airgap/beacon-dapp": "4.0.10", - "@taquito/core": "^17.3.1", - "@taquito/taquito": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/chrome": "0.0.171", "@types/jest": "^26.0.23", @@ -32103,10 +32103,10 @@ "@taquito/contracts-library": { "version": "file:packages/taquito-contracts-library", "requires": { - "@taquito/core": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/jest": "^26.0.23", "@types/node": "^16", @@ -32152,16 +32152,16 @@ "version": "file:example", "requires": { "@ledgerhq/hw-transport-node-hid": "^6.27.3", - "@taquito/ledger-signer": "^17.3.1", - "@taquito/local-forging": "^17.3.1", - "@taquito/michel-codec": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/sapling": "^17.3.1", - "@taquito/signer": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/tzip16": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/ledger-signer": "^18.0.0-RC.0", + "@taquito/local-forging": "^18.0.0-RC.0", + "@taquito/michel-codec": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/sapling": "^18.0.0-RC.0", + "@taquito/signer": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/tzip16": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/node-hid": "^1.3.1", "bignumber.js": "^9.1.0", "ts-node": "^10.9.1" @@ -32170,7 +32170,7 @@ "@taquito/http-utils": { "version": "file:packages/taquito-http-utils", "requires": { - "@taquito/core": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/jest": "^26.0.24", "@types/node": "^16", @@ -32214,9 +32214,9 @@ "requires": { "@ledgerhq/hw-transport": "^6.28.8", "@stablelib/blake2b": "^1.0.1", - "@taquito/core": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/jest": "^26.0.24", "@types/node": "^16", @@ -32258,9 +32258,9 @@ "@taquito/local-forging": { "version": "file:packages/taquito-local-forging", "requires": { - "@taquito/core": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/estree": "^1.0.0", "@types/jest": "^26.0.23", @@ -32306,7 +32306,7 @@ "@taquito/michel-codec": { "version": "file:packages/taquito-michel-codec", "requires": { - "@taquito/core": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/jest": "^26.0.23", "@types/node": "^16", @@ -32355,9 +32355,9 @@ "@taquito/michelson-encoder": { "version": "file:packages/taquito-michelson-encoder", "requires": { - "@taquito/core": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/jest": "^26.0.23", "@types/node": "^16", @@ -32401,10 +32401,10 @@ "requires": { "@stablelib/blake2b": "^1.0.1", "@stablelib/ed25519": "^1.0.3", - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/jest": "^26.0.24", "@types/node": "^16", @@ -32446,9 +32446,9 @@ "@taquito/rpc": { "version": "file:packages/taquito-rpc", "requires": { - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/jest": "^26.0.23", "@types/node": "^16", @@ -32493,10 +32493,10 @@ "@rollup/plugin-json": "^4.1.0", "@stablelib/nacl": "^1.0.3", "@stablelib/random": "^1.0.1", - "@taquito/core": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/jest": "^26.0.23", "@types/node": "^16", "@types/pbkdf2": "^3.1.0", @@ -32665,9 +32665,9 @@ "@stablelib/nacl": "^1.0.4", "@stablelib/pbkdf2": "^1.0.1", "@stablelib/sha512": "^1.0.1", - "@taquito/core": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/bn.js": "^5.1.1", "@types/elliptic": "^6.4.14", @@ -32716,13 +32716,13 @@ "version": "file:packages/taquito", "requires": { "@babel/types": "7.16.0", - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/local-forging": "^17.3.1", - "@taquito/michel-codec": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/local-forging": "^18.0.0-RC.0", + "@taquito/michel-codec": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/estree": "^0.0.50", "@types/jest": "^26.0.23", @@ -32774,10 +32774,10 @@ "@taquito/tzip12": { "version": "file:packages/taquito-tzip12", "requires": { - "@taquito/core": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/tzip16": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/tzip16": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/jest": "^26.0.23", "@types/node": "^16", @@ -32818,12 +32818,12 @@ "@taquito/tzip16": { "version": "file:packages/taquito-tzip16", "requires": { - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/crypto-js": "^4.1.1", "@types/jest": "^26.0.23", @@ -32869,7 +32869,7 @@ "requires": { "@stablelib/blake2b": "^1.0.1", "@stablelib/ed25519": "^1.0.3", - "@taquito/core": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/bs58check": "^2.1.0", "@types/elliptic": "^6.4.14", @@ -38270,20 +38270,20 @@ "@ledgerhq/hw-transport": "6.28.8", "@ledgerhq/hw-transport-node-hid": "6.27.21", "@ledgerhq/hw-transport-node-hid-noevents": "6.27.19", - "@taquito/contracts-library": "^17.3.1", - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/local-forging": "^17.3.1", - "@taquito/michel-codec": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/remote-signer": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/sapling": "^17.3.1", - "@taquito/signer": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/tzip12": "^17.3.1", - "@taquito/tzip16": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/contracts-library": "^18.0.0-RC.0", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/local-forging": "^18.0.0-RC.0", + "@taquito/michel-codec": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/remote-signer": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/sapling": "^18.0.0-RC.0", + "@taquito/signer": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/tzip12": "^18.0.0-RC.0", + "@taquito/tzip16": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/jest": "^26.0.23", "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^5.28.0", @@ -44228,7 +44228,7 @@ "pack-test-tool": { "version": "file:packages/taquito-michel-codec/pack-test-tool", "requires": { - "@taquito/rpc": "^17.3.1", + "@taquito/rpc": "^18.0.0-RC.0", "yargs": "^16.2.0" } }, @@ -47153,9 +47153,9 @@ "requires": { "@airgap/beacon-sdk": "4.0.10", "@sveltejs/vite-plugin-svelte": "^1.1.0", - "@taquito/beacon-wallet": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/beacon-wallet": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@tsconfig/svelte": "^2.0.1", "buffer": "^6.0.3", "events": "^3.3.0", diff --git a/package.json b/package.json index 0f11b6a771..f2ad78f1f7 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "example": "cd example && npm run example", "build-docs": "typedoc --tsconfig ./tsconfig.typedoc.json", "gh-pages": "gh-pages", - "integration-tests": "npm -w integration-tests run test:originate-known-contracts && npm -w integration-tests run test:nairobinet-secret-key -- --testPathIgnorePatterns ledger-signer-failing-tests.spec.ts ledger-signer.spec.ts contract-estimation-tests.spec.ts rpc-get-protocol-constants.spec.ts", + "integration-tests": "npm -w integration-tests run test:originate-known-contracts && npm -w integration-tests run test:oxfordnet-secret-key -- --testPathIgnorePatterns ledger-signer-failing-tests.spec.ts ledger-signer.spec.ts contract-estimation-tests.spec.ts rpc-get-protocol-constants.spec.ts", "version-stamp": "lerna run version-stamp" }, "jest": { diff --git a/packages/taquito-beacon-wallet/package.json b/packages/taquito-beacon-wallet/package.json index c7ee811fc2..12bdf97b26 100644 --- a/packages/taquito-beacon-wallet/package.json +++ b/packages/taquito-beacon-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/beacon-wallet", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Beacon wallet provider", "keywords": [ "tezos", @@ -68,8 +68,8 @@ }, "dependencies": { "@airgap/beacon-dapp": "4.0.10", - "@taquito/core": "^17.3.1", - "@taquito/taquito": "^17.3.1" + "@taquito/core": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0" }, "devDependencies": { "@types/bluebird": "^3.5.36", diff --git a/packages/taquito-beacon-wallet/src/version.ts b/packages/taquito-beacon-wallet/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-beacon-wallet/src/version.ts +++ b/packages/taquito-beacon-wallet/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-contracts-library/package.json b/packages/taquito-contracts-library/package.json index 1346f63ea8..44bc50cf5f 100644 --- a/packages/taquito-contracts-library/package.json +++ b/packages/taquito-contracts-library/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/contracts-library", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Can be used as an extension on the TezosToolkit to provide contracts data", "keywords": [ "tezos" @@ -68,10 +68,10 @@ ] }, "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0" }, "devDependencies": { diff --git a/packages/taquito-contracts-library/src/rpc-wrapper.ts b/packages/taquito-contracts-library/src/rpc-wrapper.ts index 7fb5335d13..51f600e770 100644 --- a/packages/taquito-contracts-library/src/rpc-wrapper.ts +++ b/packages/taquito-contracts-library/src/rpc-wrapper.ts @@ -17,7 +17,9 @@ import { DelegateResponse, DelegatesResponse, VotingInfoResponse, + AttestationRightsQueryArguments, EndorsingRightsQueryArguments, + AttestationRightsResponse, EndorsingRightsResponse, EntrypointsResponse, ForgeOperationsParams, @@ -39,16 +41,14 @@ import { RunViewResult, SaplingDiffResponse, ScriptResponse, - TxRollupInboxResponse, - TxRollupStateResponse, UnparsingMode, VotesListingsResponse, VotingPeriodBlockResult, TicketTokenParams, AllTicketBalances, - PendingOperations, + PendingOperationsV1, + PendingOperationsV2, PendingOperationsQueryArguments, - OriginationProofParams, RPCSimulateOperationParam, } from '@taquito/rpc'; import { ContractsLibrary } from './taquito-contracts-library'; @@ -171,6 +171,12 @@ export class RpcWrapperContractsLibrary implements RpcClientInterface { ): Promise { return this.rpc.getBakingRights(args, { block }); } + async getAttestationRights( + args: AttestationRightsQueryArguments, + { block }: RPCOptions = defaultRPCOptions + ): Promise { + return this.rpc.getAttestationRights(args, { block }); + } async getEndorsingRights( args: EndorsingRightsQueryArguments, { block }: RPCOptions = defaultRPCOptions @@ -293,19 +299,6 @@ export class RpcWrapperContractsLibrary implements RpcClientInterface { async getProtocols({ block }: RPCOptions = defaultRPCOptions): Promise { return this.rpc.getProtocols({ block }); } - async getTxRollupState( - txRollupId: string, - { block }: RPCOptions = defaultRPCOptions - ): Promise { - return this.rpc.getTxRollupState(txRollupId, { block }); - } - async getTxRollupInbox( - txRollupId: string, - blockLevel: string, - { block }: RPCOptions = defaultRPCOptions - ): Promise { - return this.rpc.getTxRollupInbox(txRollupId, blockLevel, { block }); - } async getStorageUsedSpace( contract: string, { block }: RPCOptions = defaultRPCOptions @@ -331,13 +324,9 @@ export class RpcWrapperContractsLibrary implements RpcClientInterface { ): Promise { return this.rpc.getAllTicketBalances(contract, { block }); } - async getPendingOperations(args: PendingOperationsQueryArguments): Promise { + async getPendingOperations( + args: PendingOperationsQueryArguments + ): Promise { return this.rpc.getPendingOperations(args); } - async getOriginationProof( - params: OriginationProofParams, - { block }: RPCOptions = defaultRPCOptions - ): Promise { - return this.rpc.getOriginationProof(params, { block }); - } } diff --git a/packages/taquito-contracts-library/src/version.ts b/packages/taquito-contracts-library/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-contracts-library/src/version.ts +++ b/packages/taquito-contracts-library/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-core/package.json b/packages/taquito-core/package.json index 34dc6a735d..924e6d1d50 100644 --- a/packages/taquito-core/package.json +++ b/packages/taquito-core/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/core", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Classes, interfaces, and types shared across Taquito packages", "keywords": [ "tezos", diff --git a/packages/taquito-core/src/version.ts b/packages/taquito-core/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-core/src/version.ts +++ b/packages/taquito-core/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-http-utils/package.json b/packages/taquito-http-utils/package.json index c9f785356f..0ae582a9f3 100644 --- a/packages/taquito-http-utils/package.json +++ b/packages/taquito-http-utils/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/http-utils", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "", "keywords": [ "tezos" @@ -59,7 +59,7 @@ ] }, "dependencies": { - "@taquito/core": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", "axios": "0.26.0" }, "devDependencies": { diff --git a/packages/taquito-http-utils/src/version.ts b/packages/taquito-http-utils/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-http-utils/src/version.ts +++ b/packages/taquito-http-utils/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-ledger-signer/package.json b/packages/taquito-ledger-signer/package.json index c87279bd35..57103cfbe5 100644 --- a/packages/taquito-ledger-signer/package.json +++ b/packages/taquito-ledger-signer/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/ledger-signer", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Ledger signer provider", "keywords": [ "tezos", @@ -60,9 +60,9 @@ "dependencies": { "@ledgerhq/hw-transport": "^6.28.8", "@stablelib/blake2b": "^1.0.1", - "@taquito/core": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "buffer": "^6.0.3" }, "devDependencies": { diff --git a/packages/taquito-ledger-signer/src/version.ts b/packages/taquito-ledger-signer/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-ledger-signer/src/version.ts +++ b/packages/taquito-ledger-signer/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-local-forging/package.json b/packages/taquito-local-forging/package.json index 6da3a64567..b345b2f321 100644 --- a/packages/taquito-local-forging/package.json +++ b/packages/taquito-local-forging/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/local-forging", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Provide local forging functionality to be with taquito", "keywords": [ "tezos", @@ -68,12 +68,12 @@ ] }, "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0" }, "devDependencies": { - "@taquito/rpc": "^17.3.1", + "@taquito/rpc": "^18.0.0-RC.0", "@types/bluebird": "^3.5.36", "@types/estree": "^1.0.0", "@types/jest": "^26.0.23", diff --git a/packages/taquito-local-forging/src/codec.ts b/packages/taquito-local-forging/src/codec.ts index 175f4d05e6..b894636632 100644 --- a/packages/taquito-local-forging/src/codec.ts +++ b/packages/taquito-local-forging/src/codec.ts @@ -469,27 +469,6 @@ export const entrypointNameDecoder = (val: Uint8ArrayConsumer) => { return Buffer.from(entry).toString('utf8'); }; -export const txRollupOriginationParamEncoder = (_value: string) => { - return ''; -}; - -export const txRollupOriginationParamDecoder = (_val: Uint8ArrayConsumer) => { - return {}; -}; - -export const txRollupIdEncoder = prefixEncoder(Prefix.TXR1); - -export const txRollupIdDecoder = prefixDecoder(Prefix.TXR1); - -export const txRollupBatchContentEncoder = (value: string) => { - return `${pad(value.length / 2)}${value}`; -}; - -export const txRollupBatchContentDecoder = (val: Uint8ArrayConsumer) => { - const value = extractRequiredLen(val); - return Buffer.from(value).toString('hex'); -}; - export const burnLimitEncoder = (val: string) => { return !val ? '00' : `ff${zarithEncoder(val)}`; }; @@ -501,10 +480,6 @@ export const burnLimitDecoder = (value: Uint8ArrayConsumer) => { } }; -export const depositsLimitEncoder = (val: string) => { - return !val ? '00' : `ff${zarithEncoder(val)}`; -}; - export const depositsLimitDecoder = (value: Uint8ArrayConsumer) => { const prefix = value.consume(1); if (Buffer.from(prefix).toString('hex') !== '00') { diff --git a/packages/taquito-local-forging/src/constants.ts b/packages/taquito-local-forging/src/constants.ts index afaaf0a93d..9cb5d56ef0 100644 --- a/packages/taquito-local-forging/src/constants.ts +++ b/packages/taquito-local-forging/src/constants.ts @@ -41,18 +41,14 @@ export enum CODEC { OP_ORIGINATION = 'origination', OP_BALLOT = 'ballot', OP_FAILING_NOOP = 'failing_noop', + OP_ATTESTATION = 'attestation', OP_ENDORSEMENT = 'endorsement', OP_SEED_NONCE_REVELATION = 'seed_nonce_revelation', OP_REVEAL = 'reveal', OP_PROPOSALS = 'proposals', OP_REGISTER_GLOBAL_CONSTANT = 'register_global_constant', OP_TRANSFER_TICKET = 'transfer_ticket', - OP_TX_ROLLUP_ORIGINATION = 'tx_rollup_origination', - OP_TX_ROLLUP_SUBMIT_BATCH = 'tx_rollup_submit_batch', BURN_LIMIT = 'burn_limit', - TX_ROLLUP_ORIGINATION_PARAM = 'tx_rollup_origination_param', - TX_ROLLUP_ID = 'tx_rollup_id', - TX_ROLLUP_BATCH_CONTENT = 'tx_rollup_batch_content', OP_INCREASE_PAID_STORAGE = 'increase_paid_storage', OP_UPDATE_CONSENSUS_KEY = 'update_consensus_key', OP_DRAIN_DELEGATE = 'drain_delegate', @@ -241,12 +237,10 @@ export const kindMapping: { [key: number]: string } = { 0x6c: 'transaction', 0x6d: 'origination', 0x06: 'ballot', - 0x15: 'endorsement', + 0x15: 'attestation', 0x01: 'seed_nonce_revelation', 0x05: 'proposals', 0x6f: 'register_global_constant', - 0x96: 'tx_rollup_origination', - 0x97: 'tx_rollup_submit_batch', 0x9e: 'transfer_ticket', 0x70: 'set_deposits_limit', 0x71: 'increase_paid_storage', diff --git a/packages/taquito-local-forging/src/decoder.ts b/packages/taquito-local-forging/src/decoder.ts index 8959d0b129..a48ec774c5 100644 --- a/packages/taquito-local-forging/src/decoder.ts +++ b/packages/taquito-local-forging/src/decoder.ts @@ -20,9 +20,6 @@ import { smartContractAddressDecoder, smartRollupAddressDecoder, smartRollupCommitmentHashDecoder, - txRollupBatchContentDecoder, - txRollupIdDecoder, - txRollupOriginationParamDecoder, tz1Decoder, valueParameterDecoder, zarithDecoder, @@ -33,6 +30,7 @@ import { ActivationSchema, BallotSchema, DelegationSchema, + AttestationSchema, EndorsementSchema, IncreasePaidStorageSchema, UpdateConsensusKeySchema, @@ -47,8 +45,6 @@ import { SeedNonceRevelationSchema, TransactionSchema, TransferTicketSchema, - TxRollupOriginationSchema, - TxRollupSubmitBatchSchema, SetDepositsLimitSchema, SmartRollupOriginateSchema, SmartRollupAddMessagesSchema, @@ -83,9 +79,6 @@ export const decoders: { [key: string]: Decoder } = { [CODEC.INT16]: int16Decoder, [CODEC.BLOCK_PAYLOAD_HASH]: blockPayloadHashDecoder, [CODEC.ENTRYPOINT]: entrypointNameDecoder, - [CODEC.TX_ROLLUP_ORIGINATION_PARAM]: txRollupOriginationParamDecoder, - [CODEC.TX_ROLLUP_ID]: txRollupIdDecoder, - [CODEC.TX_ROLLUP_BATCH_CONTENT]: txRollupBatchContentDecoder, [CODEC.BURN_LIMIT]: burnLimitDecoder, [CODEC.DEPOSITS_LIMIT]: depositsLimitDecoder, [CODEC.PVM_KIND]: pvmKindDecoder, @@ -105,6 +98,8 @@ decoders[CODEC.OP_TRANSACTION] = (val: Uint8ArrayConsumer) => decoders[CODEC.OP_ORIGINATION] = (val: Uint8ArrayConsumer) => schemaDecoder(decoders)(OriginationSchema)(val); decoders[CODEC.OP_BALLOT] = (val: Uint8ArrayConsumer) => schemaDecoder(decoders)(BallotSchema)(val); +decoders[CODEC.OP_ATTESTATION] = (val: Uint8ArrayConsumer) => + schemaDecoder(decoders)(AttestationSchema)(val); decoders[CODEC.OP_ENDORSEMENT] = (val: Uint8ArrayConsumer) => schemaDecoder(decoders)(EndorsementSchema)(val); decoders[CODEC.OP_SEED_NONCE_REVELATION] = (val: Uint8ArrayConsumer) => @@ -116,10 +111,6 @@ decoders[CODEC.OP_REGISTER_GLOBAL_CONSTANT] = (val: Uint8ArrayConsumer) => schemaDecoder(decoders)(RegisterGlobalConstantSchema)(val); decoders[CODEC.OP_TRANSFER_TICKET] = (val: Uint8ArrayConsumer) => schemaDecoder(decoders)(TransferTicketSchema)(val); -decoders[CODEC.OP_TX_ROLLUP_ORIGINATION] = (val: Uint8ArrayConsumer) => - schemaDecoder(decoders)(TxRollupOriginationSchema)(val); -decoders[CODEC.OP_TX_ROLLUP_SUBMIT_BATCH] = (val: Uint8ArrayConsumer) => - schemaDecoder(decoders)(TxRollupSubmitBatchSchema)(val); decoders[CODEC.OP_INCREASE_PAID_STORAGE] = (val: Uint8ArrayConsumer) => schemaDecoder(decoders)(IncreasePaidStorageSchema)(val); decoders[CODEC.OP_UPDATE_CONSENSUS_KEY] = (val: Uint8ArrayConsumer) => diff --git a/packages/taquito-local-forging/src/encoder.ts b/packages/taquito-local-forging/src/encoder.ts index 3e23e11686..5441813fb9 100644 --- a/packages/taquito-local-forging/src/encoder.ts +++ b/packages/taquito-local-forging/src/encoder.ts @@ -15,14 +15,10 @@ import { proposalEncoder, proposalsEncoder, publicKeyEncoder, - depositsLimitEncoder, pvmKindEncoder, smartContractAddressEncoder, smartRollupAddressEncoder, smartRollupCommitmentHashEncoder, - txRollupBatchContentEncoder, - txRollupIdEncoder, - txRollupOriginationParamEncoder, tz1Encoder, valueParameterEncoder, zarithEncoder, @@ -33,6 +29,7 @@ import { ActivationSchema, BallotSchema, DelegationSchema, + AttestationSchema, EndorsementSchema, IncreasePaidStorageSchema, UpdateConsensusKeySchema, @@ -47,9 +44,6 @@ import { SeedNonceRevelationSchema, TransactionSchema, TransferTicketSchema, - TxRollupOriginationSchema, - TxRollupSubmitBatchSchema, - SetDepositsLimitSchema, SmartRollupOriginateSchema, SmartRollupExecuteOutboxMessageSchema, SmartRollupAddMessagesSchema, @@ -81,11 +75,7 @@ export const encoders: { [key: string]: Encoder } = { [CODEC.INT16]: int16Encoder, [CODEC.BLOCK_PAYLOAD_HASH]: blockPayloadHashEncoder, [CODEC.ENTRYPOINT]: entrypointNameEncoder, - [CODEC.TX_ROLLUP_ORIGINATION_PARAM]: txRollupOriginationParamEncoder, - [CODEC.TX_ROLLUP_ID]: txRollupIdEncoder, - [CODEC.TX_ROLLUP_BATCH_CONTENT]: txRollupBatchContentEncoder, [CODEC.BURN_LIMIT]: burnLimitEncoder, - [CODEC.DEPOSITS_LIMIT]: depositsLimitEncoder, [CODEC.PVM_KIND]: pvmKindEncoder, [CODEC.PADDED_BYTES]: paddedBytesEncoder, [CODEC.SMART_ROLLUP_MESSAGE]: smartRollupMessageEncoder, @@ -97,6 +87,7 @@ encoders[CODEC.OP_DELEGATION] = (val: any) => schemaEncoder(encoders)(Delegation encoders[CODEC.OP_TRANSACTION] = (val: any) => schemaEncoder(encoders)(TransactionSchema)(val); encoders[CODEC.OP_ORIGINATION] = (val: any) => schemaEncoder(encoders)(OriginationSchema)(val); encoders[CODEC.OP_BALLOT] = (val: any) => schemaEncoder(encoders)(BallotSchema)(val); +encoders[CODEC.OP_ATTESTATION] = (val: any) => schemaEncoder(encoders)(AttestationSchema)(val); encoders[CODEC.OP_ENDORSEMENT] = (val: any) => schemaEncoder(encoders)(EndorsementSchema)(val); encoders[CODEC.OP_SEED_NONCE_REVELATION] = (val: any) => schemaEncoder(encoders)(SeedNonceRevelationSchema)(val); @@ -106,10 +97,6 @@ encoders[CODEC.OP_REGISTER_GLOBAL_CONSTANT] = (val: any) => schemaEncoder(encoders)(RegisterGlobalConstantSchema)(val); encoders[CODEC.OP_TRANSFER_TICKET] = (val: any) => schemaEncoder(encoders)(TransferTicketSchema)(val); -encoders[CODEC.OP_TX_ROLLUP_ORIGINATION] = (val: any) => - schemaEncoder(encoders)(TxRollupOriginationSchema)(val); -encoders[CODEC.OP_TX_ROLLUP_SUBMIT_BATCH] = (val: any) => - schemaEncoder(encoders)(TxRollupSubmitBatchSchema)(val); encoders[CODEC.OP_INCREASE_PAID_STORAGE] = (val: any) => schemaEncoder(encoders)(IncreasePaidStorageSchema)(val); encoders[CODEC.OP_UPDATE_CONSENSUS_KEY] = (val: any) => @@ -122,6 +109,4 @@ encoders[CODEC.OP_SMART_ROLLUP_ADD_MESSAGES] = (val: any) => encoders[CODEC.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE] = (val: any) => schemaEncoder(encoders)(SmartRollupExecuteOutboxMessageSchema)(val); encoders[CODEC.MANAGER] = schemaEncoder(encoders)(ManagerOperationSchema); -encoders[CODEC.OP_SET_DEPOSITS_LIMIT] = (val) => - schemaEncoder(encoders)(SetDepositsLimitSchema)(val); encoders[CODEC.OP_FAILING_NOOP] = (val: any) => schemaEncoder(encoders)(FailingNoopSchema)(val); diff --git a/packages/taquito-local-forging/src/protocols.ts b/packages/taquito-local-forging/src/protocols.ts index 3c5023ce69..423f6b0c3c 100644 --- a/packages/taquito-local-forging/src/protocols.ts +++ b/packages/taquito-local-forging/src/protocols.ts @@ -15,6 +15,7 @@ export enum ProtocolsHash { PtMumbaii = 'PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc', PtMumbai2 = 'PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1', PtNairobi = 'PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf', + ProxfordS = 'ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8', ProtoALpha = 'ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK', } @@ -35,7 +36,8 @@ const protoLevel: Record = { PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc: 16, PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1: 16, PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf: 17, - ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 18, + ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8: 18, + ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 19, }; export function ProtoInferiorTo(a: ProtocolsHash, b: ProtocolsHash): boolean { diff --git a/packages/taquito-local-forging/src/schema/operation.ts b/packages/taquito-local-forging/src/schema/operation.ts index 54563bc1ce..c4ff221600 100644 --- a/packages/taquito-local-forging/src/schema/operation.ts +++ b/packages/taquito-local-forging/src/schema/operation.ts @@ -65,6 +65,13 @@ export const BallotSchema = { ballot: CODEC.BALLOT_STATEMENT, }; +export const AttestationSchema = { + slot: CODEC.INT16, + level: CODEC.INT32, + round: CODEC.INT32, + block_payload_hash: CODEC.BLOCK_PAYLOAD_HASH, +}; + export const EndorsementSchema = { slot: CODEC.INT16, level: CODEC.INT32, @@ -106,26 +113,6 @@ export const TransferTicketSchema = { entrypoint: CODEC.ENTRYPOINT, }; -export const TxRollupOriginationSchema = { - source: CODEC.PKH, - fee: CODEC.ZARITH, - counter: CODEC.ZARITH, - gas_limit: CODEC.ZARITH, - storage_limit: CODEC.ZARITH, - tx_rollup_origination: CODEC.TX_ROLLUP_ORIGINATION_PARAM, -}; - -export const TxRollupSubmitBatchSchema = { - source: CODEC.PKH, - fee: CODEC.ZARITH, - counter: CODEC.ZARITH, - gas_limit: CODEC.ZARITH, - storage_limit: CODEC.ZARITH, - rollup: CODEC.TX_ROLLUP_ID, - content: CODEC.TX_ROLLUP_BATCH_CONTENT, - burn_limit: CODEC.BURN_LIMIT, -}; - export const IncreasePaidStorageSchema = { source: CODEC.PKH, fee: CODEC.ZARITH, @@ -168,7 +155,6 @@ export const SmartRollupOriginateSchema = { storage_limit: CODEC.ZARITH, pvm_kind: CODEC.PVM_KIND, kernel: CODEC.PADDED_BYTES, - origination_proof: CODEC.PADDED_BYTES, parameters_ty: CODEC.VALUE, }; diff --git a/packages/taquito-local-forging/src/taquito-local-forging.ts b/packages/taquito-local-forging/src/taquito-local-forging.ts index 49b51422b3..2716fdb9a5 100644 --- a/packages/taquito-local-forging/src/taquito-local-forging.ts +++ b/packages/taquito-local-forging/src/taquito-local-forging.ts @@ -22,7 +22,7 @@ export * from './interface'; export { VERSION } from './version'; export { ProtocolsHash } from './protocols'; -const PROTOCOL_CURRENT = ProtocolsHash.PtMumbai2; +const PROTOCOL_CURRENT = ProtocolsHash.ProxfordS; export function getCodec(codec: CODEC, _proto: ProtocolsHash) { return { @@ -58,13 +58,6 @@ export class LocalForger implements Forger { continue; } else if (content.kind === 'transaction' && diff[0] === 'parameters') { continue; - } else if (content.kind === 'set_deposits_limit' && diff[0] === 'limit') { - continue; - } else if ( - content.kind === ('tx_rollup_submit_batch' as unknown) && - diff[0] === 'burn_limit' - ) { - continue; } else { throw new InvalidOperationSchemaError(content, `missing properties "${diff.join(', ')}"`); } diff --git a/packages/taquito-local-forging/src/validator.ts b/packages/taquito-local-forging/src/validator.ts index e94fa741b0..59d277f634 100644 --- a/packages/taquito-local-forging/src/validator.ts +++ b/packages/taquito-local-forging/src/validator.ts @@ -10,10 +10,9 @@ import { ProposalsSchema, RevealSchema, RegisterGlobalConstantSchema, + AttestationSchema, EndorsementSchema, TransferTicketSchema, - TxRollupOriginationSchema, - TxRollupSubmitBatchSchema, IncreasePaidStorageSchema, UpdateConsensusKeySchema, DrainDelegateSchema, @@ -31,13 +30,12 @@ type OperationKind = | OpKind.TRANSACTION | OpKind.ORIGINATION | OpKind.BALLOT + | OpKind.ATTESTATION | OpKind.ENDORSEMENT | OpKind.SEED_NONCE_REVELATION | OpKind.PROPOSALS | OpKind.REGISTER_GLOBAL_CONSTANT | OpKind.TRANSFER_TICKET - | OpKind.TX_ROLLUP_ORIGINATION - | OpKind.TX_ROLLUP_SUBMIT_BATCH | OpKind.INCREASE_PAID_STORAGE | OpKind.UPDATE_CONSENSUS_KEY | OpKind.DRAIN_DELEGATE @@ -53,13 +51,12 @@ const OperationKindMapping = { transaction: TransactionSchema, origination: OriginationSchema, ballot: BallotSchema, + attestation: AttestationSchema, endorsement: EndorsementSchema, seed_nonce_revelation: SeedNonceRevelationSchema, proposals: ProposalsSchema, register_global_constant: RegisterGlobalConstantSchema, transfer_ticket: TransferTicketSchema, - tx_rollup_origination: TxRollupOriginationSchema, - tx_rollup_submit_batch: TxRollupSubmitBatchSchema, increase_paid_storage: IncreasePaidStorageSchema, update_consensus_key: UpdateConsensusKeySchema, drain_delegate: DrainDelegateSchema, diff --git a/packages/taquito-local-forging/src/version.ts b/packages/taquito-local-forging/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-local-forging/src/version.ts +++ b/packages/taquito-local-forging/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; 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 edcb35890f..bce9fc4a92 100644 --- a/packages/taquito-local-forging/test/taquito-local-forging.spec.ts +++ b/packages/taquito-local-forging/test/taquito-local-forging.spec.ts @@ -296,8 +296,6 @@ describe('Forge and parse operations default protocol', () => { pvm_kind: 'wasm_2_0_0', kernel: '23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a', - origination_proof: - '0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea18030fab8a3adde4b553c4d391e9cd19ee13b17941c1f49c040d621bbfbea964993810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9', parameters_ty: { prim: 'bytes', }, @@ -308,9 +306,6 @@ describe('Forge and parse operations default protocol', () => { expect(forged).toContain( '0000035323212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a' ); - expect(forged).toContain( - '000000770300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea18030fab8a3adde4b553c4d391e9cd19ee13b17941c1f49c040d621bbfbea964993810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9' - ); expect(forged).toContain('000000020369'); }); diff --git a/packages/taquito-michel-codec/pack-test-tool/package.json b/packages/taquito-michel-codec/pack-test-tool/package.json index 106994cc6c..dd75b4139c 100644 --- a/packages/taquito-michel-codec/pack-test-tool/package.json +++ b/packages/taquito-michel-codec/pack-test-tool/package.json @@ -1,6 +1,6 @@ { "name": "pack-test-tool", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Generate pack test data via Tezos RPC", "main": "pack-test-tool.js", "private": true, @@ -8,7 +8,7 @@ "author": "Eugene Zagidullin ", "license": "Apache-2.0", "dependencies": { - "@taquito/rpc": "^17.3.1", + "@taquito/rpc": "^18.0.0-RC.0", "yargs": "^16.2.0" } } diff --git a/packages/taquito-michel-codec/package.json b/packages/taquito-michel-codec/package.json index abadac25a6..8000516a30 100644 --- a/packages/taquito-michel-codec/package.json +++ b/packages/taquito-michel-codec/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/michel-codec", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Michelson parser/validator/formatter", "keywords": [ "tezos", @@ -67,7 +67,7 @@ ] }, "dependencies": { - "@taquito/core": "^17.3.1" + "@taquito/core": "^18.0.0-RC.0" }, "devDependencies": { "@types/bluebird": "^3.5.36", diff --git a/packages/taquito-michel-codec/src/michelson-typecheck.ts b/packages/taquito-michel-codec/src/michelson-typecheck.ts index 0b105c0afc..cfcb5a73c5 100644 --- a/packages/taquito-michel-codec/src/michelson-typecheck.ts +++ b/packages/taquito-michel-codec/src/michelson-typecheck.ts @@ -410,7 +410,6 @@ function assertDataValidInternal(d: MichelsonData, t: MichelsonType, ctx: Contex 'SECP256K1PublicKeyHash', 'P256PublicKeyHash', 'ContractHash', - 'TxRollupL2Address', 'RollupAddress' ) !== null ) { diff --git a/packages/taquito-michel-codec/src/michelson-types.ts b/packages/taquito-michel-codec/src/michelson-types.ts index 3dbb4e9914..ee954bcef7 100644 --- a/packages/taquito-michel-codec/src/michelson-types.ts +++ b/packages/taquito-michel-codec/src/michelson-types.ts @@ -402,10 +402,11 @@ export enum Protocol { PtMumbaii = 'PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc', PtMumbai2 = 'PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1', PtNairobi = 'PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf', + ProxfordS = 'ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8', ProtoALpha = 'ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK', // temporary protocol hash } -export const DefaultProtocol = Protocol.Psithaca2; +export const DefaultProtocol = Protocol.ProxfordS; export type ProtocolID = `${Protocol}`; @@ -434,7 +435,8 @@ const protoLevel: Record = { PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc: 16, PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1: 16, PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf: 17, - ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 18, + ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8: 18, + ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 19, }; export function ProtoGreaterOrEqual(a: ProtocolID, b: ProtocolID): boolean { diff --git a/packages/taquito-michel-codec/src/utils.ts b/packages/taquito-michel-codec/src/utils.ts index 9525712880..5be4a599f0 100644 --- a/packages/taquito-michel-codec/src/utils.ts +++ b/packages/taquito-michel-codec/src/utils.ts @@ -274,8 +274,7 @@ export type TezosIDType = | 'P256Signature' | 'GenericSignature' | 'ChainID' - | 'RollupAddress' - | 'TxRollupL2Address'; + | 'RollupAddress'; export type TezosIDPrefix = [number, number[]]; // payload length, prefix @@ -309,7 +308,6 @@ export const tezosPrefix: Record = { GenericSignature: [64, [4, 130, 43]], // sig(96) ChainID: [4, [87, 82, 0]], RollupAddress: [20, [1, 128, 120, 31]], - TxRollupL2Address: [20, [6, 161, 166]], }; export function checkDecodeTezosID( diff --git a/packages/taquito-michel-codec/src/version.ts b/packages/taquito-michel-codec/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-michel-codec/src/version.ts +++ b/packages/taquito-michel-codec/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-michelson-encoder/package.json b/packages/taquito-michelson-encoder/package.json index 70ad84093a..a9a69fef3a 100644 --- a/packages/taquito-michelson-encoder/package.json +++ b/packages/taquito-michelson-encoder/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/michelson-encoder", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "converts michelson data and types into convenient JS/TS objects", "keywords": [ "tezos", @@ -68,9 +68,9 @@ ] }, "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0", "fast-json-stable-stringify": "^2.1.0" }, diff --git a/packages/taquito-michelson-encoder/src/schema/types.ts b/packages/taquito-michelson-encoder/src/schema/types.ts index d23a97f947..74656bc1a0 100644 --- a/packages/taquito-michelson-encoder/src/schema/types.ts +++ b/packages/taquito-michelson-encoder/src/schema/types.ts @@ -21,8 +21,7 @@ export type BaseTokenSchema = { | 'chest' | 'chest_key' | 'signature' - | 'unit' - | 'tx_rollup_l2_address'; + | 'unit'; schema: string; }; export type OrTokenSchema = { __michelsonType: 'or'; schema: Record }; diff --git a/packages/taquito-michelson-encoder/src/tokens/comparable/tx_rollup_l2_address.ts b/packages/taquito-michelson-encoder/src/tokens/comparable/tx_rollup_l2_address.ts deleted file mode 100644 index 281130e147..0000000000 --- a/packages/taquito-michelson-encoder/src/tokens/comparable/tx_rollup_l2_address.ts +++ /dev/null @@ -1,140 +0,0 @@ -import { BaseTokenSchema } from '../../schema/types'; -import { - b58decodeL2Address, - encodeL2Address, - validateAddress, - ValidationResult, -} from '@taquito/utils'; -import { - ComparableToken, - SemanticEncoding, - Token, - TokenFactory, - TokenValidationError, -} from '../token'; - -/** - * @category Error - * @description Error that indicates a failure happening when parsing encoding/executing a Tx Rollup L2 Address - */ -export class TxRollupL2AddressValidationError extends TokenValidationError { - name = 'TxRollupL2AddressValidationError'; - constructor(public value: unknown, public token: TxRollupL2AddressToken, message: string) { - super(value, token, message); - } -} - -export class TxRollupL2AddressToken extends ComparableToken { - static prim: 'tx_rollup_l2_address' = 'tx_rollup_l2_address' as const; - - constructor( - protected val: { prim: string; args: any[]; annots: any[] }, - protected idx: number, - protected fac: TokenFactory - ) { - super(val, idx, fac); - } - - public ToBigMapKey(val: any) { - const decoded = b58decodeL2Address(val); - return { - key: { bytes: decoded }, - type: { prim: 'bytes' }, - }; - } - - /** - * @throws {@link TxRollupL2AddressValidationError} - */ - private validate(value: any) { - if (validateAddress(value) !== ValidationResult.VALID) { - throw new TxRollupL2AddressValidationError( - value, - this, - `tx_rollup_l2_address is not valid: ${JSON.stringify(value)}` - ); - } - } - - /** - * @throws {@link TxRollupL2AddressValidationError} - */ - public Encode(args: string[]): any { - const val = args.pop(); - if (!val) { - throw new TxRollupL2AddressValidationError( - val, - this, - `arg missing to encode: this -> "${JSON.stringify(val)}"` - ); - } - this.validate(val); - - return { string: val }; - } - - /** - * @throws {@link TxRollupL2AddressValidationError} - */ - public EncodeObject(val: any, semantic?: SemanticEncoding): any { - this.validate(val); - - if (semantic && semantic[TxRollupL2AddressToken.prim]) { - return semantic[TxRollupL2AddressToken.prim](val); - } - return { string: val }; - } - - /** - * @throws {@link TxRollupL2AddressValidationError} - */ - public Execute(val: { bytes?: string; string?: string }): string { - if (val.string) { - return val.string; - } - if (!val.bytes) { - throw new TxRollupL2AddressValidationError( - val, - this, - `value cannot be missing string and byte value. must have one ${JSON.stringify(val)}` - ); - } - return encodeL2Address(val.bytes); - } - public ExtractSchema() { - return TxRollupL2AddressToken.prim; - } - - generateSchema(): BaseTokenSchema { - return { - __michelsonType: TxRollupL2AddressToken.prim, - schema: TxRollupL2AddressToken.prim, - }; - } - - /** - * @throws {@link TxRollupL2AddressValidationError} - */ - public ToKey({ bytes, string }: { bytes?: string; string?: string }) { - if (string) { - return string; - } - if (!bytes) { - throw new TxRollupL2AddressValidationError( - bytes, - this, - `value cannot be missing string and byte value. must have one: bytes = ${JSON.stringify( - bytes - )}` - ); - } - return encodeL2Address(bytes); - } - - findAndReturnTokens(tokenToFind: string, tokens: Token[]): Token[] { - if (TxRollupL2AddressToken.prim === tokenToFind) { - tokens.push(this); - } - return tokens; - } -} diff --git a/packages/taquito-michelson-encoder/src/tokens/tokens.ts b/packages/taquito-michelson-encoder/src/tokens/tokens.ts index 8543e966e1..b0bb2640e3 100644 --- a/packages/taquito-michelson-encoder/src/tokens/tokens.ts +++ b/packages/taquito-michelson-encoder/src/tokens/tokens.ts @@ -12,8 +12,6 @@ import { MapToken } from './map'; import { BoolToken } from './comparable/bool'; -import { TxRollupL2AddressToken } from './comparable/tx_rollup_l2_address'; - import { OrToken } from './or'; import { ContractToken } from './contract'; @@ -51,7 +49,6 @@ export const tokens = [ StringToken, BigMapToken, AddressToken, - TxRollupL2AddressToken, MapToken, BoolToken, OrToken, diff --git a/packages/taquito-michelson-encoder/src/version.ts b/packages/taquito-michelson-encoder/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-michelson-encoder/src/version.ts +++ b/packages/taquito-michelson-encoder/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-michelson-encoder/test/tokens/address.spec.ts b/packages/taquito-michelson-encoder/test/tokens/address.spec.ts index 4f07f7af5b..c758103054 100644 --- a/packages/taquito-michelson-encoder/test/tokens/address.spec.ts +++ b/packages/taquito-michelson-encoder/test/tokens/address.spec.ts @@ -47,135 +47,3 @@ describe('Address token', () => { }); }); }); -describe('Address Token with txr1', () => { - let token: AddressToken; - beforeEach(() => { - token = new AddressToken({ prim: 'address', args: [], annots: [] }, 0, null as any); - }); - - describe('test ToBigMapKey', () => { - it('to bytes', () => { - expect(token.ToBigMapKey('txr1MfFbj6diPLS2MN2ntoid6cyuk4mUzLibP')).toEqual({ - key: { bytes: '02012e7a294c836eeb02010b907c2632b88ed3e23a00' }, - type: { prim: 'bytes' }, - }); - }); - }); - - describe('EncodeObject', () => { - it("should add string to object with key 'string'", () => { - expect(token.EncodeObject('txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL')).toEqual({ - string: 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL', - }); - }); - - it('test semantic', () => { - const val1 = token.EncodeObject('txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL', { - address: () => ({ string: 'tester' }), - }); - const val2 = token.EncodeObject('txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL', { - address: (arg) => ({ string: arg }), - }); - expect(val1).toEqual({ string: 'tester' }); - expect(val2).toEqual({ string: 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL' }); - }); - - it('should throw error with invalid args', () => { - expect(() => token.EncodeObject('txr1')).toThrowError(AddressValidationError); - expect(() => token.EncodeObject([])).toThrowError(AddressValidationError); - expect(() => token.EncodeObject({})).toThrowError(AddressValidationError); - expect(() => token.EncodeObject(1)).toThrowError(AddressValidationError); - expect(() => token.EncodeObject('tz4QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn')).toThrowError( - AddressValidationError - ); - }); - }); - - describe('Encode', () => { - it('should encode address to object with key "string"', () => { - expect(token.Encode(['txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL'])).toEqual({ - string: 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL', - }); - }); - it('should throw error if address not valid', () => { - expect(() => token.Encode(['something'])).toThrowError(AddressValidationError); - expect(() => token.Encode(['', '', '', ''])).toThrowError(AddressValidationError); - expect(() => token.Encode([])).toThrowError(AddressValidationError); - expect(() => token.Encode(['1'])).toThrowError(AddressValidationError); - try { - token.Encode(['async']); - } catch (ex) { - expect(ex.name).toEqual('AddressValidationError'); - } - }); - }); - describe('generateSchema', () => { - it('should generate properly', () => { - expect(token.generateSchema()).toEqual({ - __michelsonType: 'address', - schema: 'address', - }); - }); - }); - - describe('Execute', () => { - it('should throw if no bytes or string', () => { - expect(() => token.Execute({ string: '', bytes: '' })).toThrowError(AddressValidationError); - }); - it('should return string', () => { - expect(token.Execute({ string: 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL', bytes: '' })).toEqual( - 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL' - ); - expect( - token.Execute({ bytes: '02f16e732d45ba6f24d5ec421f20ab199b3a82907100', string: '' }) - ).toEqual('txr1jZaQfi9zdwzJteYkRBSN9D7RDvMh1QNkL'); - }); - }); - describe('Tokey', () => { - it('should change bytes to pkh', () => { - expect(token.ToKey({ bytes: '02012e7a294c836eeb02010b907c2632b88ed3e23a00' })).toEqual( - 'txr1MfFbj6diPLS2MN2ntoid6cyuk4mUzLibP' - ); - expect(token.ToKey({ string: 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL' })).toEqual( - 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL' - ); - }); - it('throw error if empty', () => { - expect(() => token.ToKey({ bytes: '', string: '' })).toThrowError(AddressValidationError); - }); - }); - describe('compare', () => { - it('should order addresses correctly', () => { - expect( - token.compare( - 'KT1CDEg2oY3VfMa1neB7hK5LoVMButvivKYv', - 'tz2Ch1abG7FNiibmV26Uzgdsnfni9XGrk5wD' - ) - ).toEqual(1); - expect( - token.compare( - 'tz3YjfexGakCDeCseXFUpcXPSAN9xHxE9TH2', - 'tz1ccqAEwfPgeoipnXtjAv1iucrpQv3DFmmS' - ) - ).toEqual(1); - expect( - token.compare( - 'KT1CDEg2oY3VfMa1neB7hK5LoVMButvivKYv', - 'KT1XM8VUFBiM9AC5czWU15fEeE9nmuEYWt3Y' - ) - ).toEqual(-1); - expect( - token.compare( - 'txr1YpFMKsYwTJ4YBmYqy2kw4pxCUgeQkZmwo', - 'txr1YpFMKsYwTJ4YBmYqy2kw4pxCUgeQkZmwo' - ) - ).toEqual(0); - }); - }); - describe('find return tokens', () => { - it('should return or not return token', () => { - expect(token.findAndReturnTokens('address', [])).toEqual([token]); - expect(token.findAndReturnTokens('tx_rollup_l2_address', [])).toEqual([]); - }); - }); -}); diff --git a/packages/taquito-michelson-encoder/test/tokens/contract.spec.ts b/packages/taquito-michelson-encoder/test/tokens/contract.spec.ts index 2c3b0a0a82..b8a9c71db2 100644 --- a/packages/taquito-michelson-encoder/test/tokens/contract.spec.ts +++ b/packages/taquito-michelson-encoder/test/tokens/contract.spec.ts @@ -1,4 +1,3 @@ -import { b58decode } from '@taquito/utils'; import { ContractToken, ContractValidationError } from './../../src/tokens/contract'; describe('Contract Token Tests', () => { @@ -13,46 +12,18 @@ describe('Contract Token Tests', () => { }); describe('EncodeObject', () => { - it('should encode address to string', () => { - expect(token.EncodeObject('txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL')).toEqual({ - string: 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL', - }); - }); - it('should throw error when improper args', () => { expect(() => token.EncodeObject('test')).toThrowError(ContractValidationError); expect(() => token.EncodeObject(0)).toThrowError(ContractValidationError); expect(() => token.EncodeObject([])).toThrowError(ContractValidationError); }); - - it('should handle semantics', () => { - expect( - token.EncodeObject('txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL', { - contract: () => ({ string: 'test' }), - }).string - ).toEqual('test'); - }); }); describe('execute', () => { - const decoded = b58decode('txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL'); - it('should return contract address', () => { - expect(token.Execute({ bytes: '', string: 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL' })).toEqual( - 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL' - ); - expect(token.Execute({ bytes: decoded, string: '' })).toEqual( - 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL' - ); - }); it('should throw error', () => { expect(() => token.Execute({ bytes: '', string: '' })).toThrowError(ContractValidationError); }); }); describe('Encode', () => { - it('should return string', () => { - expect(token.Encode(['txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL'])).toEqual({ - string: 'txr1XHHx4KH3asGN5CMpdqzQA3c7HkfniPRxL', - }); - }); it('should throw error', () => { expect(() => token.Encode(['test'])).toThrowError(ContractValidationError); expect(() => token.Encode([1])).toThrowError(ContractValidationError); diff --git a/packages/taquito-michelson-encoder/test/tokens/tx_rollup_l2_address.spec.ts b/packages/taquito-michelson-encoder/test/tokens/tx_rollup_l2_address.spec.ts deleted file mode 100644 index 3889c843a4..0000000000 --- a/packages/taquito-michelson-encoder/test/tokens/tx_rollup_l2_address.spec.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { b58decodeL2Address } from '@taquito/utils'; -import { - TxRollupL2AddressToken, - TxRollupL2AddressValidationError, -} from './../../src/tokens/comparable/tx_rollup_l2_address'; - -describe('TxRollupL2Address Token', () => { - let token: TxRollupL2AddressToken; - const bytes = b58decodeL2Address('tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf'); - beforeEach(() => { - token = new TxRollupL2AddressToken( - { prim: 'tx_rollup_l2_address', args: [], annots: [] }, - 0, - null as any - ); - }); - - describe('test ToBigMapKey', () => { - it('to email bytes', () => { - expect(token.ToBigMapKey('tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf')).toEqual({ - key: { bytes }, - type: { prim: 'bytes' }, - }); - }); - }); - - describe('EncodeObject', () => { - it('Should encode address to string', () => { - expect(token.EncodeObject('tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf')).toEqual({ - string: 'tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf', - }); - }); - - it('test semantic', () => { - const val = token.EncodeObject('tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf', { - tx_rollup_l2_address: () => ({ string: 'tester' }), - }); - const val2 = token.EncodeObject('tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf', { - tx_rollup_l2_address: (arg) => ({ string: arg }), - }); - expect(val).toEqual({ string: 'tester' }); - expect(val2).toEqual({ string: 'tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf' }); - }); - - it('Should throw a new validation error when address is not valid', () => { - expect(() => token.EncodeObject('tz4').toThrowError(TxRollupL2AddressValidationError)); - expect(() => - token - .EncodeObject('tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn') - .toThrowError(TxRollupL2AddressValidationError) - ); - expect(() => token.EncodeObject(1).toThrowError(TxRollupL2AddressValidationError)); - expect(() => token.EncodeObject([]).toThrowError(TxRollupL2AddressValidationError)); - }); - }); - - describe('Encode', () => { - it('Should encode address to string', () => { - expect(token.Encode(['tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf'])).toEqual({ - string: 'tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf', - }); - }); - - it('Should throw a validation error when address is not valid', () => { - expect(() => token.Encode(['test'])).toThrowError(TxRollupL2AddressValidationError); - expect(() => token.Encode([])).toThrowError(TxRollupL2AddressValidationError); - expect(() => token.Encode(['', '', '', ''])).toThrowError(TxRollupL2AddressValidationError); - expect(() => token.Encode(['1'])).toThrowError(TxRollupL2AddressValidationError); - - try { - token.Encode(['test']); - } catch (ex) { - expect(ex.name).toEqual('TxRollupL2AddressValidationError'); - } - }); - }); - - describe('generateSchema', () => { - it('Should generate the schema properly', () => { - expect(token.generateSchema()).toEqual({ - __michelsonType: 'tx_rollup_l2_address', - schema: 'tx_rollup_l2_address', - }); - }); - }); - describe('ToBigMapKey', () => { - it('should equal expected', () => { - expect(() => token.ToBigMapKey('')); - }); - }); - describe('Execute', () => { - it('should throw error if not bytes', () => { - expect(() => token.Execute({ string: '' })).toThrowError(TxRollupL2AddressValidationError); - expect(() => token.Execute({ bytes: '' })).toThrowError(TxRollupL2AddressValidationError); - expect(() => token.Execute({ bytes: '', string: '' })).toThrowError( - TxRollupL2AddressValidationError - ); - }); - it('should return string', () => { - expect(token.Execute({ bytes: '', string: 'tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf' })).toEqual( - 'tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf' - ); - }); - it('should return string', () => { - expect(token.Execute({ bytes })).toEqual('tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf'); - }); - }); - describe('ToKey', () => { - it('tz4 address should be returned', () => { - expect(token.ToKey({ bytes })).toEqual('tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf'); - expect(token.ToKey({ string: 'tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf' })).toEqual( - 'tz49XoaXbDZcWi2R1iKxQUxtBWXt4g4S1qtf' - ); - }); - it('should throw error when incorrect provided', () => { - expect(() => token.ToKey({ bytes: '' })).toThrowError(TxRollupL2AddressValidationError); - }); - }); - describe('extract schema', () => { - it('should be prim value of token', () => { - expect(token.ExtractSchema()).toEqual('tx_rollup_l2_address'); - }); - }); - describe('find return tokens', () => { - it('should return array with prim of this token', () => { - expect(token.findAndReturnTokens('tx_rollup_l2_address', [])).toEqual([token]); - expect(token.findAndReturnTokens('else', [])).toEqual([]); - }); - }); -}); diff --git a/packages/taquito-remote-signer/package.json b/packages/taquito-remote-signer/package.json index 5be29e19ed..14bf4e47ad 100644 --- a/packages/taquito-remote-signer/package.json +++ b/packages/taquito-remote-signer/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/remote-signer", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Remote signer provider", "keywords": [ "tezos", @@ -63,10 +63,10 @@ "dependencies": { "@stablelib/blake2b": "^1.0.1", "@stablelib/ed25519": "^1.0.3", - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "typedarray-to-buffer": "^4.0.0" }, "devDependencies": { diff --git a/packages/taquito-remote-signer/src/version.ts b/packages/taquito-remote-signer/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-remote-signer/src/version.ts +++ b/packages/taquito-remote-signer/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-rpc/package.json b/packages/taquito-rpc/package.json index bbcbc3e7c2..2a3179481a 100644 --- a/packages/taquito-rpc/package.json +++ b/packages/taquito-rpc/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/rpc", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Provides low level methods, and types to invoke RPC calls from a Nomadic Tezos RPC node", "keywords": [ "tezos", @@ -67,9 +67,9 @@ ] }, "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0" }, "devDependencies": { diff --git a/packages/taquito-rpc/src/opkind.ts b/packages/taquito-rpc/src/opkind.ts index b7e163d4b7..80b6a47c21 100644 --- a/packages/taquito-rpc/src/opkind.ts +++ b/packages/taquito-rpc/src/opkind.ts @@ -4,26 +4,23 @@ export enum OpKind { REVEAL = 'reveal', TRANSACTION = 'transaction', ACTIVATION = 'activate_account', + ATTESTATION = 'attestation', ENDORSEMENT = 'endorsement', + PREATTESTATION = 'preattestation', PREENDORSEMENT = 'preendorsement', SET_DEPOSITS_LIMIT = 'set_deposits_limit', + DOUBLE_PREATTESTATION_EVIDENCE = 'double_preattestation_evidence', DOUBLE_PREENDORSEMENT_EVIDENCE = 'double_preendorsement_evidence', + ATTESTATION_WITH_SLOT = 'attestation_with_slot', ENDORSEMENT_WITH_SLOT = 'endorsement_with_slot', SEED_NONCE_REVELATION = 'seed_nonce_revelation', + DOUBLE_ATTESTATION_EVIDENCE = 'double_attestation_evidence', DOUBLE_ENDORSEMENT_EVIDENCE = 'double_endorsement_evidence', DOUBLE_BAKING_EVIDENCE = 'double_baking_evidence', PROPOSALS = 'proposals', BALLOT = 'ballot', FAILING_NOOP = 'failing_noop', REGISTER_GLOBAL_CONSTANT = 'register_global_constant', - TX_ROLLUP_ORIGINATION = 'tx_rollup_origination', - TX_ROLLUP_SUBMIT_BATCH = 'tx_rollup_submit_batch', - TX_ROLLUP_COMMIT = 'tx_rollup_commit', - TX_ROLLUP_RETURN_BOND = 'tx_rollup_return_bond', - TX_ROLLUP_FINALIZE_COMMITMENT = 'tx_rollup_finalize_commitment', - TX_ROLLUP_REMOVE_COMMITMENT = 'tx_rollup_remove_commitment', - TX_ROLLUP_REJECTION = 'tx_rollup_rejection', - TX_ROLLUP_DISPATCH_TICKETS = 'tx_rollup_dispatch_tickets', TRANSFER_TICKET = 'transfer_ticket', INCREASE_PAID_STORAGE = 'increase_paid_storage', UPDATE_CONSENSUS_KEY = 'update_consensus_key', diff --git a/packages/taquito-rpc/src/rpc-client-interface.ts b/packages/taquito-rpc/src/rpc-client-interface.ts index f8e910a99c..61e8af9f7a 100644 --- a/packages/taquito-rpc/src/rpc-client-interface.ts +++ b/packages/taquito-rpc/src/rpc-client-interface.ts @@ -17,7 +17,9 @@ import { CurrentQuorumResponse, DelegateResponse, DelegatesResponse, + AttestationRightsQueryArguments, EndorsingRightsQueryArguments, + AttestationRightsResponse, EndorsingRightsResponse, EntrypointsResponse, ForgeOperationsParams, @@ -38,26 +40,25 @@ import { SaplingDiffResponse, ScriptResponse, StorageResponse, - TxRollupInboxResponse, - TxRollupStateResponse, UnparsingMode, VotesListingsResponse, VotingInfoResponse, VotingPeriodBlockResult, TicketTokenParams, AllTicketBalances, - PendingOperations, + PendingOperationsV1, + PendingOperationsV2, PendingOperationsQueryArguments, - OriginationProofParams, RPCSimulateOperationParam, } from './types'; export interface RPCOptions { block: string; + version?: '0' | '1'; } export const defaultChain = 'main'; -export const defaultRPCOptions: RPCOptions = { block: 'head' }; +export const defaultRPCOptions: RPCOptions = { block: 'head', version: '0' }; export interface RpcClientInterface { getBlockHash(options?: RPCOptions): Promise; @@ -85,6 +86,10 @@ export interface RpcClientInterface { args: BakingRightsQueryArguments, options?: RPCOptions ): Promise; + getAttestationRights( + args: AttestationRightsQueryArguments, + options?: RPCOptions + ): Promise; getEndorsingRights( args: EndorsingRightsQueryArguments, options?: RPCOptions @@ -118,12 +123,6 @@ export interface RpcClientInterface { getSaplingDiffById(id: string, options?: RPCOptions): Promise; getSaplingDiffByContract(contract: string, options?: RPCOptions): Promise; getProtocols(options?: RPCOptions): Promise; - getTxRollupState(txRollupId: string, options?: RPCOptions): Promise; - getTxRollupInbox( - txRollupId: string, - blockLevel: string, - options?: RPCOptions - ): Promise; getStorageUsedSpace(contract: string, options?: RPCOptions): Promise; getStoragePaidSpace(contract: string, options?: RPCOptions): Promise; getTicketBalance( @@ -132,8 +131,9 @@ export interface RpcClientInterface { options?: RPCOptions ): Promise; getAllTicketBalances(contract: string, options?: RPCOptions): Promise; - getPendingOperations(args: PendingOperationsQueryArguments): Promise; - getOriginationProof(params: OriginationProofParams, options?: RPCOptions): Promise; + getPendingOperations( + args: PendingOperationsQueryArguments + ): Promise; } export enum RPCMethodName { @@ -156,6 +156,7 @@ export enum RPCMethodName { GET_DELEGATE = 'getDelegate', GET_DELEGATES = 'getDelegates', GET_VOTING_INFO = 'getVotingInfo', + GET_ATTESTATION_RIGHTS = 'getAttestationRights', GET_ENDORSING_RIGHTS = 'getEndorsingRights', GET_ENTRYPOINTS = 'getEntrypoints', GET_LIVE_BLOCKS = 'getLiveBlocks', @@ -168,8 +169,6 @@ export enum RPCMethodName { GET_SCRIPT = 'getScript', GET_STORAGE = 'getStorage', GET_SUCCESSOR_PERIOD = 'getSuccessorPeriod', - GET_TX_ROLLUP_INBOX = 'getTxRollupInbox', - GET_TX_ROLLUP_STATE = 'getTxRollupState', GET_VOTES_LISTINGS = 'getVotesListings', PACK_DATA = 'packData', GET_STORAGE_USED_SPACE = 'getStorageUsedSpace', @@ -177,5 +176,4 @@ export enum RPCMethodName { GET_TICKET_BALANCE = 'getTicketBalance', GET_ALL_TICKET_BALANCES = 'getAllTicketBalances', GET_PENDING_OPERATIONS = 'getPendingOperations', - GET_ORIGINATION_PROOF = 'getOriginationProof', } diff --git a/packages/taquito-rpc/src/rpc-client-modules/rpc-cache.ts b/packages/taquito-rpc/src/rpc-client-modules/rpc-cache.ts index f39ff7e2fe..0b222b05d1 100644 --- a/packages/taquito-rpc/src/rpc-client-modules/rpc-cache.ts +++ b/packages/taquito-rpc/src/rpc-client-modules/rpc-cache.ts @@ -20,7 +20,9 @@ import { DelegateResponse, DelegatesResponse, VotingInfoResponse, + AttestationRightsQueryArguments, EndorsingRightsQueryArguments, + AttestationRightsResponse, EndorsingRightsResponse, EntrypointsResponse, ForgeOperationsParams, @@ -41,16 +43,14 @@ import { SaplingDiffResponse, ScriptResponse, StorageResponse, - TxRollupInboxResponse, - TxRollupStateResponse, UnparsingMode, VotesListingsResponse, VotingPeriodBlockResult, TicketTokenParams, AllTicketBalances, PendingOperationsQueryArguments, - PendingOperations, - OriginationProofParams, + PendingOperationsV1, + PendingOperationsV2, RPCSimulateOperationParam, } from '../types'; import { InvalidAddressError, InvalidContractAddressError } from '@taquito/core'; @@ -74,8 +74,8 @@ type RpcMethodParam = | BigMapKey | BakingRightsQueryArguments | PendingOperationsQueryArguments + | AttestationRightsQueryArguments | EndorsingRightsQueryArguments - | OriginationProofParams; const defaultTtl = 1000; @@ -91,7 +91,7 @@ export class RpcClientCache implements RpcClientInterface { * * @example new RpcClientCache(new RpcClient('https://mainnet.ecadinfra.com/')) */ - constructor(private rpcClient: RpcClientInterface, private ttl = defaultTtl) {} + constructor(private rpcClient: RpcClientInterface, private ttl = defaultTtl) { } getAllCachedData() { return this._cache; @@ -620,6 +620,33 @@ export class RpcClientCache implements RpcClientInterface { } } + /** + * + * @param args contains optional query arguments + * @param options contains generic configuration for rpc calls + * + * @description Retrieves the list of delegates allowed to bake a block. + * + * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-helpers-attestation-rights + */ + async getAttestationRights( + args: AttestationRightsQueryArguments = {}, + { block }: RPCOptions = defaultRPCOptions + ): Promise { + const key = this.formatCacheKey( + this.rpcClient.getRpcUrl(), + RPCMethodName.GET_ATTESTATION_RIGHTS, + [block, args] + ); + if (this.has(key)) { + return this.get(key); + } else { + const response = this.rpcClient.getAttestationRights(args, { block }); + this.put(key, response); + return response; + } + } + /** * * @param args contains optional query arguments @@ -871,7 +898,7 @@ export class RpcClientCache implements RpcClientInterface { * * @description Simulate an operation * - * @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/nairobi-openapi.json + * @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/oxford-openapi.json */ async simulateOperation( op: RPCSimulateOperationParam, @@ -1103,42 +1130,6 @@ export class RpcClientCache implements RpcClientInterface { } } - async getTxRollupState( - txRollupId: string, - { block }: { block: string } = defaultRPCOptions - ): Promise { - const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), RPCMethodName.GET_TX_ROLLUP_STATE, [ - block, - txRollupId, - ]); - if (this.has(key)) { - return this.get(key); - } else { - const response = this.rpcClient.getTxRollupState(txRollupId, { block }); - this.put(key, response); - return response; - } - } - - async getTxRollupInbox( - txRollupId: string, - blockLevel: string, - { block }: { block: string } = defaultRPCOptions - ): Promise { - const key = this.formatCacheKey(this.rpcClient.getRpcUrl(), RPCMethodName.GET_TX_ROLLUP_INBOX, [ - block, - txRollupId, - blockLevel, - ]); - if (this.has(key)) { - return this.get(key); - } else { - const response = this.rpcClient.getTxRollupInbox(txRollupId, blockLevel, { block }); - this.put(key, response); - return response; - } - } - /** * * @param contract address of the contract we want to retrieve storage information of @@ -1255,7 +1246,7 @@ export class RpcClientCache implements RpcClientInterface { */ async getPendingOperations( args: PendingOperationsQueryArguments = {} - ): Promise { + ): Promise { const key = this.formatCacheKey( this.rpcClient.getRpcUrl(), RPCMethodName.GET_PENDING_OPERATIONS, @@ -1269,28 +1260,4 @@ export class RpcClientCache implements RpcClientInterface { return response; } } - - /** - * - * @param params contains the PVM kind and kernel to generate the origination proof from - * @description rpc call to generate the origination proof needed for the smart rollup originate operation - * @see https://tezos.gitlab.io/protocols/016_mumbai.html#rpc-changes - */ - async getOriginationProof( - params: OriginationProofParams, - { block }: RPCOptions = defaultRPCOptions - ): Promise { - const key = this.formatCacheKey( - this.rpcClient.getRpcUrl(), - RPCMethodName.GET_ORIGINATION_PROOF, - [block, params] - ); - if (this.has(key)) { - return this.get(key); - } else { - const response = this.rpcClient.getOriginationProof(params, { block }); - this.put(key, response); - return response; - } - } } diff --git a/packages/taquito-rpc/src/taquito-rpc.ts b/packages/taquito-rpc/src/taquito-rpc.ts index 58e7d9514f..cea105a22c 100644 --- a/packages/taquito-rpc/src/taquito-rpc.ts +++ b/packages/taquito-rpc/src/taquito-rpc.ts @@ -29,7 +29,9 @@ import { DelegateResponse, DelegatesResponse, VotingInfoResponse, + AttestationRightsQueryArguments, EndorsingRightsQueryArguments, + AttestationRightsResponse, EndorsingRightsResponse, EntrypointsResponse, ForgeOperationsParams, @@ -55,13 +57,11 @@ import { UnparsingMode, VotesListingsResponse, VotingPeriodBlockResult, - TxRollupStateResponse, - TxRollupInboxResponse, TicketTokenParams, AllTicketBalances, PendingOperationsQueryArguments, - PendingOperations, - OriginationProofParams, + PendingOperationsV1, + PendingOperationsV2, RPCSimulateOperationParam, } from './types'; import { castToBigNumber } from './utils/utils'; @@ -130,7 +130,7 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Get the block's hash, its unique identifier. * @@ -146,7 +146,7 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description List the ancestors of the given block which, if referred to as the branch in an operation header, are recent enough for that operation to be included in the current block. * @@ -163,7 +163,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param address address from which we want to retrieve the balance - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the balance of a contract. * @@ -186,7 +186,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param address contract address from which we want to retrieve the storage - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the data of the contract. * @@ -231,7 +231,7 @@ export class RpcClient implements RpcClientInterface { * * @param address contract address from which we want to retrieve the script * @param unparsingMode default is { unparsing_mode: "Readable" } - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the script of the contract and normalize it using the requested unparsing mode. * @@ -256,7 +256,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param address contract address from which we want to retrieve - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the complete status of a contract. * @@ -280,7 +280,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param address contract address from which we want to retrieve the manager - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the manager key of a contract. * @@ -302,7 +302,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param address contract address from which we want to retrieve the delegate (baker) - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the delegate of a contract, if any. * @@ -334,7 +334,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param address contract address from which we want to retrieve the big map key - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the value associated with a key in the big map storage of the contract. * @@ -363,7 +363,7 @@ export class RpcClient implements RpcClientInterface { * * @param id Big Map ID * @param expr Expression hash to query (A b58check encoded Blake2b hash of the expression (The expression can be packed using the pack_data method)) - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the value associated with a key in a big map. * @@ -383,7 +383,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param address delegate address which we want to retrieve - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Fetches information about a delegate from RPC. * @@ -400,15 +400,15 @@ export class RpcClient implements RpcClientInterface { }); const castedResponse: any = castToBigNumber(response, [ - 'balance', 'full_balance', 'current_frozen_deposits', 'frozen_deposits', - 'frozen_balance', - 'frozen_deposits_limit', 'staking_balance', 'delegated_balance', 'voting_power', + 'balance', + 'frozen_balance', + 'frozen_deposits_limit', ]); return { @@ -437,7 +437,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param address delegate address which we want to retrieve - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Returns the delegate info (e.g. voting power) found in the listings of the current voting period. * @@ -459,7 +459,7 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description All constants * @@ -509,19 +509,20 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls. See examples for various available sytaxes. + * @param options contains generic configuration for rpc calls to specify block and version. * * @description All the information about a block * * @see https://tezos.gitlab.io/api/rpc.html#get-block-id - * @example getBlock() will default to /main/chains/block/head. - * @example getBlock({ block: head~2 }) will return an offset of 2 blocks. - * @example getBlock({ block: BL8fTiWcSxWCjiMVnDkbh6EuhqVPZzgWheJ2dqwrxYRm9AephXh~2 }) will return an offset of 2 blocks from given block hash.. + * @example getBlock() will default to /main/chains/block/head?version=0. version=0 shows { kind: endorsement } + * @example getBlock({ version: 1 }) will return /main/chains/block/head?version=1. version=1 shows { kind: attestation } + * @example getBlock({ block: head~2 }) will return an offset of 2 blocks and default version 0. */ - async getBlock({ block }: RPCOptions = defaultRPCOptions): Promise { + async getBlock({ block, version }: RPCOptions = defaultRPCOptions): Promise { const response = await this.httpBackend.createRequest({ url: this.createURL(`/chains/${this.chain}/blocks/${block}`), method: 'GET', + query: { version }, }); return response; @@ -529,7 +530,7 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description The whole block header * @@ -546,16 +547,20 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block and version. * * @description All the metadata associated to the block * * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-metadata */ - async getBlockMetadata({ block }: RPCOptions = defaultRPCOptions): Promise { + async getBlockMetadata({ + block, + version, + }: RPCOptions = defaultRPCOptions): Promise { const response = await this.httpBackend.createRequest({ url: this.createURL(`/chains/${this.chain}/blocks/${block}/metadata`), method: 'GET', + query: { version }, }); return response; @@ -564,7 +569,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param args contains optional query arguments - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Retrieves the list of delegates allowed to bake a block. * @@ -586,7 +591,29 @@ export class RpcClient implements RpcClientInterface { /** * * @param args contains optional query arguments - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block + * + * @description Retrieves the delegates allowed to attest a block. + * + * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-helpers-attestation-rights + */ + async getAttestationRights( + args: AttestationRightsQueryArguments = {}, + { block }: RPCOptions = defaultRPCOptions + ): Promise { + const response = await this.httpBackend.createRequest({ + url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/attestation_rights`), + method: 'GET', + query: args, + }); + + return response; + } + + /** + * + * @param args contains optional query arguments + * @param options contains generic configuration for rpc calls to specify block * * @description Retrieves the list of delegates allowed to bake a block. * @@ -606,7 +633,7 @@ export class RpcClient implements RpcClientInterface { } /** - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Ballots casted so far during a voting period * @@ -623,7 +650,7 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Sum of ballots casted so far during a voting period. * @@ -641,7 +668,7 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Current proposal under evaluation. * @@ -660,7 +687,7 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Current expected quorum. * @@ -679,7 +706,7 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description List of delegates with their voting weight, in number of rolls. * @@ -705,7 +732,7 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description List of proposals with number of supporters. * @@ -727,7 +754,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param data operation contents to forge - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Forge an operation returning the unsigned bytes * @@ -767,7 +794,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param ops Operations to apply - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block and version * * @description Simulate the validation of an operation * @@ -775,12 +802,13 @@ export class RpcClient implements RpcClientInterface { */ async preapplyOperations( ops: PreapplyParams, - { block }: RPCOptions = defaultRPCOptions + { block, version }: RPCOptions = defaultRPCOptions ): Promise { const response = await this.httpBackend.createRequest( { url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/preapply/operations`), method: 'POST', + query: { version }, }, ops ); @@ -791,9 +819,8 @@ export class RpcClient implements RpcClientInterface { /** * * @param contract address of the contract we want to get the entrypoints of - * + * @param options contains generic configuration for rpc calls to specify block * @description Return the list of entrypoints of the contract - * * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-entrypoints * * @version 005_PsBABY5H @@ -817,7 +844,7 @@ export class RpcClient implements RpcClientInterface { /** * @param op Operation to run - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block and version * * @description Run an operation without signature checks * @@ -825,12 +852,13 @@ export class RpcClient implements RpcClientInterface { */ async runOperation( op: RPCRunOperationParam, - { block }: RPCOptions = defaultRPCOptions + { block, version }: RPCOptions = defaultRPCOptions ): Promise { const response = await this.httpBackend.createRequest( { url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/scripts/run_operation`), method: 'POST', + query: { version }, }, op ); @@ -840,15 +868,15 @@ export class RpcClient implements RpcClientInterface { /** * @param op Operation to simulate - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block and version * * @description Simulate an operation on the blockchain * - * @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/nairobi-openapi.json + * @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/oxford-openapi.json */ async simulateOperation( op: RPCSimulateOperationParam, - { block }: RPCOptions = defaultRPCOptions + { block, version }: RPCOptions = defaultRPCOptions ): Promise { const response = await this.httpBackend.createRequest( { @@ -856,6 +884,7 @@ export class RpcClient implements RpcClientInterface { `/chains/${this.chain}/blocks/${block}/helpers/scripts/simulate_operation` ), method: 'POST', + query: { version }, }, op ); @@ -865,7 +894,7 @@ export class RpcClient implements RpcClientInterface { /** * @param code Code to run - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Run a piece of code in the current context * @@ -888,7 +917,7 @@ export class RpcClient implements RpcClientInterface { /** * @param viewScriptParams Parameters of the script view to run - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Simulate a call to a michelson view * @@ -913,7 +942,7 @@ export class RpcClient implements RpcClientInterface { /** * @param viewParams Parameters of the view to run - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Simulate a call to a view following the TZIP-4 standard. See https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-4/tzip-4.md#view-entrypoints. * @@ -944,7 +973,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param data Data to pack - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Computes the serialized version of a data expression using the same algorithm as script instruction PACK * Note: You should always verify the packed bytes before signing or requesting that they be signed when using the the RPC to pack. @@ -986,7 +1015,7 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Voting period of current block. * @@ -1007,7 +1036,7 @@ export class RpcClient implements RpcClientInterface { /** * - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Voting period of next block. * @@ -1029,7 +1058,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param id Sapling state ID - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the value associated with a sapling state ID. * @@ -1048,7 +1077,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param contract address of the contract we want to get the sapling diff - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the value associated with a sapling state. * @@ -1073,56 +1102,10 @@ export class RpcClient implements RpcClientInterface { }); } - /** - * - * @param tx_rollup_id the transaction rollup ID - * @param options contains generic configuration for rpc calls - * - * @description Access the state of a rollup - * - * @see https://tezos.gitlab.io/jakarta/rpc.html#get-block-id-context-tx-rollup-tx-rollup-id-state - */ - - async getTxRollupState( - txRollupId: string, - { block }: { block: string } = defaultRPCOptions - ): Promise { - return this.httpBackend.createRequest({ - url: this.createURL( - `/chains/${this.chain}/blocks/${block}/context/tx_rollup/${txRollupId}/state` - ), - method: 'GET', - }); - } - - /** - * - * @param tx_rollup_id the transaction rollup ID - * @param block_level the block level - * @param options contains generic configuration for rpc calls - * - * @description Access the inbox of a transaction rollup - * - * @see https://tezos.gitlab.io/jakarta/rpc.html#get-block-id-context-tx-rollup-tx-rollup-id-inbox-block-level - */ - - async getTxRollupInbox( - txRollupId: string, - blockLevel: string, - { block }: { block: string } = defaultRPCOptions - ): Promise { - return this.httpBackend.createRequest({ - url: this.createURL( - `/chains/${this.chain}/blocks/${block}/context/tx_rollup/${txRollupId}/inbox/${blockLevel}` - ), - method: 'GET', - }); - } - /** * * @param contract address of the contract we want to retrieve storage information of - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the amount of used space in a contract's storage * @@ -1143,7 +1126,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param contract address of the contract we want to retrieve storage information of - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * * @description Access the amount of paid space in a contract's storage * @@ -1165,7 +1148,7 @@ export class RpcClient implements RpcClientInterface { * * @param contract implicit or originated address we want to retrieve ticket balance of * @param ticket object to specify a ticket by ticketer, content type and content - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * @description Access the contract's balance of ticket with specified ticketer, content type, and content. * @example ticket { ticketer: 'address', content_type: { prim: "string" }, content: { string: 'ticket1' } } * @see https://tezos.gitlab.io/protocols/016_mumbai.html#rpc-changes @@ -1189,7 +1172,7 @@ export class RpcClient implements RpcClientInterface { /** * * @param contract originated address we want to retrieve ticket balances of - * @param options contains generic configuration for rpc calls + * @param options contains generic configuration for rpc calls to specify block * @description Access the complete list of tickets owned by the given contract by scanning the contract's storage. * @see https://tezos.gitlab.io/protocols/016_mumbai.html#rpc-changes */ @@ -1207,38 +1190,17 @@ export class RpcClient implements RpcClientInterface { /** * @description List the prevalidated operations in mempool (accessibility of mempool depends on each rpc endpoint) - * @param args has 5 optional properties. We support version 1 with new encoding as version 0 will be deprecated soon. The rest of the properties is to filter pending operations response + * @param args has 5 optional properties. We support version 1 as default will output { applied: { kind: endorsement} } version 2 will output { validated: { kind: attestation} }. The rest of the properties is to filter pending operations response * @default args { version: '1', applied: true, refused: true, outdated, true, branchRefused: true, branchDelayed: true, validationPass: undefined } * @see https://tezos.gitlab.io/CHANGES.html?highlight=pending_operations#id4 */ async getPendingOperations( args: PendingOperationsQueryArguments = {} - ): Promise { - return this.httpBackend.createRequest({ + ): Promise { + return this.httpBackend.createRequest({ url: this.createURL(`/chains/${this.chain}/mempool/pending_operations`), method: 'GET', query: args, }); } - - /** - * - * @param params contains the PVM kind and kernel to generate the origination proof from - * @description rpc call to generate the origination proof needed for a smart rollup originate operation - * @see https://tezos.gitlab.io/protocols/016_mumbai.html#rpc-changes - */ - async getOriginationProof( - params: OriginationProofParams, - { block }: { block: string } = defaultRPCOptions - ): Promise { - return this.httpBackend.createRequest( - { - url: this.createURL( - `/chains/${this.chain}/blocks/${block}/context/smart_rollups/all/origination_proof` - ), - method: 'POST', - }, - params - ); - } } diff --git a/packages/taquito-rpc/src/types.ts b/packages/taquito-rpc/src/types.ts index c459fb0b69..7922349de3 100644 --- a/packages/taquito-rpc/src/types.ts +++ b/packages/taquito-rpc/src/types.ts @@ -33,73 +33,15 @@ export type OtherElts = other_elts: OtherEltsInner; }; -type State = - | { - inode: Inode; - } - | { - other_elts: OtherElts; - }; - export interface Inode { length: string; proofs: [string | null, string | null]; } -type TxRollupProofContextHash = - | { - value: string; - } - | { - node: string; - }; - -export interface TxRollupProof { - version: number; - before: TxRollupProofContextHash; - after: TxRollupProofContextHash; - state: State[]; -} - -export interface TxRollupCommitment { - level: number; - messages: string[]; - predecessor?: string; - inbox_merkle_root: string; -} - -export interface TxRollupDeposit { - sender: string; - destination: string; - ticket_hash: string; - amount: string; -} - -export interface TxRollupMessage { - batch?: string; - deposit?: TxRollupDeposit; -} - -export interface TxRollupPreviousMessageResult { - context_hash: string; - withdraw_list_hash: string; -} - -export interface TxRollupTicketsInfo { - contents: MichelsonV1Expression; - ty: MichelsonV1Expression; - ticketer: string; - amount: string; - claimer: string; -} export interface DelegatesResponse { - balance?: BigNumber; full_balance?: BigNumber; current_frozen_deposits?: BigNumber; frozen_deposits?: BigNumber; - frozen_balance?: BigNumber; - frozen_balance_by_cycle?: Frozenbalancebycycle[]; - frozen_deposits_limit?: BigNumber; staking_balance: BigNumber; delegated_contracts: string[]; delegated_balance: BigNumber; @@ -107,10 +49,14 @@ export interface DelegatesResponse { grace_period: number; voting_power?: BigNumber; current_ballot?: BallotVote; - current_proposals?: string[]; remaining_proposals?: number; active_consensus_key?: string; pending_consensus_keys?: PendingConsensusKey[]; + balance?: BigNumber; + frozen_balance?: BigNumber; + frozen_balance_by_cycle?: Frozenbalancebycycle[]; + frozen_deposits_limit?: BigNumber; + current_proposals?: string[]; } export type PendingConsensusKey = { @@ -159,14 +105,32 @@ export interface BlockFullHeader { signature: string; } +export type InlinedAttestationKindEnum = OpKind.ATTESTATION; + export type InlinedEndorsementKindEnum = OpKind.ENDORSEMENT; +export interface InlinedAttestationContents { + kind: InlinedAttestationKindEnum; + slot: number; + level: number; + round: number; + block_payload_hash: string; +} + export interface InlinedEndorsementContents { kind: InlinedEndorsementKindEnum; - slot?: number; - round?: number; - block_payload_hash?: string; + slot: number; + level: number; + round: number; + block_payload_hash: string; +} + +export interface InlinedPreattestationContents { + kind: OpKind.PREATTESTATION; + slot: number; level: number; + round: number; + block_payload_hash: string; } export interface InlinedPreEndorsementContents { @@ -177,12 +141,24 @@ export interface InlinedPreEndorsementContents { block_payload_hash: string; } +export interface InlinedAttestation { + branch: string; + operations: InlinedAttestationContents; + signature?: string; +} + export interface InlinedEndorsement { branch: string; operations: InlinedEndorsementContents; signature?: string; } +export interface InlinedPreattestation { + branch: string; + operations: InlinedPreattestationContents; + signature?: string; +} + export interface InlinedPreEndorsement { branch: string; operations: InlinedPreEndorsementContents; @@ -191,6 +167,14 @@ export interface InlinedPreEndorsement { export type BallotVote = 'nay' | 'yay' | 'pass'; +export interface OperationContentsAttestation { + kind: OpKind.ATTESTATION; + slot: number; + level: number; + round: number; + block_payload_hash?: string; +} + export interface OperationContentsEndorsement { kind: OpKind.ENDORSEMENT; level: number; @@ -199,6 +183,14 @@ export interface OperationContentsEndorsement { block_payload_hash?: string; } +export interface OperationContentsPreattestation { + kind: OpKind.PREATTESTATION; + slot: number; + level: number; + round: number; + block_payload_hash: string; +} + export interface OperationContentsPreEndorsement { kind: OpKind.PREENDORSEMENT; slot: number; @@ -207,6 +199,12 @@ export interface OperationContentsPreEndorsement { block_payload_hash: string; } +export interface OperationContentsDoublePreattestation { + kind: OpKind.DOUBLE_PREATTESTATION_EVIDENCE; + op1: InlinedPreattestation; + op2: InlinedPreattestation; +} + export interface OperationContentsDoublePreEndorsement { kind: OpKind.DOUBLE_PREENDORSEMENT_EVIDENCE; op1: InlinedPreEndorsement; @@ -223,12 +221,6 @@ export interface OperationContentsSetDepositsLimit { limit?: string; } -export interface OperationContentsEndorsementWithSlot { - kind: OpKind.ENDORSEMENT_WITH_SLOT; - endorsement: InlinedEndorsement; - slot: number; -} - export interface OperationContentsRevelation { kind: OpKind.SEED_NONCE_REVELATION; level: number; @@ -240,11 +232,16 @@ export interface OperationContentsVdfRevelation { solution: string[]; } +export interface OperationContentsDoubleAttestation { + kind: OpKind.DOUBLE_ATTESTATION_EVIDENCE; + op1: InlinedAttestation; + op2: InlinedAttestation; +} + export interface OperationContentsDoubleEndorsement { kind: OpKind.DOUBLE_ENDORSEMENT_EVIDENCE; op1: InlinedEndorsement; op2: InlinedEndorsement; - slot?: number; } export interface OperationContentsDoubleBaking { @@ -333,103 +330,6 @@ export interface OperationContentsRegisterGlobalConstant { value: MichelsonV1Expression; } -export interface OperationContentsTxRollupOrigination { - kind: OpKind.TX_ROLLUP_ORIGINATION; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - tx_rollup_origination: any; -} - -export interface OperationContentsTxRollupSubmitBatch { - kind: OpKind.TX_ROLLUP_SUBMIT_BATCH; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; - content: string; - burn_limit?: string; -} - -export interface OperationContentsTxRollupCommit { - kind: OpKind.TX_ROLLUP_COMMIT; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; - commitment: TxRollupCommitment; -} - -export interface OperationContentsTxRollupReturnBond { - kind: OpKind.TX_ROLLUP_RETURN_BOND; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; -} - -export interface OperationContentsTxRollupFinalizeCommitment { - kind: OpKind.TX_ROLLUP_FINALIZE_COMMITMENT; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; -} - -export interface OperationContentsTxRollupRemoveCommitment { - kind: OpKind.TX_ROLLUP_REMOVE_COMMITMENT; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; -} - -export interface OperationContentsTxRollupRejection { - kind: OpKind.TX_ROLLUP_REJECTION; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; - level: number; - message: TxRollupMessage; - message_position: string; - message_path: string[]; - message_result_hash: string; - message_result_path: string[]; - previous_message_result: TxRollupPreviousMessageResult; - previous_message_result_path: string[]; - proof: TxRollupProof | string; -} - -export interface OperationContentsTxRollupDispatchTickets { - kind: OpKind.TX_ROLLUP_DISPATCH_TICKETS; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - tx_rollup: string; - level: number; - context_hash: string; - message_index: number; - message_result_path: string[]; - tickets_info: TxRollupTicketsInfo[]; -} - export interface OperationContentsTransferTicket { kind: OpKind.TRANSFER_TICKET; source: string; @@ -482,7 +382,6 @@ export interface OperationContentsSmartRollupOriginate { storage_limit: string; pvm_kind: PvmKind; kernel: string; - origination_proof: string; parameters_ty: MichelsonV1Expression; } @@ -527,7 +426,6 @@ export interface OperationContentsSmartRollupCement { gas_limit: string; storage_limit: string; rollup: string; - commitment: string; } export interface OperationContentsSmartRollupRefute { @@ -565,11 +463,15 @@ export interface OperationContentsSmartRollupTimeout { } export type OperationContents = + | OperationContentsAttestation | OperationContentsEndorsement + | OperationContentsPreattestation | OperationContentsPreEndorsement + | OperationContentsDoublePreattestation | OperationContentsDoublePreEndorsement | OperationContentsRevelation | OperationContentsVdfRevelation + | OperationContentsDoubleAttestation | OperationContentsDoubleEndorsement | OperationContentsDoubleBaking | OperationContentsActivateAccount @@ -579,17 +481,9 @@ export type OperationContents = | OperationContentsTransaction | OperationContentsOrigination | OperationContentsDelegation - | OperationContentsEndorsementWithSlot | OperationContentsFailingNoop | OperationContentsRegisterGlobalConstant | OperationContentsSetDepositsLimit - | OperationContentsTxRollupOrigination - | OperationContentsTxRollupSubmitBatch - | OperationContentsTxRollupCommit - | OperationContentsTxRollupReturnBond - | OperationContentsTxRollupFinalizeCommitment - | OperationContentsTxRollupRemoveCommitment - | OperationContentsTxRollupRejection | OperationContentsTransferTicket | OperationContentsUpdateConsensusKey | OperationContentsDrainDelegate @@ -603,7 +497,14 @@ export type OperationContents = | OperationContentsSmartRollupRecoverBond | OperationContentsSmartRollupTimeout; -export interface OperationContentsAndResultMetadataExtended { +export interface OperationContentsAndResultMetadataExtended1 { + balance_updates?: OperationMetadataBalanceUpdates[]; + delegate: string; + consensus_power: number; + consensus_key: string; +} + +export interface OperationContentsAndResultMetadataExtended0 { balance_updates?: OperationMetadataBalanceUpdates[]; delegate: string; slots?: number[]; @@ -611,11 +512,18 @@ export interface OperationContentsAndResultMetadataExtended { consensus_key?: string; } +export interface OperationContentsAndResultMetadataPreattestation { + balance_updates?: OperationMetadataBalanceUpdates[]; + delegate: string; + consensus_power: number; + consensus_key: string; +} + export interface OperationContentsAndResultMetadataPreEndorsement { balance_updates?: OperationMetadataBalanceUpdates[]; delegate: string; preendorsement_power: number; - consensus_key?: string; + consensus_key: string; } export interface OperationContentsAndResultMetadataReveal { @@ -652,60 +560,12 @@ export interface OperationContentsAndResultMetadata { balance_updates?: OperationMetadataBalanceUpdates[]; } -export interface OperationContentsAndResultMetadataTxRollupOrigination { - balance_updates?: OperationMetadataBalanceUpdates[]; - operation_result: OperationResultTxRollupOrigination; - internal_operation_results?: InternalOperationResult[]; -} - -export interface OperationContentsAndResultMetadataTxRollupSubmitBatch { - balance_updates?: OperationMetadataBalanceUpdates[]; - operation_result: OperationResultTxRollupSubmitBatch; - internal_operation_results?: InternalOperationResult[]; -} - -export interface OperationContentsAndResultMetadataTxRollupCommit { - balance_updates?: OperationMetadataBalanceUpdates[]; - operation_result: OperationResultTxRollupCommit; - internal_operation_results?: InternalOperationResult[]; -} - -export interface OperationContentsAndResultMetadataTxRollupReturnBond { - balance_updates?: OperationMetadataBalanceUpdates[]; - operation_result: OperationResultTxRollupReturnBond; - internal_operation_results?: InternalOperationResult[]; -} - -export interface OperationContentsAndResultMetadataTxRollupFinalizeCommitment { - balance_updates?: OperationMetadataBalanceUpdates[]; - operation_result: OperationResultTxRollupFinalizeCommitment; - internal_operation_results?: InternalOperationResult[]; -} - -export interface OperationContentsAndResultMetadataTxRollupRemoveCommitment { - balance_updates?: OperationMetadataBalanceUpdates[]; - operation_result: OperationResultTxRollupRemoveCommitment; - internal_operation_results?: InternalOperationResult[]; -} - -export interface OperationContentsAndResultMetadataTxRollupRejection { - balance_updates?: OperationMetadataBalanceUpdates[]; - operation_result: OperationResultTxRollupRejection; - internal_operation_results?: InternalOperationResult[]; -} - export interface OperationContentsAndResultMetadataTransferTicket { balance_updates?: OperationMetadataBalanceUpdates[]; operation_result: OperationResultTransferTicket; internal_operation_results?: InternalOperationResult[]; } -export interface OperationContentsAndResultMetadataTxRollupDispatchTickets { - balance_updates?: OperationMetadataBalanceUpdates[]; - operation_result: OperationResultTxRollupDispatchTickets; - internal_operation_results?: InternalOperationResult[]; -} - export interface OperationContentsAndResultMetadataIncreasePaidStorage { balance_updates?: OperationMetadataBalanceUpdates[]; operation_result: OperationResultIncreasePaidStorage; @@ -771,13 +631,31 @@ export interface OperationContentsAndResultMetadataSmartRollupTimeout { internal_operation_results?: InternalOperationResult[]; } +export interface OperationContentsAndResultAttestation { + kind: OpKind.ATTESTATION; + slot: number; + level: number; + round: number; + block_payload_hash: string; + metadata: OperationContentsAndResultMetadataExtended1; +} + export interface OperationContentsAndResultEndorsement { kind: OpKind.ENDORSEMENT; - block_payload_hash?: string; + slot: number; level: number; - round?: number; - slot?: number; - metadata: OperationContentsAndResultMetadataExtended; + round: number; + block_payload_hash: string; + metadata: OperationContentsAndResultMetadataExtended0; +} + +export interface OperationContentsAndResultPreattestation { + kind: OpKind.PREATTESTATION; + slot: number; + level: number; + round: number; + block_payload_hash: string; + metadata: OperationContentsAndResultMetadataPreattestation; } export interface OperationContentsAndResultPreEndorsement { @@ -789,17 +667,24 @@ export interface OperationContentsAndResultPreEndorsement { metadata: OperationContentsAndResultMetadataPreEndorsement; } +export interface OperationContentsAndResultDoublePreattestation { + kind: OpKind.DOUBLE_PREATTESTATION_EVIDENCE; + op1: InlinedPreattestation; + op2: InlinedPreattestation; + metadata: OperationContentsAndResultMetadata; +} export interface OperationContentsAndResultDoublePreEndorsement { kind: OpKind.DOUBLE_PREENDORSEMENT_EVIDENCE; op1: InlinedPreEndorsement; op2: InlinedPreEndorsement; metadata: OperationContentsAndResultMetadata; } + export interface OperationContentsAndResultEndorsementWithSlot { kind: OpKind.ENDORSEMENT_WITH_SLOT; endorsement: InlinedEndorsement; slot: number; - metadata: OperationContentsAndResultMetadataExtended; + metadata: OperationContentsAndResultMetadataExtended0; } export interface OperationContentsAndResultRevelation { @@ -809,11 +694,17 @@ export interface OperationContentsAndResultRevelation { metadata: OperationContentsAndResultMetadata; } +export interface OperationContentsAndResultDoubleAttestation { + kind: OpKind.DOUBLE_ATTESTATION_EVIDENCE; + op1: InlinedAttestation; + op2: InlinedAttestation; + metadata: OperationContentsAndResultMetadata; +} + export interface OperationContentsAndResultDoubleEndorsement { kind: OpKind.DOUBLE_ENDORSEMENT_EVIDENCE; op1: InlinedEndorsement; op2: InlinedEndorsement; - slot?: number; metadata: OperationContentsAndResultMetadata; } @@ -903,95 +794,6 @@ export interface OperationContentsAndResultSetDepositsLimit { metadata: OperationContentsAndResultMetadataSetDepositsLimit; } -export interface OperationContentsAndResultTxRollupOrigination { - kind: OpKind.TX_ROLLUP_ORIGINATION; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - tx_rollup_origination: any; - metadata: OperationContentsAndResultMetadataTxRollupOrigination; -} - -export interface OperationContentsAndResultTxRollupSubmitBatch { - kind: OpKind.TX_ROLLUP_SUBMIT_BATCH; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; - content: string; - burn_limit?: string; - metadata: OperationContentsAndResultMetadataTxRollupSubmitBatch; -} - -export interface OperationContentsAndResultTxRollupCommit { - kind: OpKind.TX_ROLLUP_COMMIT; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; - commitment: TxRollupCommitment; - metadata: OperationContentsAndResultMetadataTxRollupCommit; -} - -export interface OperationContentsAndResultTxRollupReturnBond { - kind: OpKind.TX_ROLLUP_RETURN_BOND; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; - metadata: OperationContentsAndResultMetadataTxRollupReturnBond; -} - -export interface OperationContentsAndResultTxRollupFinalizeCommitment { - kind: OpKind.TX_ROLLUP_FINALIZE_COMMITMENT; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; - metadata: OperationContentsAndResultMetadataTxRollupFinalizeCommitment; -} - -export interface OperationContentsAndResultTxRollupRemoveCommitment { - kind: OpKind.TX_ROLLUP_REMOVE_COMMITMENT; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; - metadata: OperationContentsAndResultMetadataTxRollupRemoveCommitment; -} - -export interface OperationContentsAndResultTxRollupRejection { - kind: OpKind.TX_ROLLUP_REJECTION; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - rollup: string; - level: number; - message: TxRollupMessage; - message_position: string; - message_path: string[]; - message_result_hash: string; - message_result_path: string[]; - previous_message_result: TxRollupPreviousMessageResult; - previous_message_result_path: string[]; - proof: TxRollupProof | string; - metadata: OperationContentsAndResultMetadataTxRollupRejection; -} - export interface OperationContentsAndResultTransferTicket { kind: OpKind.TRANSFER_TICKET; source: string; @@ -1008,22 +810,6 @@ export interface OperationContentsAndResultTransferTicket { metadata: OperationContentsAndResultMetadataTransferTicket; } -export interface OperationContentsAndResultTxRollupDispatchTickets { - kind: OpKind.TX_ROLLUP_DISPATCH_TICKETS; - source: string; - fee: string; - counter: string; - gas_limit: string; - storage_limit: string; - tx_rollup: string; - level: number; - context_hash: string; - message_index: number; - message_result_path: string[]; - tickets_info: TxRollupTicketsInfo[]; - metadata: OperationContentsAndResultMetadataTxRollupDispatchTickets; -} - export interface OperationContentsAndResultUpdateConsensusKey { kind: OpKind.UPDATE_CONSENSUS_KEY; source: string; @@ -1070,7 +856,6 @@ export interface OperationContentsAndResultSmartRollupOriginate { storage_limit: string; pvm_kind: PvmKind; kernel: string; - origination_proof: string; parameters_ty: MichelsonV1Expression; metadata: OperationContentsAndResultMetadataSmartRollupOriginate; } @@ -1119,7 +904,6 @@ export interface OperationContentsAndResultSmartRollupCement { gas_limit: string; storage_limit: string; rollup: string; - commitment: string; metadata: OperationContentsAndResultMetadataSmartRollupCement; } @@ -1161,10 +945,14 @@ export interface OperationContentsAndResultSmartRollupTimeout { } export type OperationContentsAndResult = + | OperationContentsAndResultAttestation | OperationContentsAndResultEndorsement + | OperationContentsAndResultPreattestation | OperationContentsAndResultPreEndorsement + | OperationContentsAndResultDoublePreattestation | OperationContentsAndResultDoublePreEndorsement | OperationContentsAndResultRevelation + | OperationContentsAndResultDoubleAttestation | OperationContentsAndResultDoubleEndorsement | OperationContentsAndResultDoubleBaking | OperationContentsAndResultActivateAccount @@ -1177,14 +965,6 @@ export type OperationContentsAndResult = | OperationContentsAndResultEndorsementWithSlot | OperationContentsAndResultRegisterGlobalConstant | OperationContentsAndResultSetDepositsLimit - | OperationContentsAndResultTxRollupOrigination - | OperationContentsAndResultTxRollupSubmitBatch - | OperationContentsAndResultTxRollupCommit - | OperationContentsAndResultTxRollupDispatchTickets - | OperationContentsAndResultTxRollupReturnBond - | OperationContentsAndResultTxRollupFinalizeCommitment - | OperationContentsAndResultTxRollupRemoveCommitment - | OperationContentsAndResultTxRollupRejection | OperationContentsAndResultTransferTicket | OperationContentsAndResultIncreasePaidStorage | OperationContentsAndResultUpdateConsensusKey @@ -1261,10 +1041,20 @@ export interface BakingRightsResponseItem { export type BakingRightsResponse = BakingRightsResponseItem[]; +export type AttestationRightsArgumentsDelegate = string | string[]; +export type AttestationRightsArgumentsCycle = number | number[]; +export type AttestationRightsArgumentsLevel = number | number[]; export type EndorsingRightsArgumentsDelegate = string | string[]; export type EndorsingRightsArgumentsCycle = number | number[]; export type EndorsingRightsArgumentsLevel = number | number[]; +export interface AttestationRightsQueryArguments { + level?: AttestationRightsArgumentsLevel; + cycle?: AttestationRightsArgumentsCycle; + delegate?: AttestationRightsArgumentsDelegate; + consensus_key?: string; +} + export interface EndorsingRightsQueryArguments { level?: EndorsingRightsArgumentsLevel; cycle?: EndorsingRightsArgumentsCycle; @@ -1272,20 +1062,36 @@ export interface EndorsingRightsQueryArguments { consensus_key?: string; } +export interface AttestationRightsResponseItemDelegates { + delegate: string; + first_slot: number; + attestation_power: number; + consensus_key: string; +} + export interface EndorsingRightsResponseItemDelegates { delegate: string; first_slot: number; endorsing_power: number; - consensus_key?: string; + consensus_key: string; } + +export interface AttestationRightsResponseItem { + level: number; + delegates: AttestationRightsResponseItemDelegates[]; + estimated_time?: Date; +} + export interface EndorsingRightsResponseItem { level: number; + delegates: EndorsingRightsResponseItemDelegates[]; + estimated_time?: Date; delegate?: string; - delegates?: EndorsingRightsResponseItemDelegates[]; slots?: number[]; - estimated_time?: Date; } +export type AttestationRightsResponse = AttestationRightsResponseItem[]; + export type EndorsingRightsResponse = EndorsingRightsResponseItem[]; export type BallotListResponseEnum = 'nay' | 'yay' | 'pass'; @@ -1303,7 +1109,15 @@ export interface BallotsResponse { pass: BigNumber; } -export type PeriodKindResponse = 'proposal' | 'exploration' | 'cooldown' | 'promotion' | 'adoption'; +export type PeriodKindResponse = + | 'proposal' + | 'exploration' + | 'cooldown' + | 'promotion' + | 'adoption' + | 'testing_vote' + | 'testing' + | 'promotion_vote'; export type CurrentProposalResponse = string | null; @@ -1416,11 +1230,9 @@ export interface ScriptedContracts { export type BondId = | { smart_rollup?: never; - tx_rollup: string; } | { smart_rollup: string; - tx_rollup?: never; }; export interface OperationBalanceUpdatesItem { @@ -1466,75 +1278,6 @@ export type InternalOperationResultEnum = | OperationResultOrigination | OperationResultEvent; -export interface OperationResultTxRollupOrigination { - status: OperationResultStatusEnum; - balance_updates?: OperationBalanceUpdates; - consumed_gas?: string; - consumed_milligas?: string; - originated_rollup?: string; - errors?: TezosGenericOperationError[]; -} - -export interface OperationResultTxRollupSubmitBatch { - status: OperationResultStatusEnum; - balance_updates?: OperationBalanceUpdates; - consumed_gas?: string; - consumed_milligas?: string; - paid_storage_size_diff?: string; - errors?: TezosGenericOperationError[]; -} - -export interface OperationResultTxRollupDispatchTickets { - status: OperationResultStatusEnum; - balance_updates?: OperationBalanceUpdates; - consumed_gas?: string; - consumed_milligas?: string; - paid_storage_size_diff?: string; - errors?: TezosGenericOperationError[]; -} - -export interface OperationResultTxRollupCommit { - status: OperationResultStatusEnum; - balance_updates?: OperationBalanceUpdates; - consumed_gas?: string; - consumed_milligas?: string; - errors?: TezosGenericOperationError[]; -} - -export interface OperationResultTxRollupReturnBond { - status: OperationResultStatusEnum; - balance_updates?: OperationBalanceUpdates; - consumed_gas?: string; - consumed_milligas?: string; - errors?: TezosGenericOperationError[]; -} - -export interface OperationResultTxRollupFinalizeCommitment { - status: OperationResultStatusEnum; - balance_updates?: OperationBalanceUpdates; - consumed_gas?: string; - consumed_milligas?: string; - level?: number; - errors?: TezosGenericOperationError[]; -} - -export interface OperationResultTxRollupRemoveCommitment { - status: OperationResultStatusEnum; - balance_updates?: OperationBalanceUpdates; - consumed_gas?: string; - consumed_milligas?: string; - level?: number; - errors?: TezosGenericOperationError[]; -} - -export interface OperationResultTxRollupRejection { - status: OperationResultStatusEnum; - balance_updates?: OperationBalanceUpdates; - consumed_gas?: string; - consumed_milligas?: string; - errors?: TezosGenericOperationError[]; -} - export interface OperationResultTransferTicket { status: OperationResultStatusEnum; balance_updates?: OperationBalanceUpdates; @@ -1708,15 +1451,7 @@ export type OperationResult = | OperationResultSmartRollupRefute | OperationResultSmartRollupRecoverBond | OperationResultSmartRollupTimeout - | OperationResultSmartRollupExecuteOutboxMessage - | OperationResultTxRollupOrigination - | OperationResultTxRollupSubmitBatch - | OperationResultTxRollupDispatchTickets - | OperationResultTxRollupCommit - | OperationResultTxRollupReturnBond - | OperationResultTxRollupFinalizeCommitment - | OperationResultTxRollupRemoveCommitment - | OperationResultTxRollupRejection; + | OperationResultSmartRollupExecuteOutboxMessage; export interface OperationResultTransaction { status: OperationResultStatusEnum; @@ -1782,24 +1517,18 @@ export interface SuccessfulManagerOperationResult { export type MetadataBalanceUpdatesKindEnum = | 'contract' - | 'freezer' | 'accumulator' + | 'freezer' + | 'minted' | 'burned' - | 'commitment' - | 'minted'; + | 'commitment'; export enum METADATA_BALANCE_UPDATES_CATEGORY { - BAKING_REWARDS = 'baking rewards', - REWARDS = 'rewards', - FEES = 'fees', - DEPOSITS = 'deposits', - LEGACY_REWARDS = 'legacy_rewards', - LEGACY_FEES = 'legacy_fees', - LEGACY_DEPOSITS = 'legacy_deposits', BLOCK_FEES = 'block fees', + DEPOSITS = 'deposits', NONCE_REVELATION_REWARDS = 'nonce revelation rewards', - DOUBLE_SIGNING_EVIDENCE_REWARDS = 'double signing evidence rewards', ENDORSING_REWARDS = 'endorsing rewards', + BAKING_REWARDS = 'baking rewards', BAKING_BONUSES = 'baking bonuses', STORAGE_FEES = 'storage fees', PUNISHMENTS = 'punishments', @@ -1810,9 +1539,16 @@ export enum METADATA_BALANCE_UPDATES_CATEGORY { BOOTSTRAP = 'bootstrap', INVOICE = 'invoice', MINTED = 'minted', - TX_ROLLUP_REJECTION_REWARDS = 'tx_rollup_rejection_rewards', - TX_ROLLUP_REJECTION_PUNISHMENTS = 'tx_rollup_rejection_punishments', BONDS = 'bonds', + SMART_ROLLUP_REFUTATION_PUNISHMENTS = 'smart_rollup_refutation_punishments', + SMART_ROLLUP_REFUTATION_REWARDS = 'smart_rollup_refutation_rewards', + UNSTAKED_DEPOSITS = 'unstaked_deposits', + REWARDS = 'rewards', + FEES = 'fees', + LEGACY_REWARDS = 'legacy_rewards', + LEGACY_FEES = 'legacy_fees', + LEGACY_DEPOSITS = 'legacy_deposits', + DOUBLE_SIGNING_EVIDENCE_REWARDS = 'double signing evidence rewards', } export type MetadataBalanceUpdatesCategoryEnum = METADATA_BALANCE_UPDATES_CATEGORY; @@ -1820,15 +1556,16 @@ export type MetadataBalanceUpdatesOriginEnum = 'block' | 'migration' | 'subsidy' export interface OperationMetadataBalanceUpdates { kind: MetadataBalanceUpdatesKindEnum; - category?: MetadataBalanceUpdatesCategoryEnum; contract?: string; + change: string; + origin: MetadataBalanceUpdatesOriginEnum; + category?: MetadataBalanceUpdatesCategoryEnum; + staker?: { contract?: string; delegate: string }; delegate?: string; participation?: boolean; revelation?: boolean; committer?: string; cycle?: number; - change: string; - origin?: MetadataBalanceUpdatesOriginEnum; } export type OperationResultStatusEnum = 'applied' | 'failed' | 'skipped' | 'backtracked'; @@ -1917,6 +1654,7 @@ export interface OperationContentsAndResultMetadataOrigination { } export type ConstantsResponse = ConstantsResponseCommon & + ConstantsResponseProto018 & ConstantsResponseProto017 & ConstantsResponseProto016 & ConstantsResponseProto015 & @@ -1960,6 +1698,66 @@ export interface ConstantsResponseCommon { export type Ratio = { numerator: number; denominator: number }; +export interface ConstantsResponseProto018 + extends Omit< + ConstantsResponseProto017, + | 'baking_reward_bonus_per_slot' + | 'baking_reward_fixed_portion' + | 'double_baking_punishment' + | 'endorsing_reward_per_slot' + | 'frozen_deposits_percentage' + | 'liquidity_baking_subsidy' + | 'ratio_of_frozen_deposits_slashed_per_double_endorsement' + | 'seed_nonce_revelation_tip' + | 'tx_rollup_commitment_bond' + | 'tx_rollup_cost_per_byte_ema_factor' + | 'tx_rollup_enable' + | 'tx_rollup_finality_period' + | 'tx_rollup_hard_size_limit_per_inbox' + | 'tx_rollup_hard_size_limit_per_message' + | 'tx_rollup_max_commitments_count' + | 'tx_rollup_max_inboxes_count' + | 'tx_rollup_max_messages_per_inbox' + | 'tx_rollup_max_ticket_payload_size' + | 'tx_rollup_max_withdrawals_per_batch' + | 'tx_rollup_origination_size' + | 'tx_rollup_rejection_max_proof_size' + | 'tx_rollup_sunset_level' + | 'tx_rollup_withdraw_period' + > { + adaptive_issuance_launch_ema_threshold: number; + adaptive_rewards_params: { + center_dz: Ratio; + growth_rate: string; + issuance_ratio_max: Ratio; + issuance_ratio_min: Ratio; + max_bonus: string; + radius_dz: Ratio; + }; + edge_of_staking_over_delegation: number; + global_limit_of_staking_over_baking: number; + issuance_weights: { + attesting_reward_weight: number; + baking_reward_bonus_weight: number; + baking_reward_fixed_portion_weight: number; + base_total_issued_per_minute: string; + liquidity_baking_subsidy_weight: number; + seed_nonce_revelation_tip_weight: number; + vdf_revelation_tip_weight: number; + }; + limit_of_delegation_over_baking: number; + minimal_frozen_stake: string; + percentage_of_frozen_deposits_slashed_per_double_attestation: number; + percentage_of_frozen_deposits_slashed_per_double_baking: number; + smart_rollup_reveal_activation_level: { + dal_page: number; + metadata: number; + raw_data: { + Blake2B: number; + }; + }; + zk_rollup_max_ticket_payload_size: number; +} export type ConstantsResponseProto017 = ConstantsResponseProto016; export interface ConstantsResponseProto016 @@ -2333,47 +2131,15 @@ export type ProtocolsResponse = { next_protocol: string; }; -export type Next = - | { - next: number; - } - | { - newest: number; - oldest: number; - }; - -export type LastRemovedCommitmentHashes = { - last_message_hash: string; - commitment_hash: string; -}; -export interface TxRollupStateResponse { - last_removed_commitment_hashes?: LastRemovedCommitmentHashes; - finalized_commitments: Next; - unfinalized_commitments: Next; - uncommitted_inboxes: Next; - commitment_newest_hash?: string; - tezos_head_level?: number; - burn_per_byte: string; - allocated_storage: string; - occupied_storage: string; - inbox_ema: number; - commitments_watermark?: number; -} - -export interface TxRollupInboxResponse { - inbox_length: number; - cumulated_size: number; - merkle_root: string; -} - export interface PendingOperationsQueryArguments { - version?: '1'; - applied?: boolean; + version?: '1' | '2'; + validated?: boolean; refused?: boolean; outdated?: boolean; branchRefused?: boolean; branchDelayed?: boolean; validationPass?: '0' | '1' | '2' | '3'; + applied?: boolean; } type FailedProcessedOperation = Pick< @@ -2383,7 +2149,7 @@ type FailedProcessedOperation = Pick< error: TezosGenericOperationError[]; }; -export interface PendingOperations { +export interface PendingOperationsV1 { applied: Pick[]; refused: FailedProcessedOperation[]; outdated: FailedProcessedOperation[]; @@ -2392,16 +2158,20 @@ export interface PendingOperations { unprocessed: Pick[]; } +export interface PendingOperationsV2 { + validated: Pick[]; + refused: FailedProcessedOperation[]; + outdated: FailedProcessedOperation[]; + branch_refused: FailedProcessedOperation[]; + branch_delayed: FailedProcessedOperation[]; + unprocessed: Pick[]; +} + export enum PvmKind { WASM2 = 'wasm_2_0_0', ARITH = 'arith', } -export interface OriginationProofParams { - kind: PvmKind; - kernel: string; -} - export interface SmartRollupPublishCommitment { compressed_state: string; inbox_level: number; diff --git a/packages/taquito-rpc/src/version.ts b/packages/taquito-rpc/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-rpc/src/version.ts +++ b/packages/taquito-rpc/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-rpc/test/data/rpc-responses.ts b/packages/taquito-rpc/test/data/rpc-responses.ts index c0b01d97cb..11da795e14 100644 --- a/packages/taquito-rpc/test/data/rpc-responses.ts +++ b/packages/taquito-rpc/test/data/rpc-responses.ts @@ -2323,53 +2323,138 @@ export const constants = { max_anon_ops_per_block: 132, max_operation_data_length: 32768, max_proposals_per_delegate: 20, + max_micheline_node_count: 50000, + max_micheline_bytes_limit: 50000, + max_allowed_global_constants_depth: 10000, + cache_layout_size: 3, + michelson_maximum_type_size: 2001, + smart_rollup_max_wrapped_proof_binary_size: 30000, + smart_rollup_message_size_limit: 4096, + smart_rollup_max_number_of_messages_per_level: '1000000', preserved_cycles: 3, - blocks_per_cycle: 4096, - blocks_per_commitment: 32, - blocks_per_roll_snapshot: 256, - blocks_per_voting_period: 20480, - time_between_blocks: [new BigNumber(30), new BigNumber(20)], - endorsers_per_block: 256, + blocks_per_cycle: 8192, + blocks_per_commitment: 64, + nonce_revelation_threshold: 512, + blocks_per_stake_snapshot: 512, + cycles_per_voting_period: 1, hard_gas_limit_per_operation: new BigNumber(1040000), - hard_gas_limit_per_block: new BigNumber(5200000), - proof_of_work_threshold: new BigNumber(70368744177663), - minimal_stake: new BigNumber(8000000000), - michelson_maximum_type_size: 1000, - seed_nonce_revelation_tip: new BigNumber(125000), + hard_gas_limit_per_block: new BigNumber(2600000), + proof_of_work_threshold: new BigNumber(-1), + minimal_stake: new BigNumber(6000000000), + minimal_frozen_stake: '600000000', + vdf_difficulty: new BigNumber(10000000000), origination_size: 257, - block_security_deposit: new BigNumber(640000000), - endorsement_security_deposit: new BigNumber(2500000), - baking_reward_per_endorsement: [new BigNumber(78125), new BigNumber(11719)], - endorsement_reward: [new BigNumber(78125), new BigNumber(52083)], + issuance_weights: { + base_total_issued_per_minute: '85007812', + baking_reward_fixed_portion_weight: 5120, + baking_reward_bonus_weight: 5120, + attesting_reward_weight: 10240, + liquidity_baking_subsidy_weight: 1280, + seed_nonce_revelation_tip_weight: 1, + vdf_revelation_tip_weight: 1, + }, cost_per_byte: new BigNumber(250), hard_storage_limit_per_operation: new BigNumber(60000), quorum_min: 2000, quorum_max: 7000, min_proposal_quorum: 500, - initial_endorsers: 192, - delay_per_missing_endorsement: new BigNumber(4), - minimal_block_delay: new BigNumber(15), - liquidity_baking_subsidy: new BigNumber(2500000), - liquidity_baking_sunset_level: 2032928, - liquidity_baking_escape_ema_threshold: 1000000, + liquidity_baking_toggle_ema_threshold: 1000000000, + max_operations_time_to_live: 240, + minimal_block_delay: new BigNumber(8), + delay_increment_per_round: new BigNumber(3), + consensus_committee_size: 7000, + consensus_threshold: 4667, + minimal_participation_ratio: { + numerator: 2, + denominator: 3, + }, + max_slashing_period: 2, + limit_of_delegation_over_baking: 9, + percentage_of_frozen_deposits_slashed_per_double_baking: 10, + percentage_of_frozen_deposits_slashed_per_double_attestation: 50, + testnet_dictator: 'tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8', + cache_script_size: 100000000, + cache_stake_distribution_cycles: 8, + cache_sampler_state_cycles: 8, + dal_parametric: { + feature_enable: false, + number_of_slots: 256, + attestation_lag: 4, + attestation_threshold: 50, + blocks_per_epoch: 8, + redundancy_factor: 16, + page_size: 4096, + slot_size: 1048576, + number_of_shards: 2048, + }, + smart_rollup_enable: true, + smart_rollup_arith_pvm_enable: false, + smart_rollup_origination_size: 6314, + smart_rollup_challenge_window_in_blocks: 40, + smart_rollup_stake_amount: '10000000000', + smart_rollup_commitment_period_in_blocks: 20, + smart_rollup_max_lookahead_in_blocks: 30000, + smart_rollup_max_active_outbox_levels: 20160, + smart_rollup_max_outbox_messages_per_level: 100, + smart_rollup_number_of_sections_in_dissection: 32, + smart_rollup_timeout_period_in_blocks: 500, + smart_rollup_max_number_of_cemented_commitments: 5, + smart_rollup_max_number_of_parallel_games: 32, + smart_rollup_reveal_activation_level: { + dal_page: 2147483646, + metadata: 0, + raw_data: { + Blake2B: 0, + }, + }, + zk_rollup_enable: false, + zk_rollup_origination_size: 4000, + zk_rollup_min_pending_to_process: 10, + zk_rollup_max_ticket_payload_size: 2048, + global_limit_of_staking_over_baking: 5, + edge_of_staking_over_delegation: 2, + adaptive_issuance_launch_ema_threshold: 100000000, + adaptive_rewards_params: { + issuance_ratio_min: { + numerator: '1', + denominator: '2000', + }, + issuance_ratio_max: { + numerator: '1', + denominator: '20', + }, + max_bonus: '50000000000000', + growth_rate: '115740740', + center_dz: { + numerator: '1', + denominator: '2', + }, + radius_dz: { + numerator: '1', + denominator: '50', + }, + }, }; + export const blockHeader = { - protocol: 'PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV', - chain_id: 'NetXz969SFaFn8k', - hash: 'BMZXDPn8kKMCSXX1ZfpkCHBuSeXkwqbEp3MJtEwNB21TNVC3Gsp', - level: 516500, + protocol: 'ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8', + chain_id: 'NetXH6zDyMzRsUy', + hash: 'BLgooF9wJXXMhAYMYF7d5A78AJyT4mLDoyQx4qt5JHevQfdnq5R', + level: 326182, proto: 2, - predecessor: 'BM4FhgGT16ikghoVoz1WoG5z2pmo24GC9sTrfMk5UB4KEnzjNTu', - timestamp: '2021-09-27T20:41:55Z', + predecessor: 'BMGK9uiSyg9j6imoh1bBCmNizKgVHoQL2HaJELJJNVGG2fsBj4M', + timestamp: '2023-09-21T20:26:58Z', validation_pass: 4, - operations_hash: 'LLoZRW4irfmyGwY5ufakDd52aA1P6bVhn3zpjBbQxdjPvwjeEaDkK', - fitness: ['01', '000000000007e193'], - context: 'CoWX5BdtfTGKmmwpwhF9cpU6SqBmP5MqostAPP6b3oZp94PG9V2S', - priority: 0, - proof_of_work_nonce: '36055190bec80200', - liquidity_baking_escape_vote: false, + operations_hash: 'LLobF9ZUVRpBqhTFAnE4jmDwMufEEP35v2EuEgWyfqc1HJo32JjZs', + fitness: ['02', '0004fa26', '00000000', 'ffffffff', '00000001'], + context: 'CoV2VS8Kfq3p2JhmKAfZZWNEHDpr7thYMsEkHjwjHQzKYbqLjgmt', + payload_hash: 'vh2w1osGnghEun7bR46KFEkBxNmAYmZ3rN1GdYYEwT6i2vn8159e', + payload_round: 0, + proof_of_work_nonce: 'f59e1b0e00000000', + liquidity_baking_toggle_vote: 'pass', + adaptive_issuance_vote: 'on', signature: - 'sigXwcYckn43nA9uqFKKTqFbkiyhBdKfRd8mbCWHnk4kFqis7unT4VJozBrT7f1pVZNUnTPwHYBqarCdVTRajj5bhWg4qGSF', + 'sigecgpR9FnpDBFSWkMenKCoim1FSS7wXYEsNPGBrEYvCfoqmYnsMsKcpKH8xqLgY7TwK5yhfACE9v3r1LsHivXZtYTbFnRm', }; export const bakingRights = [ @@ -2446,6 +2531,20 @@ export const blockMetadata = { }, ], }; +export const attestationRights = [ + { + level: 326268, + delegates: [ + { + delegate: 'tz1Z8Uy81ATY4Hb95zckc4J6uHdhFnbKSGuv', + first_slot: 4870, + attestation_power: 1, + consensus_key: 'tz1Z8Uy81ATY4Hb95zckc4J6uHdhFnbKSGuv', + }, + ], + }, +]; + export const endorsingRights = [ { level: 516500, @@ -3434,29 +3533,29 @@ export const blockIthacanetResponse = { ], }; -export const blockJakartanetResponse = { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'BLivfHQoHCtixrwXCNnsMQj33F3mLukQBBh4KoJ9AT6ADvLz7Ev', +export const blockKathmandunetResponse = { + protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', + chain_id: 'NetXi2ZagzEsXbZ', + hash: 'BLHBkJLRFwRhs1Nvrbrf8gVnVgSxx5515iTdizVnagm97baSXNF', header: { - level: 63401, + level: 133163, proto: 2, - predecessor: 'BLzrD8thayxjzCxQAy2y3WYg7Rqvh59V3FX2UpDZdNkoeutt935', - timestamp: '2022-05-09T22:46:29Z', + predecessor: 'BMD5idn9K4pGGAk9EbXBgUicYzTeDJLhY2a75Xfq6WNfahiRWZy', + timestamp: '2022-08-24T17:48:35Z', validation_pass: 4, - operations_hash: 'LLoaagEt9R7Tujwg4rnn5asisJ1e1cnnvN7aqvTmX4cr8i9jK5qjE', - fitness: ['02', '0000f7a9', '', 'ffffffff', '00000000'], - context: 'CoVAg76cML89Kqfgcsir6EPNjs6aTjB7ESWaTBSJsCUys4tzoDf2', - payload_hash: 'vh2RohN1n4qVrPifqwdhvPty2qFmeHfhhKWh7qwJF5vQHuze25Jz', - payload_round: 0, - proof_of_work_nonce: '4abb58b400000000', - liquidity_baking_toggle_vote: 'off', + operations_hash: 'LLobDJY3zxBWiCiHUryckHzkGSDknfKDwbALteiURoPcfkRmEfoxr', + fitness: ['02', '0002082b', '', 'ffffffff', '00000001'], + context: 'CoWDgrLLcSaBXq2sbZ5jwcoNkAuLmMHUurE8GTVd5SfPpRdP9MgF', + payload_hash: 'vh3LQUfufR7Z1soGCLdFymvHyW1aHokiEzN8eov9rcgQ4zvWeCuN', + payload_round: 1, + proof_of_work_nonce: 'ae384fb900000000', + liquidity_baking_toggle_vote: 'pass', signature: - 'sigcRoFAEPYkmtMRGReeSd5tjnSNfgAntG3H5aHyTk4WSKc42QVzj5xHf9RsDvkyGSgLsm7hvYVoQ27p8pd9QYSmNUWdS11t', + 'signuyFG2mYvJh4WZSzVrSTBTUe7wvS9NYbFqUUqrAEp9ktwjYi8PSwEoTo2Z6cvmZAzPo9ZaSrnehuejvKpYpdXVnazSiHR', }, metadata: { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - next_protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', + protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', + next_protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', test_chain_status: { status: 'not_running', }, @@ -3479,32 +3578,31 @@ export const blockJakartanetResponse = { max_size: 524288, }, ], - proposer: 'tz1PirbogVqfmBT9XCuYJ1KnDx4bnMSYfGru', - baker: 'tz1PirbogVqfmBT9XCuYJ1KnDx4bnMSYfGru', + proposer: 'tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE', + baker: 'tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE', level_info: { - level: 63401, - level_position: 63400, - cycle: 15, - cycle_position: 1960, + level: 133163, + level_position: 133162, + cycle: 32, + cycle_position: 2090, expected_commitment: false, }, voting_period_info: { voting_period: { - index: 15, + index: 32, kind: 'proposal', - start_position: 61440, + start_position: 131072, }, - position: 1960, - remaining: 2135, + position: 2090, + remaining: 2005, }, nonce_hash: null, - consumed_gas: '1521000', deactivated: [], balance_updates: [ { kind: 'accumulator', category: 'block fees', - change: '-380', + change: '-16643', origin: 'block', }, { @@ -3515,24 +3613,24 @@ export const blockJakartanetResponse = { }, { kind: 'contract', - contract: 'tz1PirbogVqfmBT9XCuYJ1KnDx4bnMSYfGru', - change: '10000380', + contract: 'tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE', + change: '10016643', origin: 'block', }, { kind: 'minted', category: 'baking bonuses', - change: '-8533426', + change: '-8700580', origin: 'block', }, { kind: 'contract', - contract: 'tz1PirbogVqfmBT9XCuYJ1KnDx4bnMSYfGru', - change: '8533426', + contract: 'tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE', + change: '8700580', origin: 'block', }, ], - liquidity_baking_toggle_ema: 521773279, + liquidity_baking_toggle_ema: 0, implicit_operations_results: [ { kind: 'transaction', @@ -3541,7 +3639,7 @@ export const blockJakartanetResponse = { int: '1', }, { - int: '158500000100', + int: '332905000100', }, { int: '100', @@ -3567,1267 +3665,198 @@ export const blockJakartanetResponse = { origin: 'subsidy', }, ], - consumed_gas: '205', - consumed_milligas: '204975', + consumed_milligas: '205035', storage_size: '4632', }, ], - consumed_milligas: '1521000', + consumed_milligas: '24380000', }, operations: [ [ { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'oodkkuZhFs4vfU7iYUQxoQgukBybT7MakLAetVFg2Qx4MxDbvfh', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 0, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1aWXP237BLwNHJcCD4b3DutCevhqq2T1Z9', - endorsement_power: 1389, - }, - }, - ], - signature: - 'sigQFZbKyETsWini9WfDLNEvB74V2C3pcjb7SKnU9ZqUvJwsn8hSbhTEi6tUisUgoqXNfFq86UPmcWxY1oxzdJWv55nQn2iz', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'oniP1RkPbXkYx6JqScJFo7zTaeh8Yk3EvYKCk4LeTLwapxZhcKf', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 1, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1WzwobH5AFz3ea8n2UEramfYm1LY96hKJK', - endorsement_power: 328, - }, - }, - ], - signature: - 'sigNtMYSRZcwbUL1zJmM1M4VimtoT3wPtUJV3B8aZwjFFR74o8wV62Zte7QNM6umJug4LxYbxg9LMSNxLrLziUcvMtvR7RbP', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'ooVsncQsfHFiPniZeJ6RiyFwMnEmac1apTZhjecZH5TeX6AHhx1', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', + protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', + chain_id: 'NetXi2ZagzEsXbZ', + hash: 'onyJZz2gwEmspLbZaCd2P7Ws5RF7od6j2685VYrTPDaEZhpDbvx', + branch: 'BLeoVyx5LNjQ4ZvnpvdrgFszvSn9KPJVcqmApLaa6bn6VS1vNig', contents: [ { kind: 'endorsement', - slot: 2, - level: 63400, + slot: 2696, + level: 133162, round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', + block_payload_hash: 'vh2vcfabPoDQuNw6HQkZtWEzZkHe1uAmhF2sxta7varX3vriHPKD', metadata: { - delegate: 'tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE', - endorsement_power: 471, + delegate: 'tz1ehn3nZ8PhiJ2ygtLM3Z5hVtSzU4ZKgqLZ', + endorsement_power: 6, }, }, ], signature: - 'sigQmXbRPsprFhuac6eeW66qp9Nf2RoHyjeNBwHYXSixdP7LiXNirCFAWB7YwV5cF3kQtaAqRTH21BjFbJo96ZAGTh6kK2PE', + 'sigUqaWrk8u6zckJvLfivskoC5mkK62swsfNFq2eAuhFaghLC9LfahFMaEVag3pLjz4WjouVnYa4gekqs85kgH1s7p2hHyP3', }, + ], + [], + [], + [ { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'op3CxsBNtV1bkXM6rwqN7kW4AQ9pZYtnDDkZVNEgKGV7i1s5CXk', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', + protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', + chain_id: 'NetXi2ZagzEsXbZ', + hash: 'ooBghN2ok5EpgEuMqYWqvfwNLBiK9eNFoPai91iwqk2nRCyUKgE', + branch: 'BMNHgXcGnPQo2daGRvXnFV5DX7QfqCwpssPtaL4NWkUhuhYWwdS', contents: [ { - kind: 'endorsement', - slot: 3, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', + kind: 'increase_paid_storage', + source: 'tz2RVendfy3AQGEBwrhXF4kwyRiJUpa7qLnG', + fee: '349', + counter: '108123', + gas_limit: '1000', + storage_limit: '0', + amount: '2', + destination: 'KT1Vjr5PFC2Qm5XbSQZ8MdFZLgYMzwG5WZNh', metadata: { - delegate: 'tz1MvCE9dczhoij2bd4sLL2AfVuMtWfFAoCN', - endorsement_power: 220, + balance_updates: [ + { + kind: 'contract', + contract: 'tz2RVendfy3AQGEBwrhXF4kwyRiJUpa7qLnG', + change: '-349', + origin: 'block', + }, + { + kind: 'accumulator', + category: 'block fees', + change: '349', + origin: 'block', + }, + ], + operation_result: { + status: 'applied', + balance_updates: [ + { + kind: 'contract', + contract: 'tz2RVendfy3AQGEBwrhXF4kwyRiJUpa7qLnG', + change: '-500', + origin: 'block', + }, + { + kind: 'burned', + category: 'storage fees', + change: '500', + origin: 'block', + }, + ], + consumed_milligas: '1000000', + }, }, }, ], signature: - 'sigf34YLEzjWP3iF5KPzBTAgv4942SgvwRje4dByVEVMVKGWSb48ygUdXtg7umiEfKVrNx5zoq6xTCXXb1T9wCFkGDQyCSHA', + 'sigdUXgzV3FcbhV7qUAYGCbV86xZEpcBq1S3Acng974GvG8rULLnoNkXn1dvKvfbfvz3zChYCpjcDmR8f1shjAg1uSksceRp', }, { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'op5xBzwaZ3xkSMLgpnUrJAR4baCjKAgNQjQCzDAo5hFZShe33or', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', + protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', + chain_id: 'NetXi2ZagzEsXbZ', + hash: 'oorMQ4cCHReHtUdyEqpWBjyAgu59AWYMzSP5bSwi2gSGGHBSLF5', + branch: 'BKuq9qvyUfiZH64z7J7nxKAt7HGA1m2rgiR24XrCsAEgBh2JJd1', contents: [ { - kind: 'endorsement', - slot: 4, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', + kind: 'transaction', + source: 'tz1ejWMc4oNPuYJcs2UBFALuzQy3jKcZxEwL', + fee: '673', + counter: '84777', + gas_limit: '4224', + storage_limit: '0', + amount: '0', + destination: 'KT1D7mKRckD2ZoWGcGtUvBpDxb48WxpnLu1Q', metadata: { - delegate: 'tz1iTzWpFhURP5EnWqAc9hUkuVe2b2tSAGXC', - endorsement_power: 317, + balance_updates: [ + { + kind: 'contract', + contract: 'tz1ejWMc4oNPuYJcs2UBFALuzQy3jKcZxEwL', + change: '-673', + origin: 'block', + }, + { + kind: 'accumulator', + category: 'block fees', + change: '673', + origin: 'block', + }, + ], + operation_result: { + status: 'applied', + storage: { + prim: 'Unit', + }, + consumed_milligas: '2123011', + storage_size: '133', + }, + internal_operation_results: [ + { + kind: 'event', + source: 'KT1D7mKRckD2ZoWGcGtUvBpDxb48WxpnLu1Q', + nonce: 0, + type: { + prim: 'or', + args: [ + { + prim: 'nat', + }, + { + prim: 'string', + }, + ], + }, + tag: 'event', + payload: { + prim: 'Left', + args: [ + { + int: '10', + }, + ], + }, + result: { + status: 'applied', + consumed_milligas: '1000000', + }, + }, + { + kind: 'event', + source: 'KT1D7mKRckD2ZoWGcGtUvBpDxb48WxpnLu1Q', + nonce: 1, + type: { + prim: 'or', + args: [ + { + prim: 'nat', + annots: ['%number'], + }, + { + prim: 'string', + annots: ['%words'], + }, + ], + }, + tag: 'event', + payload: { + prim: 'Right', + args: [ + { + string: 'lorem ipsum', + }, + ], + }, + result: { + status: 'applied', + consumed_milligas: '1000000', + }, + }, + ], }, }, ], signature: - 'sigbCpffpWqNLYY8ehNZHwVGEt2RCT46zHjNZxM5YuUVg9tYRA6Kt99PMwMQCy8Y7HfVP54LnoH3xyDXi339Up5hMYP2VLQi', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'op4Z6oKBNLpm43LZp3NyKFujNcPd891neF5LouVewHDd13Yg33o', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 5, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1XGwK6kkiJaq2ZEJYcWEj5Tc8bcV6pNHqV', - endorsement_power: 226, - }, - }, - ], - signature: - 'sigPTqcf6fHWkWoD9C3LL7KDFguvjrSgZ6p4yf3GvdMWuGxeY6aaWmFNxLRyzt3c3ALmEm3EwZNX79kSCccumXyC8Jrb9Vav', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'ooB93dyDk13ASFL8y4EbtQdjDVcqkGxXZQUjgpMJ45aWSYG6vae', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 6, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1KkJtLB9pMdLKNpVRNZw9zmysrxKmYcRGU', - endorsement_power: 368, - }, - }, - ], - signature: - 'siggGigRRh4LqDir1Bjgheve9dzi3wQDWnfGrbGtfcshZEr9PmanTb8VK2RAdCLFnHyhTC1cTZ5Va3h9QWWk5FsQBVEYkUqA', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'oo9D3ajMuU362tHD91ooE72s3EmPWq7aaQmSn8ir7wHLVNYMxpu', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 9, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1Zt8QQ9aBznYNk5LUBjtME9DuExomw9YRs', - endorsement_power: 355, - }, - }, - ], - signature: - 'sigtxzPKVendcBHhHPUKLN88qpL8Ge3mnKeJnXXp1E8VT9ZKxzcgBeA8JTo2idzicNEcoimzUXDPGfomrFhCMtiv6DxcmQFy', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'onjJxn5oipcyRPQnmZfMo2HPvrHud4toAANnRX7ARkT5gvyYXNX', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 12, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1ccniXhg7WdHVJfvnXMVMihxitQTijQeEd', - endorsement_power: 111, - }, - }, - ], - signature: - 'sigXiaGXhC9H3F1VLXuL8h7AL1Xu3YDfMthY348fNxx8Przh38VNWVs68ELNa682WYGyLXYEgL76rpt76yxdQEb6ohsU9Nmy', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'onuXN99bd5DhE63jJWD5pcQQebT5tT7LKxkQnJvHRa6k9GtBFS3', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 14, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1RuHDSj9P7mNNhfKxsyLGRDahTX5QD1DdP', - endorsement_power: 323, - }, - }, - ], - signature: - 'siga5gLgGCXnfrHJQJRKxze5TXD4dZFYkMu15A3z3CFZoHocEhPJxQr9YkEzJHMZTbT5Wkfr2yVDXM2XHC8TBecCaRpB9p5o', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'opBaGizW8iuRFpy24PWExWRmfp8Da7rZ5RnLrpFwM1rwyt7DYqg', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 17, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1hm7NuCGNSKZQLQSawjUnehJcX8yCBcCAq', - endorsement_power: 280, - }, - }, - ], - signature: - 'sigbVaSBRhiZFJ9ne4AiNZwf6HFQo212BVzAn96HLmovsQAqAd8diUXEoUuTvav9z1d3NGobuQD4NuvnBg7bBmwyLUcSdnZU', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'ooPowq4hovzxUb67axpg6hbRhHie5x6oFehiy68NRVDVdJ3pero', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 18, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1hoyMUiJYYr4FRPMU8Z7WJzYkqgjygjaTy', - endorsement_power: 343, - }, - }, - ], - signature: - 'sigw9Ve969dwbpFiZSPNXgH9LKPfusyxKrYUXvA3gyErR6AhwYBgUtcrbeDbXvLbFcGzKztVPNP7ZNtZ2zfPJw4cTTcpNH32', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'ooh8tXizxmbpA9HUqgNkKsVnzYREkBhNWq1kCsLfsnVe194wQYQ', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 19, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1Q6VpNkHPsdTaoKJ7hFF9kAycrs1wxYZQY', - endorsement_power: 80, - }, - }, - ], - signature: - 'sigcVE9tMqxxydNp9NVePq86wvRFVmd5K7ay6nq9MURw5TFL6YxnFhL9sDLwxGEmkMk6L3vf7W94pLWzmDRtKSh7edyJpLx4', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'ontAWJPLYyTvqoMMYY5KbA9fECjCVo9FdW1mPgvPELVxDJwvAYA', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 20, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1cjyja1TU6fiyiFav3mFAdnDsCReJ12hPD', - endorsement_power: 307, - }, - }, - ], - signature: - 'sigNjxaUBWhR3ppDEHq7x4gjwtCJ2PR5Yr5GzJYHwhPLenkerPwYSQiE5NEsjVV6CmTQN2jCrRXsfvZSxgNoWkGMtmKocsjQ', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'oo2bMFcvpg2EFGnYxTDhM9w1v4XwTLPjKr2bVTJS6uxKi8u85CA', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 22, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1cXeGHP8Urj2pQRwpAkCdPGbCdqFUPsQwU', - endorsement_power: 141, - }, - }, - ], - signature: - 'sigb6k3e1hsQtJkzFUNXxDdEM8Pz9mT5hvX7nBo4586krePFuBvjcYQSsoUKvBC9hBRxANSv5DnbRj5ySenD6p1d3tygtyPo', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'opBjvNqfRjnWaP8LPfxBJzAX8dMGZp5Fi9ogCaknXo1anLzquVz', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 26, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz3Q67aMz7gSMiQRcW729sXSfuMtkyAHYfqc', - endorsement_power: 332, - }, - }, - ], - signature: - 'sigmxp4mrHbtjjfGvnbnQGictJAws1uGGBQ2u4GRpQAqWCukz8Us5kwpeAWDnbyMEMZM6f7e4SzHH558TzRoPzkypg8mGLUA', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'onyKnSuaZERZJMoK4FobMio7Pa5V4vsSx32nfdJQSxWcofQHwrm', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 32, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1PirbogVqfmBT9XCuYJ1KnDx4bnMSYfGru', - endorsement_power: 341, - }, - }, - ], - signature: - 'sigoVLK4Pyakb3oqxSsHSdBPbA2uJ3a36gdiKukUzyhQ5SSfe8DDnn3QzsfDyTSzDWs2bE6p5RNWf6MLm2qZgv3z1v77NMPb', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'opHupJB4w7WJvx8bDJbMYNcTvgUEgwWXD54FBgg6oScqj1n5znz', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 37, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1KhTJVAkKc5zhN29VBA3uEijtCKy6kfNBP', - endorsement_power: 361, - }, - }, - ], - signature: - 'signkqd9KuDqmNn6PAs8ekkW3L1xL29ojMBfFrRNoAkyfeEptkEB4FZEq1BgwuhBQ6uywKUycVhtMi8hzTnKP1MUWhBeYmBV', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'opUbx3eAV1cMFjy3KWrhCPHYD3pAkHyuV1aUNJwEbvM5tyPdSxi', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 47, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1XpntqFmUYqAJw3qMxjGMR4m8rJUrvuMnp', - endorsement_power: 304, - }, - }, - ], - signature: - 'sigr3fuug1YVi1jhJ3zqHFgw5JQGDHpKAKy3L3XJJa3NT6DQapFsvSgxzfaVWJ4fKoBQWvvKdiFeBgaXmTcV51eVNmaerhD7', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'ooVheinh7dJFdMFsnvKA6RQiHZN5EZTASay4BnPGP5sTKQH7igX', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 123, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1funU3PjPsuXvmtXMgnAckY1s4pNT6V7WJ', - endorsement_power: 61, - }, - }, - ], - signature: - 'sigjAJmfrSUJxxPFqPqZPXTzktZZ6rFBgD4MsVtnStVGwSvSBsZkqdFCrHFDbq8CM2HsGowKvknQqBn4KdVutviTVqh6mBuM', - }, - ], - [], - [], - [ - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'ooxVg6Ggafc8BZQ463DYN6L5n91kZT7vicBNauVoTvP6N2H5UAU', - branch: 'BLK2bAvb39oqRLzZnofB3ht1F5iR1Po2WDdmq2i7pSzSVgEtV8u', - contents: [ - { - kind: 'tx_rollup_origination', - source: 'tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ', - fee: '380', - counter: '173977', - gas_limit: '1521', - storage_limit: '4020', - tx_rollup_origination: {}, - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ', - change: '-380', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '380', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [ - { - kind: 'contract', - contract: 'tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ', - change: '-1000000', - origin: 'block', - }, - { - kind: 'burned', - category: 'storage fees', - change: '1000000', - origin: 'block', - }, - ], - consumed_gas: '1421', - consumed_milligas: '1420108', - originated_rollup: 'txr1YTdi9BktRmybwhgkhRK7WPrutEWVGJT7w', - }, - }, - }, - { - kind: 'tx_rollup_submit_batch', - source: 'tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ', - fee: '476', - counter: '173978', - gas_limit: '2209', - storage_limit: '0', - rollup: 'txr1YTdi9BktRmybwhgkhRK7WPrutEWVGJT7w', - content: '626c6f62', - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ', - change: '-476', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '476', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [], - consumed_gas: '2109', - consumed_milligas: '2108268', - paid_storage_size_diff: '0', - }, - }, - }, - { - kind: 'tx_rollup_commit', - source: 'tz1gqDrJYH8rTkdG3gCLTtRA1d7UZDjYFNRY', - fee: '735', - counter: '182217', - gas_limit: '3838', - storage_limit: '0', - rollup: 'txr1Nbn66mC1yYHBkfD3ink45XVJso6QJZeHe', - commitment: { - level: 1, - messages: ['txmr344vtdPzvWsfnoSd3mJ3MCFA5ehKLQs1pK9WGcX4FEACg1rVgC'], - predecessor: 'txc3PQbuB4fmpXMq2NqXGpCnu8EDotTWeHf5w3jJRpyQHSNKRug3U', - inbox_merkle_root: 'txi3Ef5CSsBWRaqQhWj2zg51J3tUqHFD47na6ex7zcboTG5oXEFrm', - }, - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz1gqDrJYH8rTkdG3gCLTtRA1d7UZDjYFNRY', - change: '-735', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '735', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [], - consumed_gas: '3738', - consumed_milligas: '3737532', - }, - }, - }, - { - kind: 'tx_rollup_finalize_commitment', - source: 'tz1gqDrJYH8rTkdG3gCLTtRA1d7UZDjYFNRY', - fee: '507', - counter: '182232', - gas_limit: '2602', - storage_limit: '0', - rollup: 'txr1RHjM395hdwNfgpM8GixQrPAimk7i2Tjy1', - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz1gqDrJYH8rTkdG3gCLTtRA1d7UZDjYFNRY', - change: '-507', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '507', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [], - consumed_gas: '2502', - consumed_milligas: '2501420', - level: 0, - }, - }, - }, - { - kind: 'tx_rollup_dispatch_tickets', - source: 'tz1inuxjXxKhd9e4b97N1Wgz7DwmZSxFcDpM', - fee: '835', - counter: '252405', - gas_limit: '4354', - storage_limit: '86', - tx_rollup: 'txr1YMZxstAHqQ9V313sYjLBCHBXsvSmDZuTs', - level: 4, - context_hash: 'CoV7iqRirVx7sZa5TAK9ymoEJBrW6z4hwwrzMhz6YLeHYXrQwRWG', - message_index: 0, - message_result_path: ['txM2eYt63gJ98tv3z4nj3aWPMzpjLnW9xpUdmz4ftMnbvNG34Y4wB'], - tickets_info: [ - { - contents: { - string: 'third-deposit', - }, - ty: { - prim: 'string', - }, - ticketer: 'KT1EMQxfYVvhTJTqMiVs2ho2dqjbYfYKk6BY', - amount: '2', - claimer: 'tz1inuxjXxKhd9e4b97N1Wgz7DwmZSxFcDpM', - }, - ], - }, - { - kind: 'tx_rollup_remove_commitment', - source: 'tz1M1PXyMAhAsXroc6DtuWUUeHvb79ZzCnCp', - fee: '574', - counter: '252310', - gas_limit: '3272', - storage_limit: '0', - rollup: 'txr1YMZxstAHqQ9V313sYjLBCHBXsvSmDZuTs', - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz1M1PXyMAhAsXroc6DtuWUUeHvb79ZzCnCp', - change: '-574', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '574', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [], - consumed_gas: '3172', - consumed_milligas: '3171088', - level: 0, - }, - }, - }, - { - kind: 'tx_rollup_rejection', - source: 'tz1MDU45gNc9Ko1Q9obcz6hQkKSMiQRib6GZ', - fee: '2837', - counter: '266515', - gas_limit: '11633', - storage_limit: '0', - rollup: 'txr1V16e1hXyVKndP4aE8cujRfryoHTiHK9fG', - level: 11, - message: { - batch: - '01b2530bd9f4d594ee6116286cbb045a972305e38e6365b396f49d153815fbdd15c8974b7fdc50aee4bc3f8195e95075ab0fca5d31927917ede7a408fe70c61cd4a0525b2836eca0e797cdf9ae9b3bf58735fd62a7bf21775d46940ae9bd83a8d501130187e8c631aba41d88a67da49cf5f4db947fdf5a76084f1d4b6c14531f6582b239db26dd0375ca7172cdbecd8b6f080ffa58c748f83cc7a2afce164c1bcc53712ff5a9e50c39fb0172acda0a', - }, - message_position: '0', - message_path: ['txi1WZKF1fkUWfKbmaHbb5b8gn68rKSyUy4k7NnSVY4p79BKYz5RB'], - message_result_hash: 'txmr344vtdPzvWsfnoSd3mJ3MCFA5ehKLQs1pK9WGcX4FEACg1rVgC', - message_result_path: ['txM2eYt63gJ98tv3z4nj3aWPMzpjLnW9xpUdmz4ftMnbvNG34Y4wB'], - previous_message_result: { - context_hash: 'CoVUv68XdJts8f6Ysaoxm4jnt4JKXfqx8WYVFnkj2UFfgKHJUrLs', - withdraw_list_hash: 'txw1sFoLju3ySMAdY6v1dcHUMqJ4Zxc1kcynC8xkYgCmH6bpNSDhV', - }, - previous_message_result_path: ['txM2eYt63gJ98tv3z4nj3aWPMzpjLnW9xpUdmz4ftMnbvNG34Y4wB'], - proof: { - version: 3, - before: { node: 'CoVUv68XdJts8f6Ysaoxm4jnt4JKXfqx8WYVFnkj2UFfgKHJUrLs' }, - after: { node: 'CoUn3twa3TmvNby5VAGeN2jHvzbfpmJAXcyDHJuLLAuuLiaZZnzC' }, - state: [ - { - inode: { - length: '14', - proofs: [ - 'CoVbQczQE6uDug4tWErtLgszzZBRDJKEGHgcQp8jGYSEfBLnsMXH', - 'CoWZ31tY65qh38Sfgm64Ny8kDTLQQMr5xuRDkDkz1JopiBnPDu11', - ], - }, - }, - { - inode: { - length: '6', - proofs: [ - 'CoVecMq8ageb8fsmr6MPdNDH583cEpfCjVu8dQJpBP4J5GxM4Fex', - 'CoUh6FXy5xrEqSswAJ8MmAWcJMUiLyCq53RQiEHoHdovYxzXLHVE', - ], - }, - }, - { - inode: { - length: '3', - proofs: [null, 'CoVPGhaCkq2yV5JJs8Bxq1idndEhBn3SCJe3rSH5eYvr9BnRnv8i'], - }, - }, - { - inode: { - length: '3', - proofs: [ - 'CoWawEsrigKz7nfmXdCE84Rj6sJzzSj3RdeyuySjaxzhFZ17EFjb', - 'CoVWwp2qJWcRXvNA4adk9nUHRvKT22qY8QEoaAYK2Fz5tviyCaBw', - ], - }, - }, - { - other_elts: { - node: [ - [ - '0287e8c631aba41d88a67da49cf5f4db947fdf5a76', - { value: 'CoW4fTVfN6WBZ6XqT38EqLzn5raQUYkjSL4Ce7J2KsGKcFPjgUJy' }, - ], - [ - '050000000100000002', - { value: 'CoWQdcsnqDRRNEb1F4dRSPffKXfAnBXhhdpwo5mMyQibrXx5BKmF' }, - ], - ], - }, - }, - { - other_elts: { - other_elts: { value: '00000000' }, - }, - }, - { - inode: { - length: '3', - proofs: [ - 'CoW1wvLQ8e7wwDXM431GKDFZ5FJMTu9aGtHCY6NE9jmcH2rBn3UU', - 'CoWVAyWNj6anjKBcoGmpEKpcURyTSvjPBJiHs8TcWruhVwNKzbiv', - ], - }, - }, - { - other_elts: { - node: [ - [ - '0000000000', - { value: 'CoWXftiVdu561NbMwSyvQ8aJ5mPNCdCiyL3e9MP5fpb12nhEa6BQ' }, - ], - [ - '0000000001', - { value: 'CoVjtgM389FfgNSs91E4J7mVWwvtAVkPCV8UrGR8onjUmbvAYFz1' }, - ], - ], - }, - }, - { - other_elts: { - other_elts: { - value: - '00000000000000070000003087bdec4b6745183b7ea589128f836e037e92a8e7fbad7818c0e371840b78aca9cceb24d627c59ace2962c9b801606016', - }, - }, - }, - { - other_elts: { - node: [ - [ - '021d4b6c14531f6582b239db26dd0375ca7172cdbe', - { value: 'CoWG69nMHdez4s8SahwsB2m5ZPCLqPre7Qmi5uwdJ9nhFsEX7RdN' }, - ], - ], - }, - }, - { - other_elts: { - other_elts: { value: '00000001' }, - }, - }, - { - inode: { - length: '8', - proofs: [ - 'CoV8yd9SQTRz1ic9WyiMNAfyTq3Q9Jq9iUwNPtT3Tuxm999F2GnY', - 'CoW6PzNAZdnTY1NB1AXS5gx23BGpm66FvBW2yahScM4d8LEa3csN', - ], - }, - }, - { - inode: { - length: '4', - proofs: [ - 'CoWKdEp4XjM5dYvDJoYzsa9ofVRrqKrwbryd9TmKD9uTT1pVHTfb', - 'CoUzXw8c38PwQdyMUo7ZatPL5xWRfLuAuCQFvtMJJu3T5jt9qDLq', - ], - }, - }, - { - inode: { - length: '3', - proofs: [ - 'CoWFsG1gkdG17aE9emaKrhEJEhc41VMpmG4mmTmjt6wPkdjfJmhj', - 'CoV4P6w3UKpWRmbFJVL1x46YHaxCBVNqJKBYhT29W9pjK2Vum5a2', - ], - }, - }, - { - other_elts: { - node: [ - [ - '04cd8b6f080ffa58c748f83cc7a2afce164c1bcc53712ff5a9e50c39fb0172acda', - { value: 'CoW4fTVfN6WBZ6XqT38EqLzn5raQUYkjSL4Ce7J2KsGKcFPjgUJy' }, - ], - [ - '050000000000000000', - { value: 'CoVd2R5Mf2KMjBgCDpPYEmgQVbg7fXCcv6hmfFKUPyiNotbkKqkf' }, - ], - ], - }, - }, - { - other_elts: { - other_elts: { value: '0032' }, - }, - }, - { - other_elts: { - node: [ - [ - '050000000000000001', - { value: 'CoVZMPkooCZg5EDUd7PqvowuM7pknwEbcjGSaKzeCrsJUynoWKvR' }, - ], - ], - }, - }, - { - other_elts: { - other_elts: { value: '0028' }, - }, - }, - ], - }, - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz1MDU45gNc9Ko1Q9obcz6hQkKSMiQRib6GZ', - change: '-2837', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '2837', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [ - { - kind: 'freezer', - category: 'bonds', - contract: 'tz1Lg9iLTS8Hk6kLfTN6rrrL9gYPfsTQ9z75', - bond_id: { tx_rollup: 'txr1V16e1hXyVKndP4aE8cujRfryoHTiHK9fG' }, - change: '-10000000000', - origin: 'block', - }, - { - kind: 'burned', - category: 'tx_rollup_rejection_punishments', - change: '10000000000', - origin: 'block', - }, - { - kind: 'minted', - category: 'tx_rollup_rejection_rewards', - change: '-5000000000', - origin: 'block', - }, - { - kind: 'contract', - contract: 'tz1MDU45gNc9Ko1Q9obcz6hQkKSMiQRib6GZ', - change: '5000000000', - origin: 'block', - }, - ], - consumed_gas: '11533', - consumed_milligas: '11532006', - }, - }, - }, - { - kind: 'tx_rollup_return_bond', - source: 'tz2Q3efwpRvKL2Tvta8h6N5niV54Rw8iSEes', - fee: '512', - counter: '36', - gas_limit: '2676', - storage_limit: '0', - rollup: 'txr1TeZQiQrjaEop11Lh8fpsTdyJgQvr5igST', - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz2Q3efwpRvKL2Tvta8h6N5niV54Rw8iSEes', - change: '-512', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '512', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [ - { - kind: 'freezer', - category: 'bonds', - contract: 'tz2Q3efwpRvKL2Tvta8h6N5niV54Rw8iSEes', - bond_id: { - tx_rollup: 'txr1TeZQiQrjaEop11Lh8fpsTdyJgQvr5igST', - }, - change: '-10000000000', - origin: 'block', - }, - { - kind: 'contract', - contract: 'tz2Q3efwpRvKL2Tvta8h6N5niV54Rw8iSEes', - change: '10000000000', - origin: 'block', - }, - ], - consumed_milligas: '2575028', - }, - }, - }, - ], - signature: - 'sigmpiJiuk1wbno2KAvxFufUkZ4JnrTuuxmVWmGVP3bPKNft8Nv8LZwkKAKtvUeBSiBEMxa5vAxcKc5FddwZvhjuZyydZeKD', - }, - ], - ], -}; - -export const blockKathmandunetResponse = { - protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', - chain_id: 'NetXi2ZagzEsXbZ', - hash: 'BLHBkJLRFwRhs1Nvrbrf8gVnVgSxx5515iTdizVnagm97baSXNF', - header: { - level: 133163, - proto: 2, - predecessor: 'BMD5idn9K4pGGAk9EbXBgUicYzTeDJLhY2a75Xfq6WNfahiRWZy', - timestamp: '2022-08-24T17:48:35Z', - validation_pass: 4, - operations_hash: 'LLobDJY3zxBWiCiHUryckHzkGSDknfKDwbALteiURoPcfkRmEfoxr', - fitness: ['02', '0002082b', '', 'ffffffff', '00000001'], - context: 'CoWDgrLLcSaBXq2sbZ5jwcoNkAuLmMHUurE8GTVd5SfPpRdP9MgF', - payload_hash: 'vh3LQUfufR7Z1soGCLdFymvHyW1aHokiEzN8eov9rcgQ4zvWeCuN', - payload_round: 1, - proof_of_work_nonce: 'ae384fb900000000', - liquidity_baking_toggle_vote: 'pass', - signature: - 'signuyFG2mYvJh4WZSzVrSTBTUe7wvS9NYbFqUUqrAEp9ktwjYi8PSwEoTo2Z6cvmZAzPo9ZaSrnehuejvKpYpdXVnazSiHR', - }, - metadata: { - protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', - next_protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', - test_chain_status: { - status: 'not_running', - }, - max_operations_ttl: 120, - max_operation_data_length: 32768, - max_block_header_length: 289, - max_operation_list_length: [ - { - max_size: 4194304, - max_op: 2048, - }, - { - max_size: 32768, - }, - { - max_size: 135168, - max_op: 132, - }, - { - max_size: 524288, - }, - ], - proposer: 'tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE', - baker: 'tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE', - level_info: { - level: 133163, - level_position: 133162, - cycle: 32, - cycle_position: 2090, - expected_commitment: false, - }, - voting_period_info: { - voting_period: { - index: 32, - kind: 'proposal', - start_position: 131072, - }, - position: 2090, - remaining: 2005, - }, - nonce_hash: null, - deactivated: [], - balance_updates: [ - { - kind: 'accumulator', - category: 'block fees', - change: '-16643', - origin: 'block', - }, - { - kind: 'minted', - category: 'baking rewards', - change: '-10000000', - origin: 'block', - }, - { - kind: 'contract', - contract: 'tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE', - change: '10016643', - origin: 'block', - }, - { - kind: 'minted', - category: 'baking bonuses', - change: '-8700580', - origin: 'block', - }, - { - kind: 'contract', - contract: 'tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE', - change: '8700580', - origin: 'block', - }, - ], - liquidity_baking_toggle_ema: 0, - implicit_operations_results: [ - { - kind: 'transaction', - storage: [ - { - int: '1', - }, - { - int: '332905000100', - }, - { - int: '100', - }, - { - bytes: '01e927f00ef734dfc85919635e9afc9166c83ef9fc00', - }, - { - bytes: '0115eb0104481a6d7921160bc982c5e0a561cd8a3a00', - }, - ], - balance_updates: [ - { - kind: 'minted', - category: 'subsidy', - change: '-2500000', - origin: 'subsidy', - }, - { - kind: 'contract', - contract: 'KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5', - change: '2500000', - origin: 'subsidy', - }, - ], - consumed_milligas: '205035', - storage_size: '4632', - }, - ], - consumed_milligas: '24380000', - }, - operations: [ - [ - { - protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', - chain_id: 'NetXi2ZagzEsXbZ', - hash: 'onyJZz2gwEmspLbZaCd2P7Ws5RF7od6j2685VYrTPDaEZhpDbvx', - branch: 'BLeoVyx5LNjQ4ZvnpvdrgFszvSn9KPJVcqmApLaa6bn6VS1vNig', - contents: [ - { - kind: 'endorsement', - slot: 2696, - level: 133162, - round: 0, - block_payload_hash: 'vh2vcfabPoDQuNw6HQkZtWEzZkHe1uAmhF2sxta7varX3vriHPKD', - metadata: { - delegate: 'tz1ehn3nZ8PhiJ2ygtLM3Z5hVtSzU4ZKgqLZ', - endorsement_power: 6, - }, - }, - ], - signature: - 'sigUqaWrk8u6zckJvLfivskoC5mkK62swsfNFq2eAuhFaghLC9LfahFMaEVag3pLjz4WjouVnYa4gekqs85kgH1s7p2hHyP3', - }, - ], - [], - [], - [ - { - protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', - chain_id: 'NetXi2ZagzEsXbZ', - hash: 'ooBghN2ok5EpgEuMqYWqvfwNLBiK9eNFoPai91iwqk2nRCyUKgE', - branch: 'BMNHgXcGnPQo2daGRvXnFV5DX7QfqCwpssPtaL4NWkUhuhYWwdS', - contents: [ - { - kind: 'increase_paid_storage', - source: 'tz2RVendfy3AQGEBwrhXF4kwyRiJUpa7qLnG', - fee: '349', - counter: '108123', - gas_limit: '1000', - storage_limit: '0', - amount: '2', - destination: 'KT1Vjr5PFC2Qm5XbSQZ8MdFZLgYMzwG5WZNh', - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz2RVendfy3AQGEBwrhXF4kwyRiJUpa7qLnG', - change: '-349', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '349', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [ - { - kind: 'contract', - contract: 'tz2RVendfy3AQGEBwrhXF4kwyRiJUpa7qLnG', - change: '-500', - origin: 'block', - }, - { - kind: 'burned', - category: 'storage fees', - change: '500', - origin: 'block', - }, - ], - consumed_milligas: '1000000', - }, - }, - }, - ], - signature: - 'sigdUXgzV3FcbhV7qUAYGCbV86xZEpcBq1S3Acng974GvG8rULLnoNkXn1dvKvfbfvz3zChYCpjcDmR8f1shjAg1uSksceRp', - }, - { - protocol: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg', - chain_id: 'NetXi2ZagzEsXbZ', - hash: 'oorMQ4cCHReHtUdyEqpWBjyAgu59AWYMzSP5bSwi2gSGGHBSLF5', - branch: 'BKuq9qvyUfiZH64z7J7nxKAt7HGA1m2rgiR24XrCsAEgBh2JJd1', - contents: [ - { - kind: 'transaction', - source: 'tz1ejWMc4oNPuYJcs2UBFALuzQy3jKcZxEwL', - fee: '673', - counter: '84777', - gas_limit: '4224', - storage_limit: '0', - amount: '0', - destination: 'KT1D7mKRckD2ZoWGcGtUvBpDxb48WxpnLu1Q', - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz1ejWMc4oNPuYJcs2UBFALuzQy3jKcZxEwL', - change: '-673', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '673', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - storage: { - prim: 'Unit', - }, - consumed_milligas: '2123011', - storage_size: '133', - }, - internal_operation_results: [ - { - kind: 'event', - source: 'KT1D7mKRckD2ZoWGcGtUvBpDxb48WxpnLu1Q', - nonce: 0, - type: { - prim: 'or', - args: [ - { - prim: 'nat', - }, - { - prim: 'string', - }, - ], - }, - tag: 'event', - payload: { - prim: 'Left', - args: [ - { - int: '10', - }, - ], - }, - result: { - status: 'applied', - consumed_milligas: '1000000', - }, - }, - { - kind: 'event', - source: 'KT1D7mKRckD2ZoWGcGtUvBpDxb48WxpnLu1Q', - nonce: 1, - type: { - prim: 'or', - args: [ - { - prim: 'nat', - annots: ['%number'], - }, - { - prim: 'string', - annots: ['%words'], - }, - ], - }, - tag: 'event', - payload: { - prim: 'Right', - args: [ - { - string: 'lorem ipsum', - }, - ], - }, - result: { - status: 'applied', - consumed_milligas: '1000000', - }, - }, - ], - }, - }, - ], - signature: - 'sigfSTrupvjTWBW4NNXJHLyNEd6gUuD3Jzm9YZzSrH82X3somYZPpgCayRTkzmk1NwxGQCKJHLGsv7xxhVNKsgtxTqF8FEqe', + 'sigfSTrupvjTWBW4NNXJHLyNEd6gUuD3Jzm9YZzSrH82X3somYZPpgCayRTkzmk1NwxGQCKJHLGsv7xxhVNKsgtxTqF8FEqe', }, ], ], @@ -5364,33 +4393,6 @@ export const blockMondaynetResponse = { ], }; -export const txRollupState = { - last_removed_commitment_hashes: null, - finalized_commitments: { - next: 0, - }, - unfinalized_commitments: { - next: 0, - }, - uncommitted_inboxes: { - newest: 0, - oldest: 0, - }, - commitment_newest_hash: null, - tezos_head_level: 63691, - burn_per_byte: '0', - allocated_storage: '4000', - occupied_storage: '40', - inbox_ema: 0, - commitments_watermark: null, -}; - -export const txRollupInbox = { - inbox_length: 1, - cumulated_size: 4, - merkle_root: 'txi3Ef5CSsBWRaqQhWj2zg51J3tUqHFD47na6ex7zcboTG5oXEFrm', -}; - export const ticketBalancesResponse = [ { ticketer: 'KT1X6mCNdfQZSpyU9zZw9sWckPVJyz2X8vwD', @@ -5659,8 +4661,6 @@ export const smartRollupOriginateResponse = { pvm_kind: 'wasm_2_0_0', kernel: '23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a', - origination_proof: - '0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea18030fab8a3adde4b553c4d391e9cd19ee13b17941c1f49c040d621bbfbea964993810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9', parameters_ty: { prim: 'bytes', }, @@ -5895,7 +4895,6 @@ export const smartRollupCementResponse = { gas_limit: '6986', storage_limit: '0', rollup: 'sr1CCHLfB1jjz4ikB2bm4XGPvTjafVgUzhLB', - commitment: 'src12mERNVEb3N1EVmbUbudctzajiezmd3q6EsgLexkgxNCHK8PNBi', metadata: { balance_updates: [ { diff --git a/packages/taquito-rpc/test/rpc-cache.spec.ts b/packages/taquito-rpc/test/rpc-cache.spec.ts index 17c41c21d1..c4aba2c1f4 100644 --- a/packages/taquito-rpc/test/rpc-cache.spec.ts +++ b/packages/taquito-rpc/test/rpc-cache.spec.ts @@ -15,6 +15,7 @@ import { blockHeader, blockMetadata, bakingRights, + attestationRights, endorsingRights, ballotList, ballots, @@ -30,8 +31,6 @@ import { blockResponse, protocols, constants, - txRollupInbox, - txRollupState, ticketBalancesResponse, pendingOperationsResponse, } from './data/rpc-responses'; @@ -45,8 +44,6 @@ describe('RpcClientCache test', () => { const address = 'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn'; const contractAddress = 'KT1Fe71jyjrxFg9ZrYqtvaX7uQjcLo7svE4D'; - const txRollupId = 'txr1YTdi9BktRmybwhgkhRK7WPrutEWVGJT7w'; - const blockLevel = '0'; const ticketToken = { ticketer: contractAddress, content_type: { prim: 'string' }, @@ -75,6 +72,7 @@ describe('RpcClientCache test', () => { getBlockHeader: jest.fn(), getBlockMetadata: jest.fn(), getBakingRights: jest.fn(), + getAttestationRights: jest.fn(), getEndorsingRights: jest.fn(), getBallotList: jest.fn(), getBallots: jest.fn(), @@ -89,8 +87,6 @@ describe('RpcClientCache test', () => { getCurrentPeriod: jest.fn(), getSuccessorPeriod: jest.fn(), getProtocols: jest.fn(), - getTxRollupInbox: jest.fn(), - getTxRollupState: jest.fn(), getTicketBalance: jest.fn(), getAllTicketBalances: jest.fn(), getPendingOperations: jest.fn(), @@ -116,6 +112,7 @@ describe('RpcClientCache test', () => { mockRpcClient.getBlockHeader.mockReturnValue(blockHeader); mockRpcClient.getBlockMetadata.mockReturnValue(blockMetadata); mockRpcClient.getBakingRights.mockReturnValue(bakingRights); + mockRpcClient.getAttestationRights.mockReturnValue(attestationRights); mockRpcClient.getEndorsingRights.mockReturnValue(endorsingRights); mockRpcClient.getBallotList.mockReturnValue(ballotList); mockRpcClient.getBallots.mockReturnValue(ballots); @@ -129,8 +126,6 @@ describe('RpcClientCache test', () => { mockRpcClient.getCurrentPeriod.mockReturnValue(currentPeriod); mockRpcClient.getSuccessorPeriod.mockReturnValue(successorPeriod); mockRpcClient.getProtocols.mockReturnValue(protocols); - mockRpcClient.getTxRollupInbox.mockReturnValue(txRollupInbox); - mockRpcClient.getTxRollupState.mockReturnValue(txRollupState); mockRpcClient.getTicketBalance.mockReturnValue('3'); mockRpcClient.getAllTicketBalances.mockReturnValue(ticketBalancesResponse); mockRpcClient.getPendingOperations.mockReturnValue(pendingOperationsResponse); @@ -162,6 +157,7 @@ describe('RpcClientCache test', () => { await rpcCache.getBlockHeader(); await rpcCache.getBlockMetadata(); await rpcCache.getBakingRights(); + await rpcCache.getAttestationRights(); await rpcCache.getEndorsingRights(); await rpcCache.getBallotList(); await rpcCache.getBallots(); @@ -178,8 +174,6 @@ describe('RpcClientCache test', () => { await rpcCache.getCurrentPeriod(); await rpcCache.getSuccessorPeriod(); await rpcCache.getProtocols(); - await rpcCache.getTxRollupInbox(txRollupId, blockLevel); - await rpcCache.getTxRollupState(txRollupId); await rpcCache.getTicketBalance(contractAddress, { ticketer: contractAddress, content_type: { prim: 'string' }, @@ -238,6 +232,9 @@ describe('RpcClientCache test', () => { expect(rpcCache.getAllCachedData()['rpcTest/getBakingRights/head/{}/'].response).toEqual( bakingRights ); + expect(rpcCache.getAllCachedData()['rpcTest/getAttestationRights/head/{}/'].response).toEqual( + attestationRights + ); expect(rpcCache.getAllCachedData()['rpcTest/getEndorsingRights/head/{}/'].response).toEqual( endorsingRights ); @@ -268,13 +265,6 @@ describe('RpcClientCache test', () => { successorPeriod ); expect(rpcCache.getAllCachedData()['rpcTest/getProtocols/head/'].response).toEqual(protocols); - expect( - rpcCache.getAllCachedData()[`rpcTest/getTxRollupInbox/head/${txRollupId}/${blockLevel}/`] - .response - ).toEqual(txRollupInbox); - expect( - rpcCache.getAllCachedData()[`rpcTest/getTxRollupState/head/${txRollupId}/`].response - ).toEqual(txRollupState); expect( rpcCache.getAllCachedData()[ `rpcTest/getTicketBalance/head/${contractAddress}/${JSON.stringify(ticketToken)}/` @@ -316,6 +306,7 @@ describe('RpcClientCache test', () => { await rpcCache.getBlockHeader(block); await rpcCache.getBlockMetadata(block); await rpcCache.getBakingRights({ level: 1111 }, block); + await rpcCache.getAttestationRights({ level: 1111 }, block); await rpcCache.getEndorsingRights({ level: 1111 }, block); await rpcCache.getBallotList(block); await rpcCache.getBallots(block); @@ -332,8 +323,6 @@ describe('RpcClientCache test', () => { await rpcCache.getCurrentPeriod(block); await rpcCache.getSuccessorPeriod(block); await rpcCache.getProtocols(block); - await rpcCache.getTxRollupInbox(txRollupId, blockLevel, block); - await rpcCache.getTxRollupState(txRollupId, block); await rpcCache.getTicketBalance( contractAddress, { @@ -406,6 +395,10 @@ describe('RpcClientCache test', () => { expect( rpcCache.getAllCachedData()[`rpcTest/getBakingRights/${block.block}/{"level":1111}/`].response ).toEqual(bakingRights); + expect( + rpcCache.getAllCachedData()[`rpcTest/getAttestationRights/${block.block}/{"level":1111}/`] + .response + ).toEqual(attestationRights); expect( rpcCache.getAllCachedData()[`rpcTest/getEndorsingRights/${block.block}/{"level":1111}/`] .response @@ -444,14 +437,6 @@ describe('RpcClientCache test', () => { expect(rpcCache.getAllCachedData()[`rpcTest/getProtocols/${block.block}/`].response).toEqual( protocols ); - expect( - rpcCache.getAllCachedData()[ - `rpcTest/getTxRollupInbox/${block.block}/${txRollupId}/${blockLevel}/` - ].response - ).toEqual(txRollupInbox); - expect( - rpcCache.getAllCachedData()[`rpcTest/getTxRollupState/${block.block}/${txRollupId}/`].response - ).toEqual(txRollupState); expect( rpcCache.getAllCachedData()[ `rpcTest/getTicketBalance/${block.block}/${contractAddress}/${JSON.stringify(ticketToken)}/` @@ -486,6 +471,7 @@ describe('RpcClientCache test', () => { await rpcCache.getBlockHeader(); await rpcCache.getBlockMetadata(); await rpcCache.getBakingRights(); + await rpcCache.getAttestationRights(); await rpcCache.getEndorsingRights(); await rpcCache.getBallotList(); await rpcCache.getBallots(); diff --git a/packages/taquito-rpc/test/taquito-rpc.spec.ts b/packages/taquito-rpc/test/taquito-rpc.spec.ts index 811257ae6b..b2fcb54d09 100644 --- a/packages/taquito-rpc/test/taquito-rpc.spec.ts +++ b/packages/taquito-rpc/test/taquito-rpc.spec.ts @@ -15,31 +15,19 @@ import { RPCRunScriptViewParam, OperationContentsAndResultSetDepositsLimit, METADATA_BALANCE_UPDATES_CATEGORY, - OperationContentsAndResultTxRollupOrigination, - OperationContentsAndResultTxRollupSubmitBatch, - OperationContentsAndResultTxRollupCommit, - OperationContentsAndResultTxRollupFinalizeCommitment, - OperationContentsAndResultTxRollupDispatchTickets, - MichelsonV1ExpressionBase, - MichelsonV1ExpressionExtended, - OperationContentsAndResultTxRollupRemoveCommitment, - OperationContentsAndResultTxRollupRejection, - Inode, - OtherElts, OperationContentsAndResultIncreasePaidStorage, OperationResultEvent, OperationContentsAndResultTransferTicket, - OperationContentsAndResultTxRollupReturnBond, OperationContentsAndResultUpdateConsensusKey, OperationContentsAndResultDrainDelegate, - TxRollupProof, ConstantsResponseProto015, OperationContentsAndResultSmartRollupOriginate, OperationContentsAndResultSmartRollupAddMessages, OperationContentsAndResultSmartRollupExecuteOutboxMessage, RPCRunOperationParam, OperationMetadataBalanceUpdates, - PendingOperations, + PendingOperationsV1, + PendingOperationsV2, OperationContentsAndResultSmartRollupCement, OperationContentsAndResultSmartRollupPublish, OperationContentsAndResultSmartRollupRefute, @@ -52,7 +40,6 @@ import { } from '../src/types'; import { blockIthacanetResponse, - blockJakartanetResponse, blockKathmandunetResponse, blockLimanetResponse, blockMondaynetResponse, @@ -489,6 +476,7 @@ describe('RpcClient test', () => { expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ method: 'POST', url: 'root/chains/test/blocks/head/helpers/preapply/operations', + query: { version: '0' }, }); expect(httpBackend.createRequest.mock.calls[0][1]).toEqual({}); @@ -611,6 +599,7 @@ describe('RpcClient test', () => { expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ method: 'GET', url: 'root/chains/test/blocks/head/metadata', + query: { version: '0' }, }); expect(result).toEqual({ @@ -1505,6 +1494,7 @@ describe('RpcClient test', () => { expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ method: 'GET', url: 'root/chains/test/blocks/head', + query: { version: '0' }, }); const endorsement = response.operations[0][0] .contents[0] as OperationContentsAndResultEndorsement; @@ -1748,6 +1738,7 @@ describe('RpcClient test', () => { expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ method: 'GET', url: 'root/chains/test/blocks/head', + query: { version: '0' }, }); const transaction = response.operations[0][0] .contents[0] as OperationContentsAndResultTransaction; @@ -1837,6 +1828,7 @@ describe('RpcClient test', () => { expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ method: 'GET', url: 'root/chains/test/blocks/head', + query: { version: '0' }, }); const endorsementWithSlot = response.operations[0][0] .contents[0] as OperationContentsAndResultEndorsementWithSlot; @@ -2395,6 +2387,7 @@ describe('RpcClient test', () => { expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ method: 'GET', url: 'root/chains/test/blocks/head', + query: { version: '0' }, }); const transaction = response.operations[0][0] @@ -2541,6 +2534,7 @@ describe('RpcClient test', () => { expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ method: 'GET', url: 'root/chains/test/blocks/head', + query: { version: '0' }, }); const origination = response.operations[3][0] @@ -2925,435 +2919,6 @@ describe('RpcClient test', () => { done(); }); - it('should access the properties of the operation type tx_rollup_origination, proto 13', async (done) => { - httpBackend.createRequest.mockReturnValue(Promise.resolve(blockJakartanetResponse)); - - const response = await client.getBlock(); - const content = response.operations[3][0] - .contents[0] as OperationContentsAndResultTxRollupOrigination; - - expect(content.kind).toEqual(OpKind.TX_ROLLUP_ORIGINATION); - expect(content.source).toEqual('tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ'); - expect(content.fee).toEqual('380'); - expect(content.counter).toEqual('173977'); - expect(content.gas_limit).toEqual('1521'); - expect(content.storage_limit).toEqual('4020'); - expect(content.tx_rollup_origination).toBeDefined(); - - expect(content.metadata.balance_updates![0].kind).toEqual('contract'); - expect(content.metadata.balance_updates![0].contract).toEqual( - 'tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ' - ); - expect(content.metadata.balance_updates![0].change).toEqual('-380'); - expect(content.metadata.balance_updates![0].origin).toEqual('block'); - - expect(content.metadata.balance_updates![1].kind).toEqual('accumulator'); - expect(content.metadata.balance_updates![1].category).toEqual('block fees'); - expect(content.metadata.balance_updates![1].change).toEqual('380'); - expect(content.metadata.balance_updates![1].origin).toEqual('block'); - - expect(content.metadata.operation_result.status).toEqual('applied'); - expect(content.metadata.operation_result.consumed_gas).toBeDefined(); - expect(content.metadata.operation_result.consumed_gas).toEqual('1421'); - expect(content.metadata.operation_result.consumed_milligas).toBeDefined(); - expect(content.metadata.operation_result.consumed_milligas).toEqual('1420108'); - expect(content.metadata.operation_result.originated_rollup).toEqual( - 'txr1YTdi9BktRmybwhgkhRK7WPrutEWVGJT7w' - ); - - expect(content.metadata.operation_result.balance_updates).toBeDefined(); - expect(content.metadata.operation_result.balance_updates![0].kind).toEqual('contract'); - expect(content.metadata.operation_result.balance_updates![0].contract).toEqual( - 'tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ' - ); - expect(content.metadata.operation_result.balance_updates![0].change).toEqual('-1000000'); - expect(content.metadata.operation_result.balance_updates![0].origin).toEqual('block'); - - expect(content.metadata.operation_result.balance_updates![1].kind).toEqual('burned'); - expect(content.metadata.operation_result.balance_updates![1].category).toEqual( - 'storage fees' - ); - expect(content.metadata.operation_result.balance_updates![1].change).toEqual('1000000'); - expect(content.metadata.operation_result.balance_updates![1].origin).toEqual('block'); - done(); - }); - - it('should access the properties of the operation type tx_rollup_submit_batch, proto13', async (done) => { - httpBackend.createRequest.mockReturnValue(Promise.resolve(blockJakartanetResponse)); - - const response = await client.getBlock(); - const content = response.operations[3][0] - .contents[1] as OperationContentsAndResultTxRollupSubmitBatch; - - expect(content.kind).toEqual(OpKind.TX_ROLLUP_SUBMIT_BATCH); - expect(content.source).toEqual('tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ'); - expect(content.fee).toEqual('476'); - expect(content.counter).toEqual('173978'); - expect(content.gas_limit).toEqual('2209'); - expect(content.storage_limit).toEqual('0'); - expect(content.rollup).toEqual('txr1YTdi9BktRmybwhgkhRK7WPrutEWVGJT7w'); - expect(content.content).toEqual('626c6f62'); - - expect(content.metadata.balance_updates![0].kind).toEqual('contract'); - expect(content.metadata.balance_updates![0].contract).toEqual( - 'tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ' - ); - expect(content.metadata.balance_updates![0].change).toEqual('-476'); - expect(content.metadata.balance_updates![0].origin).toEqual('block'); - - expect(content.metadata.balance_updates![1].kind).toEqual('accumulator'); - expect(content.metadata.balance_updates![1].category).toEqual('block fees'); - expect(content.metadata.balance_updates![1].change).toEqual('476'); - expect(content.metadata.balance_updates![1].origin).toEqual('block'); - - expect(content.metadata.operation_result.status).toEqual('applied'); - expect(content.metadata.operation_result.balance_updates).toBeDefined(); - expect(content.metadata.operation_result.consumed_gas).toEqual('2109'); - expect(content.metadata.operation_result.consumed_milligas).toEqual('2108268'); - expect(content.metadata.operation_result.paid_storage_size_diff).toEqual('0'); - done(); - }); - - it('should access the properties of the operation type tx_rollup_commit, proto13', async (done) => { - httpBackend.createRequest.mockReturnValue(Promise.resolve(blockJakartanetResponse)); - - const response = await client.getBlock(); - const content = response.operations[3][0] - .contents[2] as OperationContentsAndResultTxRollupCommit; - - expect(content.kind).toEqual(OpKind.TX_ROLLUP_COMMIT); - expect(content.source).toEqual('tz1gqDrJYH8rTkdG3gCLTtRA1d7UZDjYFNRY'); - expect(content.fee).toEqual('735'); - expect(content.counter).toEqual('182217'); - expect(content.gas_limit).toEqual('3838'); - expect(content.storage_limit).toEqual('0'); - expect(content.rollup).toEqual('txr1Nbn66mC1yYHBkfD3ink45XVJso6QJZeHe'); - - expect(content.commitment).toBeDefined(); - expect(content.commitment.level).toEqual(1); - expect(content.commitment.messages[0]).toEqual( - 'txmr344vtdPzvWsfnoSd3mJ3MCFA5ehKLQs1pK9WGcX4FEACg1rVgC' - ); - expect(content.commitment.predecessor).toEqual( - 'txc3PQbuB4fmpXMq2NqXGpCnu8EDotTWeHf5w3jJRpyQHSNKRug3U' - ); - expect(content.commitment.inbox_merkle_root).toEqual( - 'txi3Ef5CSsBWRaqQhWj2zg51J3tUqHFD47na6ex7zcboTG5oXEFrm' - ); - - expect(content.metadata.balance_updates).toBeDefined(); - - expect(content.metadata.balance_updates![0].kind).toEqual('contract'); - expect(content.metadata.balance_updates![0].contract).toEqual( - 'tz1gqDrJYH8rTkdG3gCLTtRA1d7UZDjYFNRY' - ); - expect(content.metadata.balance_updates![0].change).toEqual('-735'); - expect(content.metadata.balance_updates![0].origin).toEqual('block'); - - expect(content.metadata.balance_updates![1].kind).toEqual('accumulator'); - expect(content.metadata.balance_updates![1].category).toEqual('block fees'); - expect(content.metadata.balance_updates![1].change).toEqual('735'); - expect(content.metadata.balance_updates![1].origin).toEqual('block'); - - expect(content.metadata.operation_result.status).toEqual('applied'); - expect(content.metadata.operation_result.balance_updates).toBeDefined(); - expect(content.metadata.operation_result.consumed_gas).toEqual('3738'); - expect(content.metadata.operation_result.consumed_milligas).toEqual('3737532'); - done(); - }); - - it('should access the properties of the operation type tx_rollup_finalize_commitment, proto13', async (done) => { - httpBackend.createRequest.mockReturnValue(Promise.resolve(blockJakartanetResponse)); - - const response = await client.getBlock(); - const content = response.operations[3][0] - .contents[3] as OperationContentsAndResultTxRollupFinalizeCommitment; - - expect(content.kind).toEqual(OpKind.TX_ROLLUP_FINALIZE_COMMITMENT); - expect(content.source).toEqual('tz1gqDrJYH8rTkdG3gCLTtRA1d7UZDjYFNRY'); - expect(content.fee).toEqual('507'); - expect(content.counter).toEqual('182232'); - expect(content.gas_limit).toEqual('2602'); - expect(content.storage_limit).toEqual('0'); - expect(content.rollup).toEqual('txr1RHjM395hdwNfgpM8GixQrPAimk7i2Tjy1'); - - expect(content.metadata.balance_updates).toBeDefined(); - - expect(content.metadata.balance_updates![0].kind).toEqual('contract'); - expect(content.metadata.balance_updates![0].contract).toEqual( - 'tz1gqDrJYH8rTkdG3gCLTtRA1d7UZDjYFNRY' - ); - expect(content.metadata.balance_updates![0].change).toEqual('-507'); - expect(content.metadata.balance_updates![0].origin).toEqual('block'); - - expect(content.metadata.balance_updates![1].kind).toEqual('accumulator'); - expect(content.metadata.balance_updates![1].category).toEqual('block fees'); - expect(content.metadata.balance_updates![1].change).toEqual('507'); - expect(content.metadata.balance_updates![1].origin).toEqual('block'); - - expect(content.metadata.operation_result.status).toEqual('applied'); - expect(content.metadata.operation_result.balance_updates).toBeDefined(); - expect(content.metadata.operation_result.consumed_gas).toEqual('2502'); - expect(content.metadata.operation_result.consumed_milligas).toEqual('2501420'); - expect(content.metadata.operation_result.level).toEqual(0); - done(); - }); - - it('should access the properties of the operation type tx_rollup_dispatch_tickets, proto13', async (done) => { - httpBackend.createRequest.mockReturnValue(Promise.resolve(blockJakartanetResponse)); - - const response = await client.getBlock(); - const content = response.operations[3][0] - .contents[4] as OperationContentsAndResultTxRollupDispatchTickets; - - expect(content.kind).toEqual(OpKind.TX_ROLLUP_DISPATCH_TICKETS); - expect(content.source).toEqual('tz1inuxjXxKhd9e4b97N1Wgz7DwmZSxFcDpM'); - expect(content.fee).toEqual('835'); - expect(content.counter).toEqual('252405'); - expect(content.gas_limit).toEqual('4354'); - expect(content.storage_limit).toEqual('86'); - expect(content.tx_rollup).toEqual('txr1YMZxstAHqQ9V313sYjLBCHBXsvSmDZuTs'); - expect(content.level).toEqual(4); - expect(content.context_hash).toEqual('CoV7iqRirVx7sZa5TAK9ymoEJBrW6z4hwwrzMhz6YLeHYXrQwRWG'); - expect(content.message_index).toEqual(0); - expect(content.message_result_path).toBeDefined(); - expect(content.message_result_path[0]).toEqual( - 'txM2eYt63gJ98tv3z4nj3aWPMzpjLnW9xpUdmz4ftMnbvNG34Y4wB' - ); - - expect(content.tickets_info).toBeDefined(); - - expect((content.tickets_info[0].contents as MichelsonV1ExpressionBase).string).toEqual( - 'third-deposit' - ); - expect((content.tickets_info[0].ty as MichelsonV1ExpressionExtended).prim).toEqual('string'); - expect(content.tickets_info[0].ticketer).toEqual('KT1EMQxfYVvhTJTqMiVs2ho2dqjbYfYKk6BY'); - expect(content.tickets_info[0].amount).toEqual('2'); - expect(content.tickets_info[0].claimer).toEqual('tz1inuxjXxKhd9e4b97N1Wgz7DwmZSxFcDpM'); - - done(); - }); - - it('should access the properties of the operation type tx_rollup_remove_commitment, proto13', async (done) => { - httpBackend.createRequest.mockReturnValue(Promise.resolve(blockJakartanetResponse)); - - const response = await client.getBlock(); - const content = response.operations[3][0] - .contents[5] as OperationContentsAndResultTxRollupRemoveCommitment; - - expect(content.kind).toEqual(OpKind.TX_ROLLUP_REMOVE_COMMITMENT); - expect(content.source).toEqual('tz1M1PXyMAhAsXroc6DtuWUUeHvb79ZzCnCp'); - expect(content.fee).toEqual('574'); - expect(content.counter).toEqual('252310'); - expect(content.gas_limit).toEqual('3272'); - expect(content.storage_limit).toEqual('0'); - expect(content.rollup).toEqual('txr1YMZxstAHqQ9V313sYjLBCHBXsvSmDZuTs'); - - expect(content.metadata.balance_updates).toBeDefined(); - - expect(content.metadata.balance_updates![0].kind).toEqual('contract'); - expect(content.metadata.balance_updates![0].contract).toEqual( - 'tz1M1PXyMAhAsXroc6DtuWUUeHvb79ZzCnCp' - ); - - expect(content.metadata.balance_updates![1].kind).toEqual('accumulator'); - expect(content.metadata.balance_updates![1].category).toEqual('block fees'); - expect(content.metadata.balance_updates![1].change).toEqual('574'); - expect(content.metadata.balance_updates![1].origin).toEqual('block'); - - expect(content.metadata.operation_result.status).toEqual('applied'); - expect(content.metadata.operation_result.balance_updates).toBeDefined(); - expect(content.metadata.operation_result.consumed_gas).toEqual('3172'); - expect(content.metadata.operation_result.consumed_milligas).toEqual('3171088'); - expect(content.metadata.operation_result.level).toEqual(0); - done(); - }); - - it('should access the properties of the operation type tx_rollup_rejection, proto13', async (done) => { - httpBackend.createRequest.mockReturnValue(Promise.resolve(blockJakartanetResponse)); - - const response = await client.getBlock(); - const content = response.operations[3][0] - .contents[6] as OperationContentsAndResultTxRollupRejection; - - expect(content.kind).toEqual(OpKind.TX_ROLLUP_REJECTION); - expect(content.source).toEqual('tz1MDU45gNc9Ko1Q9obcz6hQkKSMiQRib6GZ'); - expect(content.fee).toEqual('2837'); - expect(content.counter).toEqual('266515'); - expect(content.gas_limit).toEqual('11633'); - expect(content.storage_limit).toEqual('0'); - expect(content.rollup).toEqual('txr1V16e1hXyVKndP4aE8cujRfryoHTiHK9fG'); - expect(content.level).toEqual(11); - - expect(content.message.batch).toBeDefined(); - expect(content.message.batch).toEqual( - '01b2530bd9f4d594ee6116286cbb045a972305e38e6365b396f49d153815fbdd15c8974b7fdc50aee4bc3f8195e95075ab0fca5d31927917ede7a408fe70c61cd4a0525b2836eca0e797cdf9ae9b3bf58735fd62a7bf21775d46940ae9bd83a8d501130187e8c631aba41d88a67da49cf5f4db947fdf5a76084f1d4b6c14531f6582b239db26dd0375ca7172cdbecd8b6f080ffa58c748f83cc7a2afce164c1bcc53712ff5a9e50c39fb0172acda0a' - ); - expect(content.message_position).toEqual('0'); - expect(content.message_path[0]).toEqual( - 'txi1WZKF1fkUWfKbmaHbb5b8gn68rKSyUy4k7NnSVY4p79BKYz5RB' - ); - expect(content.message_result_hash).toEqual( - 'txmr344vtdPzvWsfnoSd3mJ3MCFA5ehKLQs1pK9WGcX4FEACg1rVgC' - ); - expect(content.message_result_path[0]).toEqual( - 'txM2eYt63gJ98tv3z4nj3aWPMzpjLnW9xpUdmz4ftMnbvNG34Y4wB' - ); - - expect(content.previous_message_result).toBeDefined(); - expect(content.previous_message_result.context_hash).toEqual( - 'CoVUv68XdJts8f6Ysaoxm4jnt4JKXfqx8WYVFnkj2UFfgKHJUrLs' - ); - expect(content.previous_message_result.withdraw_list_hash).toEqual( - 'txw1sFoLju3ySMAdY6v1dcHUMqJ4Zxc1kcynC8xkYgCmH6bpNSDhV' - ); - expect(content.previous_message_result_path[0]).toEqual( - 'txM2eYt63gJ98tv3z4nj3aWPMzpjLnW9xpUdmz4ftMnbvNG34Y4wB' - ); - - expect(content.proof).toBeDefined(); - - const proof = content.proof as TxRollupProof; - expect(proof.version).toEqual(3); - expect((proof.before as { node: string }).node).toEqual( - 'CoVUv68XdJts8f6Ysaoxm4jnt4JKXfqx8WYVFnkj2UFfgKHJUrLs' - ); - expect((proof.after as { node: string }).node).toEqual( - 'CoUn3twa3TmvNby5VAGeN2jHvzbfpmJAXcyDHJuLLAuuLiaZZnzC' - ); - - expect(proof.state).toBeDefined(); - - const inodeState1 = (proof.state[0] as { inode: Inode }).inode; - expect(inodeState1.length).toEqual('14'); - expect(inodeState1.proofs).toEqual([ - 'CoVbQczQE6uDug4tWErtLgszzZBRDJKEGHgcQp8jGYSEfBLnsMXH', - 'CoWZ31tY65qh38Sfgm64Ny8kDTLQQMr5xuRDkDkz1JopiBnPDu11', - ]); - - const inodeState2 = (proof.state[2] as { inode: Inode }).inode; - expect(inodeState2.length).toEqual('3'); - expect(inodeState2.proofs).toEqual([ - null, - 'CoVPGhaCkq2yV5JJs8Bxq1idndEhBn3SCJe3rSH5eYvr9BnRnv8i', - ]); - - const otherEltsNode = ( - (proof.state[4] as { other_elts: OtherElts }).other_elts as { - node: [string, { value: string }][]; - } - ).node; - expect(otherEltsNode[0]).toEqual([ - '0287e8c631aba41d88a67da49cf5f4db947fdf5a76', - { value: 'CoW4fTVfN6WBZ6XqT38EqLzn5raQUYkjSL4Ce7J2KsGKcFPjgUJy' }, - ]); - - const otherEltsOtherElts = ( - (proof.state[5] as { other_elts: OtherElts }).other_elts as { - other_elts: { value: any }; - } - ).other_elts; - expect(otherEltsOtherElts).toEqual({ value: '00000000' }); - - expect(content.metadata.balance_updates).toBeDefined(); - - expect(content.metadata.balance_updates![0].kind).toEqual('contract'); - expect(content.metadata.balance_updates![0].contract).toEqual( - 'tz1MDU45gNc9Ko1Q9obcz6hQkKSMiQRib6GZ' - ); - expect(content.metadata.balance_updates![0].change).toEqual('-2837'); - expect(content.metadata.balance_updates![0].origin).toEqual('block'); - - expect(content.metadata.balance_updates![1].kind).toEqual('accumulator'); - expect(content.metadata.balance_updates![1].category).toEqual('block fees'); - expect(content.metadata.balance_updates![1].change).toEqual('2837'); - expect(content.metadata.balance_updates![1].origin).toEqual('block'); - - expect(content.metadata.operation_result.status).toEqual('applied'); - - expect(content.metadata.operation_result.balance_updates).toBeDefined(); - expect(content.metadata.operation_result.balance_updates![0].kind).toEqual('freezer'); - expect(content.metadata.operation_result.balance_updates![0].category!).toEqual('bonds'); - expect(content.metadata.operation_result.balance_updates![0].contract!).toEqual( - 'tz1Lg9iLTS8Hk6kLfTN6rrrL9gYPfsTQ9z75' - ); - expect(content.metadata.operation_result.balance_updates![0].bond_id!.tx_rollup).toEqual( - 'txr1V16e1hXyVKndP4aE8cujRfryoHTiHK9fG' - ); - expect(content.metadata.operation_result.balance_updates![0].change).toEqual('-10000000000'); - expect(content.metadata.operation_result.balance_updates![0].origin!).toEqual('block'); - - expect(content.metadata.operation_result.balance_updates![1].kind).toEqual('burned'); - expect(content.metadata.operation_result.balance_updates![1].category!).toEqual( - 'tx_rollup_rejection_punishments' - ); - expect(content.metadata.operation_result.balance_updates![1].change).toEqual('10000000000'); - expect(content.metadata.operation_result.balance_updates![1].origin!).toEqual('block'); - - expect(content.metadata.operation_result.balance_updates![2].kind).toEqual('minted'); - expect(content.metadata.operation_result.balance_updates![2].category!).toEqual( - 'tx_rollup_rejection_rewards' - ); - expect(content.metadata.operation_result.balance_updates![2].change).toEqual('-5000000000'); - expect(content.metadata.operation_result.balance_updates![2].origin!).toEqual('block'); - - expect(content.metadata.operation_result.balance_updates![3].kind).toEqual('contract'); - expect(content.metadata.operation_result.balance_updates![3].contract!).toEqual( - 'tz1MDU45gNc9Ko1Q9obcz6hQkKSMiQRib6GZ' - ); - expect(content.metadata.operation_result.balance_updates![3].change).toEqual('5000000000'); - expect(content.metadata.operation_result.balance_updates![3].origin!).toEqual('block'); - - expect(content.metadata.operation_result.consumed_gas).toEqual('11533'); - expect(content.metadata.operation_result.consumed_milligas).toEqual('11532006'); - - done(); - }); - - it('should access the properties of operation type tx_rollup_return_bond, proto13', async (done) => { - httpBackend.createRequest.mockReturnValue(Promise.resolve(blockJakartanetResponse)); - - const response = await client.getBlock(); - const content = response.operations[3][0] - .contents[7] as OperationContentsAndResultTxRollupReturnBond; - - expect(content.kind).toEqual(OpKind.TX_ROLLUP_RETURN_BOND); - expect(content.source).toEqual('tz2Q3efwpRvKL2Tvta8h6N5niV54Rw8iSEes'); - expect(content.fee).toEqual('512'); - expect(content.counter).toEqual('36'); - expect(content.gas_limit).toEqual('2676'); - expect(content.storage_limit).toEqual('0'); - expect(content.rollup).toEqual('txr1TeZQiQrjaEop11Lh8fpsTdyJgQvr5igST'); - - expect(content.metadata.balance_updates).toBeDefined(); - expect(content.metadata.balance_updates![0].kind).toEqual('contract'); - expect(content.metadata.balance_updates![0].contract).toEqual( - 'tz2Q3efwpRvKL2Tvta8h6N5niV54Rw8iSEes' - ); - expect(content.metadata.balance_updates![0].change).toEqual('-512'); - expect(content.metadata.balance_updates![0].origin).toEqual('block'); - - expect(content.metadata.balance_updates![1].kind).toEqual('accumulator'); - expect(content.metadata.balance_updates![1].category).toEqual('block fees'); - expect(content.metadata.balance_updates![1].change).toEqual('512'); - expect(content.metadata.balance_updates![1].origin).toEqual('block'); - - expect(content.metadata.operation_result.status).toEqual('applied'); - expect(content.metadata.operation_result.balance_updates![0].kind).toEqual('freezer'); - expect(content.metadata.operation_result.balance_updates![0].category).toEqual('bonds'); - expect(content.metadata.operation_result.balance_updates![0].contract).toEqual( - 'tz2Q3efwpRvKL2Tvta8h6N5niV54Rw8iSEes' - ); - expect(content.metadata.operation_result.balance_updates![0].bond_id!.tx_rollup).toEqual( - 'txr1TeZQiQrjaEop11Lh8fpsTdyJgQvr5igST' - ); - expect(content.metadata.operation_result.balance_updates![0].change).toEqual('-10000000000'); - expect(content.metadata.operation_result.balance_updates![0].origin).toEqual('block'); - expect(content.metadata.operation_result.consumed_milligas).toEqual('2575028'); - - done(); - }); - it('should be able to access the properties of operation type transfer_ticket, proto14', async (done) => { httpBackend.createRequest.mockReturnValue(Promise.resolve(blockMondaynetResponse)); const response = await client.getBlock(); @@ -3902,6 +3467,7 @@ describe('RpcClient test', () => { expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ method: 'POST', url: 'root/chains/test/blocks/head/helpers/scripts/run_operation', + query: { version: '0' }, }); expect(httpBackend.createRequest.mock.calls[0][1]).toEqual(testData); @@ -3964,6 +3530,7 @@ describe('RpcClient test', () => { expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ method: 'POST', url: 'root/chains/test/blocks/head/helpers/scripts/simulate_operation', + query: { version: '0' }, }); expect(httpBackend.createRequest.mock.calls[0][1]).toEqual(testData); @@ -4296,73 +3863,6 @@ describe('RpcClient test', () => { }); }); - describe('getTxRollupState', () => { - it('should query the correct url and return a rollup state response', async (done) => { - const mockResponse = { - last_removed_commitment_hashes: null, - finalized_commitments: { - next: 0, - }, - unfinalized_commitments: { - next: 0, - }, - uncommitted_inboxes: { - newest: 0, - oldest: 0, - }, - commitment_newest_hash: null, - tezos_head_level: 63691, - burn_per_byte: '0', - allocated_storage: '4000', - occupied_storage: '40', - inbox_ema: 0, - commitments_watermark: null, - }; - - httpBackend.createRequest.mockReturnValue(Promise.resolve(mockResponse)); - - const txRollupState = await client.getTxRollupState('txrID'); - - expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ - method: 'GET', - url: `root/chains/test/blocks/head/context/tx_rollup/txrID/state`, - }); - - expect(txRollupState).toBeDefined(); - expect(txRollupState).toEqual(mockResponse); - - done(); - }); - }); - - describe('getTxRollupInbox', () => { - it('should query the correct url and return a rollup inbox response', async (done) => { - httpBackend.createRequest.mockReturnValue( - Promise.resolve({ - inbox_length: 1, - cumulated_size: 4, - merkle_root: 'txi3Ef5CSsBWRaqQhWj2zg51J3tUqHFD47na6ex7zcboTG5oXEFrm', - }) - ); - - const txRollupInbox = await client.getTxRollupInbox('txrID', '0'); - - expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ - method: 'GET', - url: `root/chains/test/blocks/head/context/tx_rollup/txrID/inbox/0`, - }); - - expect(txRollupInbox).toBeDefined(); - expect(txRollupInbox!.inbox_length).toEqual(1); - expect(txRollupInbox!.cumulated_size).toEqual(4); - expect(txRollupInbox!.merkle_root).toEqual( - 'txi3Ef5CSsBWRaqQhWj2zg51J3tUqHFD47na6ex7zcboTG5oXEFrm' - ); - - done(); - }); - }); - describe('smartRollupOriginate', () => { it('should have correct types to access smart_rollup_originate results', async (done) => { httpBackend.createRequest.mockReturnValue(Promise.resolve(smartRollupOriginateResponse)); @@ -4380,9 +3880,6 @@ describe('RpcClient test', () => { expect(content.kernel).toEqual( '23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a' ); - expect(content.origination_proof).toEqual( - '0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea18030fab8a3adde4b553c4d391e9cd19ee13b17941c1f49c040d621bbfbea964993810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9' - ); expect(content.parameters_ty).toEqual({ prim: 'bytes' }); const soruResult = content.metadata.operation_result; @@ -4524,7 +4021,6 @@ describe('RpcClient test', () => { expect(content.gas_limit).toEqual('6986'); expect(content.storage_limit).toEqual('0'); expect(content.rollup).toEqual('sr1CCHLfB1jjz4ikB2bm4XGPvTjafVgUzhLB'); - expect(content.commitment).toEqual('src12mERNVEb3N1EVmbUbudctzajiezmd3q6EsgLexkgxNCHK8PNBi'); const soruResult = content.metadata.operation_result; @@ -4717,7 +4213,8 @@ describe('RpcClient test', () => { describe('getPendingOperations', () => { it('should query the correct url and retrun pending operations in mempool', async (done) => { httpBackend.createRequest.mockReturnValue(Promise.resolve(pendingOperationsResponse)); - const response: PendingOperations = await client.getPendingOperations(); + const response: PendingOperationsV1 | PendingOperationsV2 = + await client.getPendingOperations(); expect(httpBackend.createRequest.mock.calls[0][0]).toEqual({ method: 'GET', diff --git a/packages/taquito-sapling/package.json b/packages/taquito-sapling/package.json index 846f3f9e36..9fa65c3834 100644 --- a/packages/taquito-sapling/package.json +++ b/packages/taquito-sapling/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/sapling", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Allows reading and preparing sapling transactions", "keywords": [ "tezos", @@ -69,10 +69,10 @@ "@airgap/sapling-wasm": "0.0.9", "@stablelib/nacl": "^1.0.3", "@stablelib/random": "^1.0.1", - "@taquito/core": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0", "bip39": "3.0.4", "blakejs": "^1.2.1", diff --git a/packages/taquito-sapling/src/version.ts b/packages/taquito-sapling/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-sapling/src/version.ts +++ b/packages/taquito-sapling/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-signer/package.json b/packages/taquito-signer/package.json index 39952ba5c1..61835568e8 100644 --- a/packages/taquito-signer/package.json +++ b/packages/taquito-signer/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/signer", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Provide signing functionality to be with taquito", "keywords": [ "tezos", @@ -73,9 +73,9 @@ "@stablelib/nacl": "^1.0.4", "@stablelib/pbkdf2": "^1.0.1", "@stablelib/sha512": "^1.0.1", - "@taquito/core": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "@types/bn.js": "^5.1.1", "bip39": "3.0.4", "elliptic": "^6.5.4", diff --git a/packages/taquito-signer/src/version.ts b/packages/taquito-signer/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-signer/src/version.ts +++ b/packages/taquito-signer/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-tzip12/package.json b/packages/taquito-tzip12/package.json index 9c31656f6a..13d0413cb4 100644 --- a/packages/taquito-tzip12/package.json +++ b/packages/taquito-tzip12/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/tzip12", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Tzip12", "keywords": [ "tezos", @@ -63,10 +63,10 @@ ] }, "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/tzip16": "^17.3.1" + "@taquito/core": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/tzip16": "^18.0.0-RC.0" }, "devDependencies": { "@types/bluebird": "^3.5.36", diff --git a/packages/taquito-tzip12/src/version.ts b/packages/taquito-tzip12/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-tzip12/src/version.ts +++ b/packages/taquito-tzip12/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-tzip16/package.json b/packages/taquito-tzip16/package.json index 54dbeb8513..785430706c 100644 --- a/packages/taquito-tzip16/package.json +++ b/packages/taquito-tzip16/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/tzip16", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "Tzip16", "keywords": [ "tezos", @@ -62,12 +62,12 @@ ] }, "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/taquito": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/taquito": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0", "crypto-js": "^4.1.1" }, diff --git a/packages/taquito-tzip16/src/version.ts b/packages/taquito-tzip16/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-tzip16/src/version.ts +++ b/packages/taquito-tzip16/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-utils/package.json b/packages/taquito-utils/package.json index 20c211badf..7edfebd97d 100644 --- a/packages/taquito-utils/package.json +++ b/packages/taquito-utils/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/utils", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "converts michelson data and types into convenient JS/TS objects", "keywords": [ "tezos", @@ -65,7 +65,7 @@ "dependencies": { "@stablelib/blake2b": "^1.0.1", "@stablelib/ed25519": "^1.0.3", - "@taquito/core": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", "@types/bs58check": "^2.1.0", "bignumber.js": "^9.1.0", "blakejs": "^1.2.1", diff --git a/packages/taquito-utils/src/constants.ts b/packages/taquito-utils/src/constants.ts index cf66473c74..7699e47383 100644 --- a/packages/taquito-utils/src/constants.ts +++ b/packages/taquito-utils/src/constants.ts @@ -44,7 +44,6 @@ export enum Prefix { ZET1 = 'zet1', // sapling_address //rollups - TXR1 = 'txr1', TXI = 'txi', TXM = 'txm', TXC = 'txc', @@ -101,7 +100,6 @@ export const prefix = { [Prefix.SASK]: new Uint8Array([11, 237, 20, 92]), [Prefix.ZET1]: new Uint8Array([18, 71, 40, 223]), - [Prefix.TXR1]: new Uint8Array([1, 128, 120, 31]), [Prefix.TXI]: new Uint8Array([79, 148, 196]), [Prefix.TXM]: new Uint8Array([79, 149, 30]), [Prefix.TXC]: new Uint8Array([79, 148, 17]), @@ -138,7 +136,6 @@ export const prefixLength: { [key: string]: number } = { [Prefix.VH]: 32, [Prefix.SASK]: 169, [Prefix.ZET1]: 43, - [Prefix.TXR1]: 20, [Prefix.TXI]: 32, [Prefix.TXM]: 32, [Prefix.TXC]: 32, diff --git a/packages/taquito-utils/src/taquito-utils.ts b/packages/taquito-utils/src/taquito-utils.ts index 47062f30ec..d9a86fde1a 100644 --- a/packages/taquito-utils/src/taquito-utils.ts +++ b/packages/taquito-utils/src/taquito-utils.ts @@ -91,19 +91,11 @@ export function b58decode(payload: string) { [prefix.tz3.toString()]: '0002', }; - const rollupPrefMap = { - [prefix.txr1.toString()]: '02', - }; - const pref = prefixMap[new Uint8Array(buf.slice(0, 3)).toString()]; - const rollupPref = rollupPrefMap[new Uint8Array(buf.slice(0, 4)).toString()]; if (pref) { // tz addresses const hex = buf2hex(buf.slice(3)); return pref + hex; - } else if (rollupPref) { - const hex = buf2hex(buf.slice(4)); - return rollupPref + hex + '00'; } else { // other (kt addresses) return '01' + buf2hex(buf.slice(3, 42)) + '00'; @@ -138,9 +130,6 @@ export function encodePubKey(value: string) { }; return b58cencode(value.substring(4), pref[value.substring(0, 4)]); - } else if (value.substring(0, 2) === '02') { - // 42 also works but the removes the 00 padding at the end - return b58cencode(value.substring(2, value.length - 2), prefix.txr1); } return b58cencode(value.substring(2, 42), prefix.KT); } diff --git a/packages/taquito-utils/src/validators.ts b/packages/taquito-utils/src/validators.ts index 90df84e822..16ad2c98ac 100644 --- a/packages/taquito-utils/src/validators.ts +++ b/packages/taquito-utils/src/validators.ts @@ -62,7 +62,7 @@ function validatePrefixedValue(value: string, prefixes: Prefix[]) { } const implicitPrefix = [Prefix.TZ1, Prefix.TZ2, Prefix.TZ3, Prefix.TZ4]; -const contractPrefix = [Prefix.KT1, Prefix.TXR1]; +const contractPrefix = [Prefix.KT1]; const signaturePrefix = [Prefix.EDSIG, Prefix.P2SIG, Prefix.SPSIG, Prefix.SIG]; const pkPrefix = [Prefix.EDPK, Prefix.SPPK, Prefix.P2PK, Prefix.BLPK]; const operationPrefix = [Prefix.O]; diff --git a/packages/taquito-utils/src/verify-signature.ts b/packages/taquito-utils/src/verify-signature.ts index 658a0cb867..29c214fbba 100644 --- a/packages/taquito-utils/src/verify-signature.ts +++ b/packages/taquito-utils/src/verify-signature.ts @@ -23,7 +23,7 @@ type SigPrefix = Prefix.EDSIG | Prefix.SPSIG | Prefix.P2SIG | Prefix.SIG; * @description Verify signature of a payload * * @param messageBytes The forged message including the magic byte (11 for block, - * 12 for preendorsement, 13 for endorsement, 3 for generic, 5 for the PACK format of michelson) + * 12 for preendorsement/preattestation, 13 for endorsement/attestation, 3 for generic, 5 for the PACK format of michelson) * @param publicKey The public key to verify the signature against * @param signature The signature to verify * @returns A boolean indicating if the signature matches diff --git a/packages/taquito-utils/src/version.ts b/packages/taquito-utils/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito-utils/src/version.ts +++ b/packages/taquito-utils/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito-utils/test/taquito-utils.spec.ts b/packages/taquito-utils/test/taquito-utils.spec.ts index dcda875e77..3846f37c87 100644 --- a/packages/taquito-utils/test/taquito-utils.spec.ts +++ b/packages/taquito-utils/test/taquito-utils.spec.ts @@ -51,12 +51,6 @@ describe('encodePubKey', () => { 'KT1XM8VUFBiM9AC5czWU15fEeE9nmuEYWt3Y' ); }); - - it('Should encode address properly (txr1)', () => { - expect(encodePubKey('02f16e732d45ba6f24d5ec421f20ab199b3a82907100')).toEqual( - 'txr1jZaQfi9zdwzJteYkRBSN9D7RDvMh1QNkL' - ); - }); }); describe('encodeKey', () => { diff --git a/packages/taquito-utils/test/validators.spec.ts b/packages/taquito-utils/test/validators.spec.ts index cee06be362..0759d76f9d 100644 --- a/packages/taquito-utils/test/validators.spec.ts +++ b/packages/taquito-utils/test/validators.spec.ts @@ -42,26 +42,42 @@ describe('validateAddress', () => { ); expect(validateAddress('sr166cywS6HJx9gmqMU28Vo284gPQaPcGmYW')).toEqual(ValidationResult.VALID); - expect(validateAddress('sr166cywS6HJx9gmqMU28Vo284gPQaPcGmY1')).toEqual(ValidationResult.INVALID_CHECKSUM); + expect(validateAddress('sr166cywS6HJx9gmqMU28Vo284gPQaPcGmY1')).toEqual( + ValidationResult.INVALID_CHECKSUM + ); }); }); describe('validateSmartRollupAddress', () => { it('Validate smart rollup address properly', () => { - expect(validateSmartRollupAddress('tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn')).toEqual(ValidationResult.NO_PREFIX_MATCHED); - expect(validateSmartRollupAddress('KT1Fe71jyjrxFg9ZrYqtvaX7uQjcLo7svE4D')).toEqual(ValidationResult.NO_PREFIX_MATCHED); - expect(validateSmartRollupAddress('tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m')).toEqual(ValidationResult.NO_PREFIX_MATCHED); - expect(validateSmartRollupAddress('tz3VEZ4k6a4Wx42iyev6i2aVAptTRLEAivNN')).toEqual(ValidationResult.NO_PREFIX_MATCHED); + expect(validateSmartRollupAddress('tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn')).toEqual( + ValidationResult.NO_PREFIX_MATCHED + ); + expect(validateSmartRollupAddress('KT1Fe71jyjrxFg9ZrYqtvaX7uQjcLo7svE4D')).toEqual( + ValidationResult.NO_PREFIX_MATCHED + ); + expect(validateSmartRollupAddress('tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m')).toEqual( + ValidationResult.NO_PREFIX_MATCHED + ); + expect(validateSmartRollupAddress('tz3VEZ4k6a4Wx42iyev6i2aVAptTRLEAivNN')).toEqual( + ValidationResult.NO_PREFIX_MATCHED + ); expect(validateSmartRollupAddress('KT1Fe71jyjrxFg9ZrYqtvaX7uQjcLo7svE4D%test')).toEqual( ValidationResult.NO_PREFIX_MATCHED ); - expect(validateSmartRollupAddress('tz4EECtMxAuJ9UDLaiMZH7G1GCFYUWsj8HZn')).toEqual(ValidationResult.NO_PREFIX_MATCHED); + expect(validateSmartRollupAddress('tz4EECtMxAuJ9UDLaiMZH7G1GCFYUWsj8HZn')).toEqual( + ValidationResult.NO_PREFIX_MATCHED + ); expect(validateSmartRollupAddress('test')).toEqual(ValidationResult.NO_PREFIX_MATCHED); expect(validateSmartRollupAddress('')).toEqual(ValidationResult.NO_PREFIX_MATCHED); - expect(validateSmartRollupAddress('sr166cywS6HJx9gmqMU28Vo284gPQaPcGmYW')).toEqual(ValidationResult.VALID); - expect(validateSmartRollupAddress('sr166cywS6HJx9gmqMU28Vo284gPQaPcGmY1')).toEqual(ValidationResult.INVALID_CHECKSUM); + expect(validateSmartRollupAddress('sr166cywS6HJx9gmqMU28Vo284gPQaPcGmYW')).toEqual( + ValidationResult.VALID + ); + expect(validateSmartRollupAddress('sr166cywS6HJx9gmqMU28Vo284gPQaPcGmY1')).toEqual( + ValidationResult.INVALID_CHECKSUM + ); }); }); @@ -99,9 +115,6 @@ describe('validateContractAddress', () => { expect(validateContractAddress('KT1Fe71jyjrxFg9ZrYqtvaX7uQjcLo7svE4D')).toEqual( ValidationResult.VALID ); - expect(validateContractAddress('txr1YNMEtkj5Vkqsbdmt7xaxBTMRZjzS96UAi')).toEqual( - ValidationResult.VALID - ); expect(validateContractAddress('tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn')).toEqual( ValidationResult.NO_PREFIX_MATCHED ); @@ -111,9 +124,6 @@ describe('validateContractAddress', () => { expect(validateContractAddress('tz3VEZ4k6a4Wx42iyev6i2aVAptTRLEAivNN')).toEqual( ValidationResult.NO_PREFIX_MATCHED ); - expect(validateContractAddress('txr1YNMEtkj5Vkqsbdmt7xaxBTMRZjzS96UAu')).toEqual( - ValidationResult.INVALID_CHECKSUM - ); expect( validateContractAddress('KT1Fe71jyjrxFg9ZrYqtvaX7uQjcLo7svE4Dasdasdasdasdadasd') ).toEqual(ValidationResult.INVALID_CHECKSUM); diff --git a/packages/taquito/README.md b/packages/taquito/README.md index f1f7a47a82..ce5bc9dbfd 100644 --- a/packages/taquito/README.md +++ b/packages/taquito/README.md @@ -1,4 +1,4 @@ -# Taquito high-level functions +# Taquito high-level functions *TypeDoc style documentation is available on-line [here](https://tezostaquito.io/typedoc/modules/_taquito_taquito.html)* @@ -7,15 +7,15 @@ The `@taquito/taquito` package contains higher-level functionality that builds u ## CDN Bundle ```html - + ``` ## General Information -The `TezosToolkit` is a facade class that surfaces all of the library's capability and allows its configuration through different providers. +The `TezosToolkit` is a facade class that surfaces all of the library's capability and allows its configuration through different providers. -## Install +## Install ``` npm i --save @taquito/taquito @@ -25,7 +25,7 @@ npm i --save @taquito/taquito ## Minimal configuration ### TezosToolkit instantiation -The `TezosToolkit` constructor takes at least an RPC URL as a parameter. When instantiating the toolkit with a URL, a default instance of `RpcClient` is created. The `RpcClient` class is used to interact with the Tezos network. +The `TezosToolkit` constructor takes at least an RPC URL as a parameter. When instantiating the toolkit with a URL, a default instance of `RpcClient` is created. The `RpcClient` class is used to interact with the Tezos network. ```ts import { TezosToolkit } from '@taquito/taquito'; @@ -114,7 +114,7 @@ Tezos.setProvider( ## Estimation -Use the `estimate` member to estimate fees, gas and storage of operations. +Use the `estimate` member to estimate fees, gas and storage of operations. ```ts const estimate = await Tezos.estimate.transfer(transferParams); @@ -125,12 +125,12 @@ const estimate = await Tezos.estimate.transfer(transferParams); Use the `stream` member to subscribe to specific operations: ```ts -Tezos.setProvider({ - config: { shouldObservableSubscriptionRetry: true, streamerPollingIntervalMilliseconds: 15000 } +Tezos.setProvider({ + config: { shouldObservableSubscriptionRetry: true, streamerPollingIntervalMilliseconds: 15000 } }); -const bakerEndorsementFilter = { - and: [{ source: 'tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m' }, { kind: 'endorsement' }] +const bakerAttestationFilter = { + and: [{ source: 'tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m' }, { kind: 'attestation' }] } const bakerDelegation = { @@ -138,7 +138,7 @@ const bakerDelegation = { } const sub = tezos.stream.subscribeOperation({ - or: [bakerEndorsementFilter, bakerDelegation] + or: [bakerAttestationFilter, bakerDelegation] }) sub.on('data', console.log) diff --git a/packages/taquito/manifest.json b/packages/taquito/manifest.json index cb8b9f53ef..0a2af82250 100644 --- a/packages/taquito/manifest.json +++ b/packages/taquito/manifest.json @@ -1,6 +1,6 @@ { "main.js": { "src": "dist/taquito.min.js", - "integrity": "sha384-BSwSPkCs3OtHNJYV10JxwTLgzumF43f8OrYIioco+nGnZknVuhOhCPOI5f7vnghO" + "integrity": "sha384-OKxdh9s69LXl6UW9FNBGyIzZNrA7GPba1Q5dBz7+jCl/noIYiPC3hiiwImp4HTR5" } } \ No newline at end of file diff --git a/packages/taquito/package.json b/packages/taquito/package.json index ba0c852b3d..c6429367b3 100644 --- a/packages/taquito/package.json +++ b/packages/taquito/package.json @@ -1,6 +1,6 @@ { "name": "@taquito/taquito", - "version": "17.3.1", + "version": "18.0.0-RC.0", "description": "High level functionality that builds upon the other packages in the Tezos Typescript Library Suite.", "keywords": [ "tezos", @@ -77,13 +77,13 @@ ] }, "dependencies": { - "@taquito/core": "^17.3.1", - "@taquito/http-utils": "^17.3.1", - "@taquito/local-forging": "^17.3.1", - "@taquito/michel-codec": "^17.3.1", - "@taquito/michelson-encoder": "^17.3.1", - "@taquito/rpc": "^17.3.1", - "@taquito/utils": "^17.3.1", + "@taquito/core": "^18.0.0-RC.0", + "@taquito/http-utils": "^18.0.0-RC.0", + "@taquito/local-forging": "^18.0.0-RC.0", + "@taquito/michel-codec": "^18.0.0-RC.0", + "@taquito/michelson-encoder": "^18.0.0-RC.0", + "@taquito/rpc": "^18.0.0-RC.0", + "@taquito/utils": "^18.0.0-RC.0", "bignumber.js": "^9.1.0", "rxjs": "^7.8.1" }, diff --git a/packages/taquito/src/batch/rpc-batch-provider.ts b/packages/taquito/src/batch/rpc-batch-provider.ts index 593c298da1..2950a64e8f 100644 --- a/packages/taquito/src/batch/rpc-batch-provider.ts +++ b/packages/taquito/src/batch/rpc-batch-provider.ts @@ -24,7 +24,7 @@ import { TransferTicketParams, IncreasePaidStorageParams, SmartRollupAddMessagesParams, - SmartRollupOriginateParamsWithProof, + SmartRollupOriginateParams, } from '../operations/types'; import { OpKind } from '@taquito/rpc'; import { ContractMethodObject } from '../contract/contract-methods/contract-method-object-param'; @@ -194,7 +194,7 @@ export class OperationBatch extends Provider { * * @param params Smart Rollup Originate operation parameter */ - withSmartRollupOriginate(params: SmartRollupOriginateParamsWithProof) { + withSmartRollupOriginate(params: SmartRollupOriginateParams) { this.operations.push({ kind: OpKind.SMART_ROLLUP_ORIGINATE, ...params }); return this; } diff --git a/packages/taquito/src/constants.ts b/packages/taquito/src/constants.ts index 6127ec379c..6f35a7d4ce 100644 --- a/packages/taquito/src/constants.ts +++ b/packages/taquito/src/constants.ts @@ -2,8 +2,8 @@ export enum DEFAULT_GAS_LIMIT { DELEGATION = 10600, ORIGINATION = 10600, TRANSFER = 10600, - /* This is used for gas_limit. There is no harm in setting a higher limit. - Only if an account has a balance that is very close to the total gas consumption, + /* This is used for gas_limit. There is no harm in setting a higher limit. + Only if an account has a balance that is very close to the total gas consumption, then this margin can fail the operation. Another benefit of this higher value is that then Dapps build with Taquito 17 can still work with Mumbainet, as this value is higher than the reveal cost in Mumbai. @@ -46,6 +46,7 @@ export enum Protocols { PtMumbaii = 'PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc', PtMumbai2 = 'PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1', PtNairobi = 'PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf', + ProxfordS = 'ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8', ProtoALpha = 'ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK', } @@ -64,7 +65,8 @@ export const protocols = { '015': [Protocols.PtLimaPtL], '016': [Protocols.PtMumbai2], // mumbai v2 '017': [Protocols.PtNairobi], - '018': [Protocols.ProtoALpha], + '018': [Protocols.ProxfordS], + '019': [Protocols.ProtoALpha], }; export enum ChainIds { @@ -83,6 +85,7 @@ export enum ChainIds { MUMBAINET = 'NetXQw6nWSnrJ5t', MUMBAINET2 = 'NetXgbcrNtXD2yA', NAIROBINET = 'NetXyuzvDo2Ugzb', + OXFORDNET = 'NetXH6zDyMzRsUy', } export const getRevealGasLimit = (address: string) => diff --git a/packages/taquito/src/contract/prepare.ts b/packages/taquito/src/contract/prepare.ts index 96955e3bb7..fd326cdb4d 100644 --- a/packages/taquito/src/contract/prepare.ts +++ b/packages/taquito/src/contract/prepare.ts @@ -28,7 +28,7 @@ import { SmartRollupAddMessagesParams, RPCSmartRollupAddMessagesOperation, RPCSmartRollupOriginateOperation, - SmartRollupOriginateParamsWithProof, + SmartRollupOriginateParams, ActivationParams, RPCActivateOperation, } from '../operations/types'; @@ -324,9 +324,8 @@ export const createSmartRollupOriginateOperation = async ({ storageLimit, pvmKind, kernel, - originationProof, parametersType, -}: SmartRollupOriginateParamsWithProof) => { +}: SmartRollupOriginateParams) => { return { kind: OpKind.SMART_ROLLUP_ORIGINATE, source, @@ -335,7 +334,6 @@ export const createSmartRollupOriginateOperation = async ({ storage_limit: storageLimit, pvm_kind: pvmKind, kernel, - origination_proof: originationProof, parameters_ty: parametersType, } as RPCSmartRollupOriginateOperation; }; diff --git a/packages/taquito/src/contract/rpc-contract-provider.ts b/packages/taquito/src/contract/rpc-contract-provider.ts index 35dfed1195..d8948ae3f0 100644 --- a/packages/taquito/src/contract/rpc-contract-provider.ts +++ b/packages/taquito/src/contract/rpc-contract-provider.ts @@ -657,13 +657,8 @@ export class RpcContractProvider extends Provider implements ContractProvider, S params, this.estimator.smartRollupOriginate.bind(this.estimator) ); - const originationProof = await this.rpc.getOriginationProof({ - kind: params.pvmKind, - kernel: params.kernel, - }); - const completeParams = { ...params, originationProof }; - const prepared = await this.prepare.smartRollupOriginate({ ...completeParams, ...estimate }); + const prepared = await this.prepare.smartRollupOriginate({ ...params, ...estimate }); const content = prepared.opOb.contents.find( (op) => op.kind === OpKind.SMART_ROLLUP_ORIGINATE ) as OperationContentsSmartRollupOriginate; diff --git a/packages/taquito/src/operations/errors.ts b/packages/taquito/src/operations/errors.ts index cc987b0b78..aa20376ad0 100644 --- a/packages/taquito/src/operations/errors.ts +++ b/packages/taquito/src/operations/errors.ts @@ -9,8 +9,6 @@ import { OperationResultSmartRollupOriginate, OperationResultTransaction, OperationResultTransferTicket, - OperationResultTxRollupOrigination, - OperationResultTxRollupSubmitBatch, PreapplyResponse, TezosGenericOperationError, } from '@taquito/rpc'; @@ -77,8 +75,6 @@ export type MergedOperationResult = OperationResultTransaction & OperationResultOrigination & OperationResultDelegation & OperationResultRegisterGlobalConstant & - OperationResultTxRollupOrigination & - OperationResultTxRollupSubmitBatch & OperationResultTransferTicket & Partial & OperationResultReveal & { diff --git a/packages/taquito/src/operations/smart-rollup-originate-operation.ts b/packages/taquito/src/operations/smart-rollup-originate-operation.ts index 54da137a02..e42b34bb88 100644 --- a/packages/taquito/src/operations/smart-rollup-originate-operation.ts +++ b/packages/taquito/src/operations/smart-rollup-originate-operation.ts @@ -74,10 +74,6 @@ export class SmartRollupOriginateOperation return this.params.kernel; } - get originationProof() { - return this.params.origination_proof; - } - get errors() { return this.operationResults?.errors; } diff --git a/packages/taquito/src/operations/tx-rollup-batch-operation.ts b/packages/taquito/src/operations/tx-rollup-batch-operation.ts deleted file mode 100644 index de58230af5..0000000000 --- a/packages/taquito/src/operations/tx-rollup-batch-operation.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { - OperationContentsAndResult, - OperationContentsAndResultTxRollupSubmitBatch, -} from '@taquito/rpc'; -import { BigNumber } from 'bignumber.js'; -import { Context } from '../context'; -import { Operation } from './operations'; -import { - FeeConsumingOperation, - ForgedBytes, - GasConsumingOperation, - RPCTxRollupBatchOperation, - StorageConsumingOperation, -} from './types'; - -/** - * @description TxRollupBatchOperation provides utility functions to fetch a newly issued operation of kind tx_rollup_submit_batch - */ -export class TxRollupBatchOperation - extends Operation - implements GasConsumingOperation, StorageConsumingOperation, FeeConsumingOperation -{ - constructor( - hash: string, - private readonly params: RPCTxRollupBatchOperation, - public readonly source: string, - raw: ForgedBytes, - results: OperationContentsAndResult[], - context: Context - ) { - super(hash, raw, results, context); - } - - get operationResults() { - const txrollupBatchOp = - Array.isArray(this.results) && - (this.results.find( - (op) => op.kind === 'tx_rollup_submit_batch' - ) as OperationContentsAndResultTxRollupSubmitBatch); - const result = - txrollupBatchOp && txrollupBatchOp.metadata && txrollupBatchOp.metadata.operation_result; - return result ? result : undefined; - } - - get status() { - return this.operationResults?.status ?? 'unknown'; - } - - get content() { - return this.params.content; - } - - get fee() { - return this.params.fee; - } - - get gasLimit() { - return this.params.gas_limit; - } - - get storageLimit() { - return this.params.storage_limit; - } - - get errors() { - return this.operationResults?.errors; - } - - get consumedGas() { - BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: BigNumber.ROUND_UP }); - return this.consumedMilliGas - ? new BigNumber(this.consumedMilliGas).dividedBy(1000).toString() - : undefined; - } - - get consumedMilliGas() { - return this.operationResults?.consumed_milligas; - } -} diff --git a/packages/taquito/src/operations/tx-rollup-origination-operation.ts b/packages/taquito/src/operations/tx-rollup-origination-operation.ts deleted file mode 100644 index 1e246374bb..0000000000 --- a/packages/taquito/src/operations/tx-rollup-origination-operation.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { - OperationContentsAndResult, - OperationContentsAndResultTxRollupOrigination, -} from '@taquito/rpc'; -import { BigNumber } from 'bignumber.js'; -import { Context } from '../context'; -import { Operation } from './operations'; -import { - FeeConsumingOperation, - ForgedBytes, - GasConsumingOperation, - RPCTxRollupOriginationOperation, - StorageConsumingOperation, -} from './types'; - -/** - * @description TxRollupOriginationOperation provides utility functions to fetch a newly issued operation of kind tx_rollup_origination - */ -export class TxRollupOriginationOperation - extends Operation - implements GasConsumingOperation, StorageConsumingOperation, FeeConsumingOperation -{ - /** - * @description Address the newly originate rollup - */ - public readonly originatedRollup?: string; - constructor( - hash: string, - private readonly params: RPCTxRollupOriginationOperation, - public readonly source: string, - raw: ForgedBytes, - results: OperationContentsAndResult[], - context: Context - ) { - super(hash, raw, results, context); - - this.originatedRollup = this.operationResults && this.operationResults.originated_rollup; - } - - get operationResults() { - const rollupOriginationOp = - Array.isArray(this.results) && - (this.results.find( - (op) => op.kind === 'tx_rollup_origination' - ) as OperationContentsAndResultTxRollupOrigination); - const result = - rollupOriginationOp && - rollupOriginationOp.metadata && - rollupOriginationOp.metadata.operation_result; - return result ? result : undefined; - } - - get status() { - return this.operationResults?.status ?? 'unknown'; - } - - get fee() { - return this.params.fee; - } - - get gasLimit() { - return this.params.gas_limit; - } - - get storageLimit() { - return this.params.storage_limit; - } - - get errors() { - return this.operationResults?.errors; - } - - get consumedGas() { - BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: BigNumber.ROUND_UP }); - return this.consumedMilliGas - ? new BigNumber(this.consumedMilliGas).dividedBy(1000).toString() - : undefined; - } - - get consumedMilliGas() { - return this.operationResults?.consumed_milligas; - } -} diff --git a/packages/taquito/src/operations/types.ts b/packages/taquito/src/operations/types.ts index 619bdb9bed..f6b78fd038 100644 --- a/packages/taquito/src/operations/types.ts +++ b/packages/taquito/src/operations/types.ts @@ -20,13 +20,11 @@ export type ParamsWithKind = | withKind | withKind | withKind - | withKind - | withKind | withKind | withKind | withKind | withKind - | withKind; + | withKind; export type ParamsWithKindExtended = ParamsWithKind | withKind; @@ -61,8 +59,6 @@ export type RPCOpWithFee = | RPCRevealOperation | RPCRegisterGlobalConstantOperation | RPCIncreasePaidStorageOperation - | RPCTxRollupOriginationOperation - | RPCTxRollupBatchOperation | RPCTransferTicketOperation | RPCUpdateConsensusKeyOperation | RPCSmartRollupAddMessagesOperation @@ -75,8 +71,6 @@ export type RPCOpWithSource = | RPCRevealOperation | RPCRegisterGlobalConstantOperation | RPCIncreasePaidStorageOperation - | RPCTxRollupOriginationOperation - | RPCTxRollupBatchOperation | RPCTransferTicketOperation | RPCUpdateConsensusKeyOperation | RPCSmartRollupAddMessagesOperation @@ -93,8 +87,6 @@ export const isOpWithFee = ( 'reveal', 'register_global_constant', 'increase_paid_storage', - 'tx_rollup_origination', - 'tx_rollup_submit_batch', 'transfer_ticket', 'update_consensus_key', 'smart_rollup_add_messages', @@ -113,8 +105,6 @@ export const isOpRequireReveal = ( 'origination', 'register_global_constant', 'increase_paid_storage', - 'tx_rollup_origination', - 'tx_rollup_submit_batch', 'transfer_ticket', 'update_consensus_key', 'smart_rollup_add_messages', @@ -340,53 +330,6 @@ export interface RPCActivateOperation { secret: string; } -/** - * @description RPC tx rollup origination operation - */ -export interface RPCTxRollupOriginationOperation { - kind: OpKind.TX_ROLLUP_ORIGINATION; - fee: number; - gas_limit: number; - storage_limit: number; - source: string; - tx_rollup_origination: object; -} - -/** - * @description Parameters for the `txRollupOriginate` method - */ -export interface TxRollupOriginateParams { - source?: string; - fee?: number; - gasLimit?: number; - storageLimit?: number; -} - -/** - * @description Parameters for the `txRollupSubmitBatch` method - */ -export interface TxRollupBatchParams { - source?: string; - fee?: number; - gasLimit?: number; - storageLimit?: number; - rollup: string; - content: string; -} - -/** - * @description RPC tx rollup batch operation - */ -export interface RPCTxRollupBatchOperation { - kind: OpKind.TX_ROLLUP_SUBMIT_BATCH; - fee: number; - gas_limit: number; - storage_limit: number; - source: string; - rollup: string; - content: string; -} - /** * @description Parameters for the transferTicket contract provider */ @@ -536,10 +479,6 @@ export interface SmartRollupOriginateParams { parametersType: MichelsonV1Expression; } -export interface SmartRollupOriginateParamsWithProof extends SmartRollupOriginateParams { - originationProof: string; -} - export interface RPCSmartRollupOriginateOperation { kind: OpKind.SMART_ROLLUP_ORIGINATE; source: string; @@ -548,7 +487,6 @@ export interface RPCSmartRollupOriginateOperation { storage_limit: number; pvm_kind: PvmKind; kernel: string; - origination_proof: string; parameters_ty: MichelsonV1Expression; } diff --git a/packages/taquito/src/prepare/prepare-provider.ts b/packages/taquito/src/prepare/prepare-provider.ts index b32bc70037..5686f1f8f6 100644 --- a/packages/taquito/src/prepare/prepare-provider.ts +++ b/packages/taquito/src/prepare/prepare-provider.ts @@ -905,18 +905,12 @@ export class PrepareProvider extends Provider implements PreparationProvider { }: SmartRollupOriginateParams): Promise { const { pkh } = await this.getKeys(); - const originationProof = await this.rpc.getOriginationProof({ - kind: rest.pvmKind, - kernel: rest.kernel, - }); - const protocolConstants = await this.context.readProvider.getProtocolConstants('head'); const DEFAULT_PARAMS = await this.getAccountLimits(pkh, protocolConstants); const op = await createSmartRollupOriginateOperation({ ...mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS), ...rest, - originationProof, }); const operation = await this.addRevealOperationIfNeeded(op, pkh); diff --git a/packages/taquito/src/read-provider/interface.ts b/packages/taquito/src/read-provider/interface.ts index 4ae39d026e..6a7ba42df8 100644 --- a/packages/taquito/src/read-provider/interface.ts +++ b/packages/taquito/src/read-provider/interface.ts @@ -53,7 +53,6 @@ export interface TzReadProvider { hard_gas_limit_per_block: BigNumber; hard_storage_limit_per_operation: BigNumber; cost_per_byte: BigNumber; - tx_rollup_origination_size?: number; smart_rollup_origination_size: number; }>; diff --git a/packages/taquito/src/read-provider/rpc-read-adapter.ts b/packages/taquito/src/read-provider/rpc-read-adapter.ts index 16710c98ae..83e3c492e0 100644 --- a/packages/taquito/src/read-provider/rpc-read-adapter.ts +++ b/packages/taquito/src/read-provider/rpc-read-adapter.ts @@ -55,7 +55,6 @@ export class RpcReadAdapter implements TzReadProvider { hard_gas_limit_per_block: BigNumber; hard_storage_limit_per_operation: BigNumber; cost_per_byte: BigNumber; - tx_rollup_origination_size?: number; smart_rollup_origination_size: number; }> { const { @@ -65,7 +64,6 @@ export class RpcReadAdapter implements TzReadProvider { hard_gas_limit_per_block, hard_storage_limit_per_operation, cost_per_byte, - tx_rollup_origination_size, smart_rollup_origination_size, } = await this.rpc.getConstants({ block: String(block) }); return { @@ -75,7 +73,6 @@ export class RpcReadAdapter implements TzReadProvider { hard_gas_limit_per_block, hard_storage_limit_per_operation, cost_per_byte, - tx_rollup_origination_size, smart_rollup_origination_size, }; } diff --git a/packages/taquito/src/signer/interface.ts b/packages/taquito/src/signer/interface.ts index 980de2eddd..c722d9fc11 100644 --- a/packages/taquito/src/signer/interface.ts +++ b/packages/taquito/src/signer/interface.ts @@ -5,7 +5,7 @@ export interface Signer { /** * * @param op Operation to sign - * @param magicByte Magic bytes 11 for block, 12 for preendorsement, 13 for endorsements, 3 for generic, 5 for the PACK format of michelson + * @param magicByte Magic bytes 11 for block, 12 for preendorsement/preattestation, 13 for endorsements/attestation, 3 for generic, 5 for the PACK format of michelson */ sign( op: string, diff --git a/packages/taquito/src/subscribe/filters.ts b/packages/taquito/src/subscribe/filters.ts index eafc9db514..b2c95baa60 100644 --- a/packages/taquito/src/subscribe/filters.ts +++ b/packages/taquito/src/subscribe/filters.ts @@ -17,6 +17,8 @@ const opHashFilter = (op: OperationContent, filter: OpHashFilter) => op.hash === const sourceFilter = (x: OperationContent, filter: SourceFilter) => { switch (x.kind) { + case 'attestation': + return 'metadata' in x && x.metadata.delegate === filter.source; case 'endorsement': return 'metadata' in x && x.metadata.delegate === filter.source; case 'activate_account': diff --git a/packages/taquito/src/version.ts b/packages/taquito/src/version.ts index 9bb6dfceb8..d3bed952a2 100644 --- a/packages/taquito/src/version.ts +++ b/packages/taquito/src/version.ts @@ -1,6 +1,6 @@ // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! export const VERSION = { - "commitHash": "9e27326dabf764c55402c50be4d78681f2c78cca", - "version": "17.3.1" + "commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", + "version": "18.0.0-RC.0" }; diff --git a/packages/taquito/test/batch/rpc-batch-provider.spec.ts b/packages/taquito/test/batch/rpc-batch-provider.spec.ts index 7a2646231b..fb2ad3c2f7 100644 --- a/packages/taquito/test/batch/rpc-batch-provider.spec.ts +++ b/packages/taquito/test/batch/rpc-batch-provider.spec.ts @@ -663,7 +663,6 @@ describe('OperationBatch test', () => { kind: OpKind.SMART_ROLLUP_ORIGINATE, pvmKind: PvmKind.WASM2, kernel: '1234567890', - originationProof: '0987654321', parametersType: { prim: 'bytes' }, }, ]; @@ -681,7 +680,6 @@ describe('OperationBatch test', () => { gas_limit: '1330', storage_limit: '93', kernel: '1234567890', - origination_proof: '0987654321', parameters_ty: { prim: 'bytes' }, pvm_kind: 'wasm_2_0_0', counter: '1', @@ -704,7 +702,6 @@ describe('OperationBatch test', () => { kind: OpKind.SMART_ROLLUP_ORIGINATE, pvmKind: PvmKind.WASM2, kernel: '1234567890', - originationProof: '0987654321', parametersType: { prim: 'bytes' }, gasLimit: 1100, fee: 399, @@ -725,7 +722,6 @@ describe('OperationBatch test', () => { gas_limit: '1100', storage_limit: '95', kernel: '1234567890', - origination_proof: '0987654321', parameters_ty: { prim: 'bytes' }, pvm_kind: 'wasm_2_0_0', counter: '1', @@ -749,7 +745,6 @@ describe('OperationBatch test', () => { kind: OpKind.SMART_ROLLUP_ORIGINATE, pvmKind: PvmKind.WASM2, kernel: '1234567890', - originationProof: '0987654321', parametersType: { prim: 'bytes' }, }, ]; @@ -776,7 +771,6 @@ describe('OperationBatch test', () => { gas_limit: '1330', storage_limit: '93', kernel: '1234567890', - origination_proof: '0987654321', parameters_ty: { prim: 'bytes' }, pvm_kind: 'wasm_2_0_0', counter: '2', diff --git a/packages/taquito/test/contract/helper.ts b/packages/taquito/test/contract/helper.ts index bf3a22a062..20740674da 100644 --- a/packages/taquito/test/contract/helper.ts +++ b/packages/taquito/test/contract/helper.ts @@ -1280,244 +1280,6 @@ export const registerGlobalConstantWithError = { 'edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg', }; -export const txRollupOriginateNoReveal = { - contents: [ - { - kind: 'tx_rollup_origination', - source: 'tz2Np59GwL7s4NapRiPmU48Nhz65q1kxVmks', - fee: '417', - counter: '236200', - gas_limit: '1521', - storage_limit: '4000', - tx_rollup_origination: {}, - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz2Np59GwL7s4NapRiPmU48Nhz65q1kxVmks', - change: '-417', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '417', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [ - { - kind: 'contract', - contract: 'tz2Np59GwL7s4NapRiPmU48Nhz65q1kxVmks', - change: '-1000000', - origin: 'block', - }, - { - kind: 'burned', - category: 'storage fees', - change: '1000000', - origin: 'block', - }, - ], - consumed_milligas: '1420108', - originated_rollup: 'txr1WAEQXaXsM1n4R77G5BDfr8pwiFS5SEbBE', - }, - }, - }, - ], - signature: - 'sigSX6zMYe1S9SjbJmRvqtvsETEYa9pSH9Y1ShpcUr1PwKr1hBxw2pKFUFZ1yuDDcTMB6GkuxuoPvp4pHrMYuC14Q8xyt4Tz', -}; - -export const txRollupOriginateWithReveal = { - contents: [ - { - kind: 'reveal', - source: 'tz2SKhBYT6nADXviDrU2HK3nw2jDMfhRNv7P', - fee: '374', - counter: '236199', - gas_limit: '1100', - storage_limit: '0', - public_key: 'sppk7cjFJ3JSeJEjimFTdDQq4HgJBjr5PCPj4U94CDGVfQeh3gEY19b', - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz2SKhBYT6nADXviDrU2HK3nw2jDMfhRNv7P', - change: '-374', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '374', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - consumed_milligas: '1000000', - }, - }, - }, - { - kind: 'tx_rollup_origination', - source: 'tz2SKhBYT6nADXviDrU2HK3nw2jDMfhRNv7P', - fee: '481', - counter: '236200', - gas_limit: '1521', - storage_limit: '4000', - tx_rollup_origination: {}, - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz2SKhBYT6nADXviDrU2HK3nw2jDMfhRNv7P', - change: '-481', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '481', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [ - { - kind: 'contract', - contract: 'tz2SKhBYT6nADXviDrU2HK3nw2jDMfhRNv7P', - change: '-1000000', - origin: 'block', - }, - { - kind: 'burned', - category: 'storage fees', - change: '1000000', - origin: 'block', - }, - ], - consumed_milligas: '1420108', - originated_rollup: 'txr1gJDqppanLyZJ5Yw9VCNqnHswtv9fQ9brL', - }, - }, - }, - ], - signature: - 'sigSqrxEBiHXwuXgXUB8S67dtSycbFvduxpi2Fn7LeVdefgr7FicV5KajbW1z44hykdZA6Mznef3fpPXAcbfaYBUYdWPPbXG', -}; - -export const txRollupSubmitBatchNoReveal = { - contents: [ - { - kind: 'tx_rollup_submit_batch', - source: 'tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ', - fee: '580', - counter: '249650', - gas_limit: '2869', - storage_limit: '0', - rollup: 'txr1YTdi9BktRmybwhgkhRK7WPrutEWVGJT7w', - content: '626c6f62', - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz2MRqRjuMz7i7GjFcwTGE3HF3cbh9sQavXX', - change: '-580', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '580', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [], - consumed_milligas: '2768514', - paid_storage_size_diff: '0', - }, - }, - }, - ], - signature: - 'sigey8PfR2sGSVFM7Z6GUyaoNYsehzQDsM9dZysyQ9MMCeB885dXHKuJ7dNUp2pMysq3jwyUqwoDnNRLe5ge2w8ARDVRN5Eb', -}; - -export const txRollupSubmitBatchWithReveal = { - contents: [ - { - kind: 'reveal', - source: 'tz2SKhBYT6nADXviDrU2HK3nw2jDMfhRNv7P', - fee: '374', - counter: '236199', - gas_limit: '1100', - storage_limit: '0', - public_key: 'sppk7cjFJ3JSeJEjimFTdDQq4HgJBjr5PCPj4U94CDGVfQeh3gEY19b', - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz2SKhBYT6nADXviDrU2HK3nw2jDMfhRNv7P', - change: '-374', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '374', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - consumed_milligas: '1000000', - }, - }, - }, - { - kind: 'tx_rollup_submit_batch', - source: 'tz1QWLc8oL7Bo7BMa6CKfFioeJ4XdmCFf2xZ', - fee: '580', - counter: '249650', - gas_limit: '2869', - storage_limit: '0', - rollup: 'txr1YTdi9BktRmybwhgkhRK7WPrutEWVGJT7w', - content: '626c6f62', - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz2MRqRjuMz7i7GjFcwTGE3HF3cbh9sQavXX', - change: '-580', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '580', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [], - consumed_milligas: '2768514', - paid_storage_size_diff: '0', - }, - }, - }, - ], - signature: - 'sigSqrxEBiHXwuXgXUB8S67dtSycbFvduxpi2Fn7LeVdefgr7FicV5KajbW1z44hykdZA6Mznef3fpPXAcbfaYBUYdWPPbXG', -}; - export const TransferTicketNoReveal = { contents: [ { @@ -1758,8 +1520,6 @@ export const smartRollupOriginateWithReveal = { pvm_kind: 'wasm_2_0_0', kernel: '0061736d0100000001280760037f7f7f017f60027f7f017f60057f7f7f7f7f017f60017f0060017f017f60027f7f0060000002610311736d6172745f726f6c6c75705f636f72650a726561645f696e707574000011736d6172745f726f6c6c75705f636f72650c77726974655f6f7574707574000111736d6172745f726f6c6c75705f636f72650b73746f72655f77726974650002030504030405060503010001071402036d656d02000a6b65726e656c5f72756e00060aa401042a01027f41fa002f0100210120002f010021022001200247044041e4004112410041e400410010021a0b0b0800200041c4006b0b5001057f41fe002d0000210341fc002f0100210220002d0000210420002f0100210520011004210620042003460440200041016a200141016b10011a0520052002460440200041076a200610011a0b0b0b1d01017f41dc0141840241901c100021004184022000100541840210030b0b38050041e4000b122f6b65726e656c2f656e762f7265626f6f740041f8000b0200010041fa000b0200020041fc000b0200000041fe000b0101', - origination_proof: - '0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea180467070f4682a44b982768d522ec6380982f446488c0176ed7c13aa1d6c12a03a810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9', parameters_ty: { prim: 'bytes', }, diff --git a/packages/taquito/test/contract/rpc-contract-provider.spec.ts b/packages/taquito/test/contract/rpc-contract-provider.spec.ts index 8433d0d2eb..a80d95fdc8 100644 --- a/packages/taquito/test/contract/rpc-contract-provider.spec.ts +++ b/packages/taquito/test/contract/rpc-contract-provider.spec.ts @@ -49,7 +49,6 @@ describe('RpcContractProvider test', () => { getSaplingDiffById: jest.Mock; getProtocols: jest.Mock; getCurrentPeriod: jest.Mock; - getOriginationProof: jest.Mock; getConstants: jest.Mock; }; @@ -81,8 +80,6 @@ describe('RpcContractProvider test', () => { batch: jest.Mock; reveal: jest.Mock; registerGlobalConstant: jest.Mock; - txRollupOriginate: jest.Mock; - txRollupSubmitBatch: jest.Mock; transferTicket: jest.Mock; increasePaidStorage: jest.Mock; updateConsensusKey: jest.Mock; @@ -110,7 +107,6 @@ describe('RpcContractProvider test', () => { getSaplingDiffById: jest.fn(), getProtocols: jest.fn(), getCurrentPeriod: jest.fn(), - getOriginationProof: jest.fn(), getConstants: jest.fn(), }; @@ -142,8 +138,6 @@ describe('RpcContractProvider test', () => { batch: jest.fn(), reveal: jest.fn(), registerGlobalConstant: jest.fn(), - txRollupOriginate: jest.fn(), - txRollupSubmitBatch: jest.fn(), transferTicket: jest.fn(), increasePaidStorage: jest.fn(), updateConsensusKey: jest.fn(), @@ -1498,9 +1492,7 @@ describe('RpcContractProvider test', () => { it('Should have correct returned values with origination being estimated', async (done) => { const estimate = new Estimate(1230000, 10000, 100, 100); mockEstimate.smartRollupOriginate.mockResolvedValue(estimate); - mockRpcClient.getOriginationProof.mockResolvedValue( - '0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea180467070f4682a44b982768d522ec6380982f446488c0176ed7c13aa1d6c12a03a810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9' - ); + const smartRollupOriginate = await rpcContractProvider.smartRollupOriginate({ pvmKind: PvmKind.WASM2, kernel: @@ -1523,8 +1515,6 @@ describe('RpcContractProvider test', () => { parameters_ty: { prim: 'bytes', }, - origination_proof: - '0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea180467070f4682a44b982768d522ec6380982f446488c0176ed7c13aa1d6c12a03a810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9', counter: '2', fee: '433', gas_limit: '1330', @@ -1545,9 +1535,7 @@ describe('RpcContractProvider test', () => { it('Should have correct returned values with origination with reveal with specified values for estimate', async (done) => { const estimate = new Estimate(1230000, 10000, 100, 100); mockEstimate.smartRollupOriginate.mockResolvedValue(estimate); - mockRpcClient.getOriginationProof.mockResolvedValue( - '0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea180467070f4682a44b982768d522ec6380982f446488c0176ed7c13aa1d6c12a03a810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9' - ); + const smartRollupOriginate = await rpcContractProvider.smartRollupOriginate({ pvmKind: PvmKind.WASM2, kernel: @@ -1573,8 +1561,6 @@ describe('RpcContractProvider test', () => { parameters_ty: { prim: 'bytes', }, - origination_proof: - '0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea180467070f4682a44b982768d522ec6380982f446488c0176ed7c13aa1d6c12a03a810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9', counter: '2', fee: '9999', gas_limit: '12345', @@ -1599,9 +1585,6 @@ describe('RpcContractProvider test', () => { mockEstimate.smartRollupOriginate.mockResolvedValue(estimate); mockReadProvider.isAccountRevealed.mockResolvedValue(true); - mockRpcClient.getOriginationProof.mockResolvedValue( - '0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea180467070f4682a44b982768d522ec6380982f446488c0176ed7c13aa1d6c12a03a810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9' - ); const smartRollupOriginate = await rpcContractProvider.smartRollupOriginate({ pvmKind: PvmKind.WASM2, kernel: @@ -1623,8 +1606,6 @@ describe('RpcContractProvider test', () => { parameters_ty: { prim: 'bytes', }, - origination_proof: - '0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea180467070f4682a44b982768d522ec6380982f446488c0176ed7c13aa1d6c12a03a810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9', counter: '1', fee: '433', gas_limit: '1330', diff --git a/packages/taquito/test/estimate/rpc-estimate-provider.spec.ts b/packages/taquito/test/estimate/rpc-estimate-provider.spec.ts index 7f794e784d..3d6e008b4c 100644 --- a/packages/taquito/test/estimate/rpc-estimate-provider.spec.ts +++ b/packages/taquito/test/estimate/rpc-estimate-provider.spec.ts @@ -16,8 +16,6 @@ import { registerGlobalConstantNoReveal, registerGlobalConstantWithReveal, registerGlobalConstantWithError, - txRollupOriginateNoReveal, - txRollupSubmitBatchNoReveal, TransferTicketNoReveal, TransferTicketWithReveal, updateConsensusKeyNoReveal, @@ -1167,7 +1165,6 @@ describe('RPCEstimateProvider test wallet', () => { getChainId: jest.Mock; getConstants: jest.Mock; getProtocols: jest.Mock; - getOriginationProof: jest.Mock; }; let mockForger: { @@ -1195,7 +1192,6 @@ describe('RPCEstimateProvider test wallet', () => { getChainId: jest.fn(), getConstants: jest.fn(), getProtocols: jest.fn(), - getOriginationProof: jest.fn(), }; mockForger = { @@ -1422,8 +1418,6 @@ describe('RPCEstimateProvider test wallet', () => { }, }, registerGlobalConstantNoReveal.contents[0], - txRollupOriginateNoReveal.contents[0], - txRollupSubmitBatchNoReveal.contents[0], ], }); const estimate = await estimateProvider.batch([ @@ -1437,7 +1431,7 @@ describe('RPCEstimateProvider test wallet', () => { }, }, ]); - expect(estimate.length).toEqual(5); + expect(estimate.length).toEqual(3); expect(estimate[0].gasLimit).toEqual(1100); expect(estimate[1].gasLimit).toEqual(1100); expect(estimate[2].gasLimit).toEqual(1330); @@ -1568,7 +1562,6 @@ describe('RPCEstimateProvider test wallet', () => { smart_rollup_origination_size: new BigNumber(6314), }); mockRpcClient.simulateOperation.mockResolvedValue(smartRollupOriginateWithReveal); - mockRpcClient.getOriginationProof.mockResolvedValue('987654321'); const estimate = await estimateProvider.smartRollupOriginate({ pvmKind: PvmKind.WASM2, diff --git a/packages/taquito/test/helpers.ts b/packages/taquito/test/helpers.ts index 020ebcca85..90b8e9c214 100644 --- a/packages/taquito/test/helpers.ts +++ b/packages/taquito/test/helpers.ts @@ -6,8 +6,6 @@ import { OperationContentsAndResultOrigination, OperationContentsAndResultDelegation, OperationContentsAndResultRegisterGlobalConstant, - OperationContentsAndResultTxRollupOrigination, - OperationContentsAndResultTxRollupSubmitBatch, OperationContentsAndResultTransferTicket, OperationContentsAndResultIncreasePaidStorage, OperationContentsAndResultUpdateConsensusKey, @@ -69,27 +67,6 @@ const defaultRegisterGlobalConstantData = { value: { int: '0' }, }; -const defaultTxRollupOriginateData = { - kind: OpKind.TX_ROLLUP_ORIGINATION as OpKind.TX_ROLLUP_ORIGINATION, - source: 'tz1bwsEWCwSEXdRvnJxvegQZKeX5dj6oKEys', - fee: '2991', - counter: '121619', - gas_limit: '26260', - storage_limit: '257', - tx_rollup_origination: {}, -}; - -const defaultTxSubmitBatchData = { - kind: OpKind.TX_ROLLUP_SUBMIT_BATCH as OpKind.TX_ROLLUP_SUBMIT_BATCH, - source: 'tz1bwsEWCwSEXdRvnJxvegQZKeX5dj6oKEys', - fee: '2991', - counter: '121619', - gas_limit: '26260', - storage_limit: '257', - rollup: 'txr1YTdi9BktRmybwhgkhRK7WPrutEWVGJT7w', - content: '626c6f62', -}; - const defaultTransferTicketData = { kind: OpKind.TRANSFER_TICKET as OpKind.TRANSFER_TICKET, source: 'tz1iedjFYksExq8snZK9MNo4AvXHBdXfTsGX', @@ -333,64 +310,6 @@ export class UpdateConsensusKeyOperationBuilder { } } -export class TxRollupOriginationOperationBuilder { - private result: OperationContentsAndResultTxRollupOrigination['metadata']['operation_result'] = - defaultResult; - private data: Omit; - - constructor( - private _data: Partial> = {} - ) { - this.data = { ...defaultTxRollupOriginateData, ...this._data }; - } - - withResult( - result: Partial - ) { - this.result = { ...defaultResult, ...result }; - return this; - } - - build(): OperationContentsAndResultTxRollupOrigination { - return { - ...this.data, - metadata: { - balance_updates: [], - operation_result: this.result, - }, - }; - } -} - -export class TxRollupSubmitBatchOperationBuilder { - private result: OperationContentsAndResultTxRollupSubmitBatch['metadata']['operation_result'] = - defaultResult; - private data: Omit; - - constructor( - private _data: Partial> = {} - ) { - this.data = { ...defaultTxSubmitBatchData, ...this._data }; - } - - withResult( - result: Partial - ) { - this.result = { ...defaultResult, ...result }; - return this; - } - - build(): OperationContentsAndResultTxRollupSubmitBatch { - return { - ...this.data, - metadata: { - balance_updates: [], - operation_result: this.result, - }, - }; - } -} - export class TransferTicketOperationBuilder { private result: OperationContentsAndResultTransferTicket['metadata']['operation_result'] = defaultResult; diff --git a/packages/taquito/test/operations/tx-rollup-origination-operation.spec.ts b/packages/taquito/test/operations/tx-rollup-origination-operation.spec.ts deleted file mode 100644 index 1d8edfe3b1..0000000000 --- a/packages/taquito/test/operations/tx-rollup-origination-operation.spec.ts +++ /dev/null @@ -1,254 +0,0 @@ -import { ForgedBytes } from '../../src/operations/types'; -import { OperationContentsAndResult } from '@taquito/rpc'; -import { defaultConfigConfirmation } from '../../src/context'; -import { RevealOperationBuilder, TxRollupOriginationOperationBuilder } from '../helpers'; -import { TxRollupOriginationOperation } from '../../src/operations/tx-rollup-origination-operation'; - -describe('TxRollupOriginationOperation', () => { - let fakeContext: any; - const fakeForgedBytes = {} as ForgedBytes; - - const successfulResult = [ - { - kind: 'tx_rollup_origination', - source: 'tz2Np59GwL7s4NapRiPmU48Nhz65q1kxVmks', - fee: '417', - counter: '236200', - gas_limit: '1521', - storage_limit: '4000', - tx_rollup_origination: {}, - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz2Np59GwL7s4NapRiPmU48Nhz65q1kxVmks', - change: '-417', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '417', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [ - { - kind: 'contract', - contract: 'tz2Np59GwL7s4NapRiPmU48Nhz65q1kxVmks', - change: '-1000000', - origin: 'block', - }, - { - kind: 'burned', - category: 'storage fees', - change: '1000000', - origin: 'block', - }, - ], - consumed_milligas: '1420108', - originated_rollup: 'txr1WAEQXaXsM1n4R77G5BDfr8pwiFS5SEbBE', - }, - }, - }, - ] as OperationContentsAndResult[]; - - beforeEach(() => { - fakeContext = { - rpc: { - getBlock: jest.fn(), - }, - config: { ...defaultConfigConfirmation }, - }; - - fakeContext.rpc.getBlock.mockResolvedValue({ - operations: [[{ hash: 'oo51jb7sEvPkf7BaTSUW49QztcxgxufLVEj2PUfQ2uw6m61CKLc' }], [], [], []], - header: { - level: 185827, - }, - }); - }); - it('should contains the address of the newly created rollup given a successful result', () => { - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.originatedRollup).toEqual('txr1WAEQXaXsM1n4R77G5BDfr8pwiFS5SEbBE'); - }); - - it('originatedRollup is undefined given an wrong result', () => { - const wrongResults: any[] = [ - {}, - [{ kind: 'tx_rollup_origination' }], - [{ kind: 'tx_rollup_origination', metadata: {} }], - ]; - - wrongResults.forEach((result) => { - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - result, - fakeContext - ); - expect(op.originatedRollup).toBeUndefined(); - }); - }); - - it('should return the fee', () => { - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - { fee: 450 } as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.fee).toEqual(450); - }); - - it('should return the gasLimit', () => { - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - { gas_limit: 450 } as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.gasLimit).toEqual(450); - }); - - it('should return the consumed gas', () => { - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.consumedGas).toEqual('1421'); - }); - - it('should return the consumed milligas', () => { - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.consumedMilliGas).toEqual('1420108'); - }); - - it('should return the storageLimit', () => { - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - { storage_limit: 450 } as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.storageLimit).toEqual(450); - }); - - it('should return the error if there is one', () => { - const txBuilder = new TxRollupOriginationOperationBuilder(); - - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - [ - txBuilder - .withResult({ - status: 'backtracked', - errors: [{ kind: 'temporary', id: 'proto.011-PtHangzH.storage_exhausted.operation' }], - }) - .build(), - ], - fakeContext - ); - expect(op.errors).toBeDefined(); - expect(op.errors?.[0]).toEqual({ - kind: 'temporary', - id: 'proto.011-PtHangzH.storage_exhausted.operation', - }); - }); - - it('error should be undefined when no error', () => { - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.errors).toBeUndefined(); - }); - - it('status should contains status for RegisterGlobalConstant operation only', () => { - const txBuilder = new TxRollupOriginationOperationBuilder(); - const revealBuilder = new RevealOperationBuilder(); - - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - [ - revealBuilder.withResult({ status: 'applied' }).build(), - txBuilder.withResult({ status: 'backtracked' }).build(), - ], - fakeContext - ); - expect(op.revealStatus).toEqual('applied'); - expect(op.status).toEqual('backtracked'); - }); - - it('status should contains status for RegisterGlobalConstant operation only', () => { - const txBuilder = new TxRollupOriginationOperationBuilder(); - const revealBuilder = new RevealOperationBuilder(); - - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - [ - txBuilder.withResult({ status: 'backtracked' }).build(), - revealBuilder.withResult({ status: 'applied' }).build(), - ], - fakeContext - ); - expect(op.revealStatus).toEqual('applied'); - expect(op.status).toEqual('backtracked'); - }); - - it('revealStatus should be unknown when there is no reveal operation', () => { - const txBuilder = new TxRollupOriginationOperationBuilder(); - - const op = new TxRollupOriginationOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - [txBuilder.withResult({ status: 'backtracked' }).build()], - fakeContext - ); - expect(op.revealStatus).toEqual('unknown'); - expect(op.status).toEqual('backtracked'); - }); -}); diff --git a/packages/taquito/test/operations/tx-rollup-submit-batch.spec.ts b/packages/taquito/test/operations/tx-rollup-submit-batch.spec.ts deleted file mode 100644 index e87e6c6c32..0000000000 --- a/packages/taquito/test/operations/tx-rollup-submit-batch.spec.ts +++ /dev/null @@ -1,222 +0,0 @@ -import { ForgedBytes } from '../../src/operations/types'; -import { OperationContentsAndResult } from '@taquito/rpc'; -import { defaultConfigConfirmation } from '../../src/context'; -import { RevealOperationBuilder, TxRollupSubmitBatchOperationBuilder } from '../helpers'; -import { TxRollupBatchOperation } from '../../src/operations/tx-rollup-batch-operation'; - -describe('TxRollupBatchOperation', () => { - let fakeContext: any; - const fakeForgedBytes = {} as ForgedBytes; - - const successfulResult = [ - { - kind: 'tx_rollup_submit_batch', - source: 'tz2MRqRjuMz7i7GjFcwTGE3HF3cbh9sQavXX', - fee: '580', - counter: '249650', - gas_limit: '2869', - storage_limit: '0', - rollup: 'txr1YTdi9BktRmybwhgkhRK7WPrutEWVGJT7w', - content: '626c6f62', - metadata: { - balance_updates: [ - { - kind: 'contract', - contract: 'tz2MRqRjuMz7i7GjFcwTGE3HF3cbh9sQavXX', - change: '-580', - origin: 'block', - }, - { - kind: 'accumulator', - category: 'block fees', - change: '580', - origin: 'block', - }, - ], - operation_result: { - status: 'applied', - balance_updates: [], - consumed_milligas: '2768514', - paid_storage_size_diff: '0', - }, - }, - }, - ] as OperationContentsAndResult[]; - - beforeEach(() => { - fakeContext = { - rpc: { - getBlock: jest.fn(), - }, - config: { ...defaultConfigConfirmation }, - }; - - fakeContext.rpc.getBlock.mockResolvedValue({ - operations: [[{ hash: 'oo51jb7sEvPkf7BaTSUW49QztcxgxufLVEj2PUfQ2uw6m61CKLc' }], [], [], []], - header: { - level: 185827, - }, - }); - }); - - it('should return the batch content', () => { - const op = new TxRollupBatchOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - { content: '626c6f62' } as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.content).toEqual('626c6f62'); - }); - - it('should return the fee', () => { - const op = new TxRollupBatchOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - { fee: 450 } as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.fee).toEqual(450); - }); - - it('should return the gasLimit', () => { - const op = new TxRollupBatchOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - { gas_limit: 450 } as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.gasLimit).toEqual(450); - }); - - it('should return the consumed gas', () => { - const op = new TxRollupBatchOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.consumedGas).toEqual('2769'); - }); - - it('should return the consumed milligas', () => { - const op = new TxRollupBatchOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.consumedMilliGas).toEqual('2768514'); - }); - it('should return the storageLimit', () => { - const op = new TxRollupBatchOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - { storage_limit: 450 } as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.storageLimit).toEqual(450); - }); - - it('should return the error if there is one', () => { - const txBuilder = new TxRollupSubmitBatchOperationBuilder(); - - const op = new TxRollupBatchOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - [ - txBuilder - .withResult({ - status: 'backtracked', - errors: [{ kind: 'temporary', id: 'proto.011-PtHangzH.storage_exhausted.operation' }], - }) - .build(), - ], - fakeContext - ); - expect(op.errors).toBeDefined(); - expect(op.errors?.[0]).toEqual({ - kind: 'temporary', - id: 'proto.011-PtHangzH.storage_exhausted.operation', - }); - }); - - it('error should be undefined when no error', () => { - const op = new TxRollupBatchOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - successfulResult, - fakeContext - ); - expect(op.errors).toBeUndefined(); - }); - - it('status should contains status for RegisterGlobalConstant operation only', () => { - const txBuilder = new TxRollupSubmitBatchOperationBuilder(); - const revealBuilder = new RevealOperationBuilder(); - - const op = new TxRollupBatchOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - [ - revealBuilder.withResult({ status: 'applied' }).build(), - txBuilder.withResult({ status: 'backtracked' }).build(), - ], - fakeContext - ); - expect(op.revealStatus).toEqual('applied'); - expect(op.status).toEqual('backtracked'); - }); - - it('status should contains status for RegisterGlobalConstant operation only', () => { - const txBuilder = new TxRollupSubmitBatchOperationBuilder(); - const revealBuilder = new RevealOperationBuilder(); - - const op = new TxRollupBatchOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - [ - txBuilder.withResult({ status: 'backtracked' }).build(), - revealBuilder.withResult({ status: 'applied' }).build(), - ], - fakeContext - ); - expect(op.revealStatus).toEqual('applied'); - expect(op.status).toEqual('backtracked'); - }); - - it('revealStatus should be unknown when there is no reveal operation', () => { - const txBuilder = new TxRollupSubmitBatchOperationBuilder(); - - const op = new TxRollupBatchOperation( - 'ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj', - {} as any, - '', - fakeForgedBytes, - [txBuilder.withResult({ status: 'backtracked' }).build()], - fakeContext - ); - expect(op.revealStatus).toEqual('unknown'); - expect(op.status).toEqual('backtracked'); - }); -}); diff --git a/packages/taquito/test/prepare/prepare-provider.spec.ts b/packages/taquito/test/prepare/prepare-provider.spec.ts index 0568530098..ee2a298753 100644 --- a/packages/taquito/test/prepare/prepare-provider.spec.ts +++ b/packages/taquito/test/prepare/prepare-provider.spec.ts @@ -33,7 +33,6 @@ describe('PrepareProvider test', () => { getCurrentPeriod: jest.Mock; getConstants: jest.Mock; getManagerKey: jest.Mock; - getOriginationProof: jest.Mock; forgeOperations: jest.Mock; }; @@ -67,7 +66,6 @@ describe('PrepareProvider test', () => { getCurrentPeriod: jest.fn(), getConstants: jest.fn(), getManagerKey: jest.fn(), - getOriginationProof: jest.fn(), forgeOperations: jest.fn(), }; @@ -1039,7 +1037,6 @@ describe('PrepareProvider test', () => { describe('SmartRollupOriginate', () => { it('Should prepare smartRollupOriginate without reveal', async (done) => { mockReadProvider.isAccountRevealed.mockResolvedValue(true); - mockRpcClient.getOriginationProof.mockResolvedValue('987654321'); const prepared = await prepareProvider.smartRollupOriginate({ pvmKind: PvmKind.WASM2, @@ -1056,7 +1053,6 @@ describe('PrepareProvider test', () => { kind: 'smart_rollup_originate', pvm_kind: 'wasm_2_0_0', kernel: '123456789', - origination_proof: '987654321', parameters_ty: { prim: 'bytes', }, @@ -1076,7 +1072,6 @@ describe('PrepareProvider test', () => { it('Should prepare smartRollupOriginate with reveal', async (done) => { mockReadProvider.isAccountRevealed.mockResolvedValue(false); - mockRpcClient.getOriginationProof.mockResolvedValue('987654321'); const prepared = await prepareProvider.smartRollupOriginate({ pvmKind: PvmKind.WASM2, @@ -1102,7 +1097,6 @@ describe('PrepareProvider test', () => { kind: 'smart_rollup_originate', pvm_kind: 'wasm_2_0_0', kernel: '123456789', - origination_proof: '987654321', parameters_ty: { prim: 'bytes', }, diff --git a/packages/taquito/test/read-provider/data.ts b/packages/taquito/test/read-provider/data.ts index b2b6b4465c..c1704bfe40 100644 --- a/packages/taquito/test/read-provider/data.ts +++ b/packages/taquito/test/read-provider/data.ts @@ -11,36 +11,114 @@ export const constantsRpc = { max_micheline_node_count: 50000, max_micheline_bytes_limit: 50000, max_allowed_global_constants_depth: 10000, - cache_layout: [new BigNumber('100000000')], + cache_layout_size: 3, michelson_maximum_type_size: 2001, - preserved_cycles: 5, + smart_rollup_max_wrapped_proof_binary_size: 30000, + smart_rollup_message_size_limit: 4096, + smart_rollup_max_number_of_messages_per_level: '1000000', + preserved_cycles: 3, blocks_per_cycle: 8192, blocks_per_commitment: 64, - blocks_per_roll_snapshot: 512, - blocks_per_voting_period: 40960, - time_between_blocks: [new BigNumber('60'), new BigNumber('40')], - endorsers_per_block: 256, - hard_gas_limit_per_operation: new BigNumber('1040000'), - hard_gas_limit_per_block: new BigNumber('5200000'), - proof_of_work_threshold: new BigNumber('70368744177663'), - minimal_stake: new BigNumber('8000000000'), - seed_nonce_revelation_tip: new BigNumber('125000'), + nonce_revelation_threshold: 512, + blocks_per_stake_snapshot: 512, + cycles_per_voting_period: 1, + hard_gas_limit_per_operation: new BigNumber(1040000), + hard_gas_limit_per_block: new BigNumber(2600000), + proof_of_work_threshold: new BigNumber(-1), + minimal_stake: new BigNumber(6000000000), + minimal_frozen_stake: '600000000', + vdf_difficulty: new BigNumber(10000000000), origination_size: 257, - block_security_deposit: new BigNumber('640000000'), - endorsement_security_deposit: new BigNumber('2500000'), - baking_reward_per_endorsement: [new BigNumber('78125'), new BigNumber('11719')], - endorsement_reward: [new BigNumber('78125'), new BigNumber('52083')], - cost_per_byte: new BigNumber('250'), - hard_storage_limit_per_operation: new BigNumber('60000'), + issuance_weights: { + base_total_issued_per_minute: '85007812', + baking_reward_fixed_portion_weight: 5120, + baking_reward_bonus_weight: 5120, + attesting_reward_weight: 10240, + liquidity_baking_subsidy_weight: 1280, + seed_nonce_revelation_tip_weight: 1, + vdf_revelation_tip_weight: 1, + }, + cost_per_byte: new BigNumber(250), + hard_storage_limit_per_operation: new BigNumber(60000), quorum_min: 2000, quorum_max: 7000, min_proposal_quorum: 500, - initial_endorsers: 192, - delay_per_missing_endorsement: new BigNumber('4'), - minimal_block_delay: new BigNumber('30'), - liquidity_baking_subsidy: new BigNumber('2500000'), - liquidity_baking_sunset_level: 2244609, - liquidity_baking_escape_ema_threshold: 1000000, + liquidity_baking_toggle_ema_threshold: 1000000000, + max_operations_time_to_live: 240, + minimal_block_delay: new BigNumber(8), + delay_increment_per_round: new BigNumber(3), + consensus_committee_size: 7000, + consensus_threshold: 4667, + minimal_participation_ratio: { + numerator: 2, + denominator: 3, + }, + max_slashing_period: 2, + limit_of_delegation_over_baking: 9, + percentage_of_frozen_deposits_slashed_per_double_baking: 10, + percentage_of_frozen_deposits_slashed_per_double_attestation: 50, + testnet_dictator: 'tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8', + cache_script_size: 100000000, + cache_stake_distribution_cycles: 8, + cache_sampler_state_cycles: 8, + dal_parametric: { + feature_enable: false, + number_of_slots: 256, + attestation_lag: 4, + attestation_threshold: 50, + blocks_per_epoch: 8, + redundancy_factor: 16, + page_size: 4096, + slot_size: 1048576, + number_of_shards: 2048, + }, + smart_rollup_enable: true, + smart_rollup_arith_pvm_enable: false, + smart_rollup_origination_size: 6314, + smart_rollup_challenge_window_in_blocks: 40, + smart_rollup_stake_amount: '10000000000', + smart_rollup_commitment_period_in_blocks: 20, + smart_rollup_max_lookahead_in_blocks: 30000, + smart_rollup_max_active_outbox_levels: 20160, + smart_rollup_max_outbox_messages_per_level: 100, + smart_rollup_number_of_sections_in_dissection: 32, + smart_rollup_timeout_period_in_blocks: 500, + smart_rollup_max_number_of_cemented_commitments: 5, + smart_rollup_max_number_of_parallel_games: 32, + smart_rollup_reveal_activation_level: { + dal_page: 2147483646, + metadata: 0, + raw_data: { + Blake2B: 0, + }, + }, + zk_rollup_enable: false, + zk_rollup_origination_size: 4000, + zk_rollup_min_pending_to_process: 10, + zk_rollup_max_ticket_payload_size: 2048, + global_limit_of_staking_over_baking: 5, + edge_of_staking_over_delegation: 2, + adaptive_issuance_launch_ema_threshold: 100000000, + adaptive_rewards_params: { + issuance_ratio_min: { + numerator: '1', + denominator: '2000', + }, + issuance_ratio_max: { + numerator: '1', + denominator: '20', + }, + max_bonus: '50000000000000', + growth_rate: '115740740', + center_dz: { + numerator: '1', + denominator: '2', + }, + radius_dz: { + numerator: '1', + denominator: '50', + }, + }, }; export const contractCodeSample = [ diff --git a/packages/taquito/test/read-provider/rpc-read-adapter.spec.ts b/packages/taquito/test/read-provider/rpc-read-adapter.spec.ts index d28c5bfceb..2bf2ab1281 100644 --- a/packages/taquito/test/read-provider/rpc-read-adapter.spec.ts +++ b/packages/taquito/test/read-provider/rpc-read-adapter.spec.ts @@ -115,11 +115,11 @@ describe('RpcReadAdapter test', () => { const result = await readProvider.getProtocolConstants(block); expect(result).toEqual({ hard_gas_limit_per_operation: new BigNumber('1040000'), - hard_gas_limit_per_block: new BigNumber('5200000'), + hard_gas_limit_per_block: new BigNumber('2600000'), cost_per_byte: new BigNumber('250'), hard_storage_limit_per_operation: new BigNumber('60000'), - minimal_block_delay: new BigNumber('30'), - time_between_blocks: [new BigNumber('60'), new BigNumber('40')], + minimal_block_delay: new BigNumber('8'), + smart_rollup_origination_size: 6314, }); expect(mockRpcClient.getConstants.mock.calls[0][0]).toEqual({ block: `${block}` }); diff --git a/website/package.json b/website/package.json index 859c84ee48..eb637225ee 100644 --- a/website/package.json +++ b/website/package.json @@ -87,5 +87,5 @@ "last 1 safari version" ] }, - "version": "17.3.1" + "version": "18.0.0-RC.0" } diff --git a/website/sidebars.js b/website/sidebars.js index eea035a7b0..9006037d30 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -96,14 +96,6 @@ const sidebars = { }, ], }, - { - type: 'category', - label: 'Optimistic Rollups', - className: 'sidebarHeader', - collapsed: false, - collapsible: false, - items: ['tx_rollups'], - }, { type: 'category', label: 'Advanced Examples', diff --git a/website/sidebars.json b/website/sidebars.json index 1a595ce043..9f3cf29527 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -76,11 +76,6 @@ "label": "Advanced Examples", "items": ["complex_parameters", "storage_annotations", "drain_account"] }, - { - "type": "category", - "label": "Optimistic Rollups", - "items": ["tx_rollups"] - }, { "type": "category", "label": "Modules customization",