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/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/packages/taquito-local-forging/src/codec.ts b/packages/taquito-local-forging/src/codec.ts index af5b9eb001..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)}`; }; diff --git a/packages/taquito-local-forging/src/constants.ts b/packages/taquito-local-forging/src/constants.ts index d69d75dcc4..9cb5d56ef0 100644 --- a/packages/taquito-local-forging/src/constants.ts +++ b/packages/taquito-local-forging/src/constants.ts @@ -48,12 +48,7 @@ export enum CODEC { 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', @@ -246,8 +241,6 @@ export const kindMapping: { [key: number]: string } = { 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 752b9fa129..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, @@ -48,8 +45,6 @@ import { SeedNonceRevelationSchema, TransactionSchema, TransferTicketSchema, - TxRollupOriginationSchema, - TxRollupSubmitBatchSchema, SetDepositsLimitSchema, SmartRollupOriginateSchema, SmartRollupAddMessagesSchema, @@ -84,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, @@ -119,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 6749c09da6..5441813fb9 100644 --- a/packages/taquito-local-forging/src/encoder.ts +++ b/packages/taquito-local-forging/src/encoder.ts @@ -19,9 +19,6 @@ import { smartContractAddressEncoder, smartRollupAddressEncoder, smartRollupCommitmentHashEncoder, - txRollupBatchContentEncoder, - txRollupIdEncoder, - txRollupOriginationParamEncoder, tz1Encoder, valueParameterEncoder, zarithEncoder, @@ -47,8 +44,6 @@ import { SeedNonceRevelationSchema, TransactionSchema, TransferTicketSchema, - TxRollupOriginationSchema, - TxRollupSubmitBatchSchema, SmartRollupOriginateSchema, SmartRollupExecuteOutboxMessageSchema, SmartRollupAddMessagesSchema, @@ -80,9 +75,6 @@ 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.PVM_KIND]: pvmKindEncoder, [CODEC.PADDED_BYTES]: paddedBytesEncoder, @@ -105,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) => diff --git a/packages/taquito-local-forging/src/schema/operation.ts b/packages/taquito-local-forging/src/schema/operation.ts index 536e5573ea..c4ff221600 100644 --- a/packages/taquito-local-forging/src/schema/operation.ts +++ b/packages/taquito-local-forging/src/schema/operation.ts @@ -113,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, diff --git a/packages/taquito-local-forging/src/taquito-local-forging.ts b/packages/taquito-local-forging/src/taquito-local-forging.ts index f38e222d29..2716fdb9a5 100644 --- a/packages/taquito-local-forging/src/taquito-local-forging.ts +++ b/packages/taquito-local-forging/src/taquito-local-forging.ts @@ -58,11 +58,6 @@ export class LocalForger implements Forger { continue; } else if (content.kind === 'transaction' && diff[0] === 'parameters') { 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 6aafd0ce96..59d277f634 100644 --- a/packages/taquito-local-forging/src/validator.ts +++ b/packages/taquito-local-forging/src/validator.ts @@ -13,8 +13,6 @@ import { AttestationSchema, EndorsementSchema, TransferTicketSchema, - TxRollupOriginationSchema, - TxRollupSubmitBatchSchema, IncreasePaidStorageSchema, UpdateConsensusKeySchema, DrainDelegateSchema, @@ -38,8 +36,6 @@ type OperationKind = | 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 @@ -61,8 +57,6 @@ const OperationKindMapping = { 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-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/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-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/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-rpc/src/opkind.ts b/packages/taquito-rpc/src/opkind.ts index 1b1b66fdef..80b6a47c21 100644 --- a/packages/taquito-rpc/src/opkind.ts +++ b/packages/taquito-rpc/src/opkind.ts @@ -21,14 +21,6 @@ export enum OpKind { 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/types.ts b/packages/taquito-rpc/src/types.ts index ec7fd016b2..7922349de3 100644 --- a/packages/taquito-rpc/src/types.ts +++ b/packages/taquito-rpc/src/types.ts @@ -33,65 +33,11 @@ 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 { full_balance?: BigNumber; current_frozen_deposits?: BigNumber; @@ -384,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; @@ -635,13 +484,6 @@ export type OperationContents = | OperationContentsFailingNoop | OperationContentsRegisterGlobalConstant | OperationContentsSetDepositsLimit - | OperationContentsTxRollupOrigination - | OperationContentsTxRollupSubmitBatch - | OperationContentsTxRollupCommit - | OperationContentsTxRollupReturnBond - | OperationContentsTxRollupFinalizeCommitment - | OperationContentsTxRollupRemoveCommitment - | OperationContentsTxRollupRejection | OperationContentsTransferTicket | OperationContentsUpdateConsensusKey | OperationContentsDrainDelegate @@ -718,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; @@ -1000,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; @@ -1105,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; @@ -1276,14 +965,6 @@ export type OperationContentsAndResult = | OperationContentsAndResultEndorsementWithSlot | OperationContentsAndResultRegisterGlobalConstant | OperationContentsAndResultSetDepositsLimit - | OperationContentsAndResultTxRollupOrigination - | OperationContentsAndResultTxRollupSubmitBatch - | OperationContentsAndResultTxRollupCommit - | OperationContentsAndResultTxRollupDispatchTickets - | OperationContentsAndResultTxRollupReturnBond - | OperationContentsAndResultTxRollupFinalizeCommitment - | OperationContentsAndResultTxRollupRemoveCommitment - | OperationContentsAndResultTxRollupRejection | OperationContentsAndResultTransferTicket | OperationContentsAndResultIncreasePaidStorage | OperationContentsAndResultUpdateConsensusKey @@ -1549,11 +1230,9 @@ export interface ScriptedContracts { export type BondId = | { smart_rollup?: never; - tx_rollup: string; } | { smart_rollup: string; - tx_rollup?: never; }; export interface OperationBalanceUpdatesItem { @@ -1599,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; @@ -1841,15 +1451,7 @@ export type OperationResult = | OperationResultSmartRollupRefute | OperationResultSmartRollupRecoverBond | OperationResultSmartRollupTimeout - | OperationResultSmartRollupExecuteOutboxMessage - | OperationResultTxRollupOrigination - | OperationResultTxRollupSubmitBatch - | OperationResultTxRollupDispatchTickets - | OperationResultTxRollupCommit - | OperationResultTxRollupReturnBond - | OperationResultTxRollupFinalizeCommitment - | OperationResultTxRollupRemoveCommitment - | OperationResultTxRollupRejection; + | OperationResultSmartRollupExecuteOutboxMessage; export interface OperationResultTransaction { status: OperationResultStatusEnum; @@ -1947,8 +1549,6 @@ export enum METADATA_BALANCE_UPDATES_CATEGORY { LEGACY_FEES = 'legacy_fees', LEGACY_DEPOSITS = 'legacy_deposits', DOUBLE_SIGNING_EVIDENCE_REWARDS = 'double signing evidence rewards', - TX_ROLLUP_REJECTION_REWARDS = 'tx_rollup_rejection_rewards', - TX_ROLLUP_REJECTION_PUNISHMENTS = 'tx_rollup_rejection_punishments', } export type MetadataBalanceUpdatesCategoryEnum = METADATA_BALANCE_UPDATES_CATEGORY; @@ -1960,7 +1560,7 @@ export interface OperationMetadataBalanceUpdates { change: string; origin: MetadataBalanceUpdatesOriginEnum; category?: MetadataBalanceUpdatesCategoryEnum; - staker?: { contract?: string, delegate: string }; + staker?: { contract?: string; delegate: string }; delegate?: string; participation?: boolean; revelation?: boolean; diff --git a/packages/taquito-rpc/test/data/rpc-responses.ts b/packages/taquito-rpc/test/data/rpc-responses.ts index d5ce9c91fa..11da795e14 100644 --- a/packages/taquito-rpc/test/data/rpc-responses.ts +++ b/packages/taquito-rpc/test/data/rpc-responses.ts @@ -3533,1076 +3533,6 @@ export const blockIthacanetResponse = { ], }; -export const blockJakartanetResponse = { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'BLivfHQoHCtixrwXCNnsMQj33F3mLukQBBh4KoJ9AT6ADvLz7Ev', - header: { - level: 63401, - proto: 2, - predecessor: 'BLzrD8thayxjzCxQAy2y3WYg7Rqvh59V3FX2UpDZdNkoeutt935', - timestamp: '2022-05-09T22:46:29Z', - 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', - signature: - 'sigcRoFAEPYkmtMRGReeSd5tjnSNfgAntG3H5aHyTk4WSKc42QVzj5xHf9RsDvkyGSgLsm7hvYVoQ27p8pd9QYSmNUWdS11t', - }, - metadata: { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - next_protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - 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: 'tz1PirbogVqfmBT9XCuYJ1KnDx4bnMSYfGru', - baker: 'tz1PirbogVqfmBT9XCuYJ1KnDx4bnMSYfGru', - level_info: { - level: 63401, - level_position: 63400, - cycle: 15, - cycle_position: 1960, - expected_commitment: false, - }, - voting_period_info: { - voting_period: { - index: 15, - kind: 'proposal', - start_position: 61440, - }, - position: 1960, - remaining: 2135, - }, - nonce_hash: null, - consumed_gas: '1521000', - deactivated: [], - balance_updates: [ - { - kind: 'accumulator', - category: 'block fees', - change: '-380', - origin: 'block', - }, - { - kind: 'minted', - category: 'baking rewards', - change: '-10000000', - origin: 'block', - }, - { - kind: 'contract', - contract: 'tz1PirbogVqfmBT9XCuYJ1KnDx4bnMSYfGru', - change: '10000380', - origin: 'block', - }, - { - kind: 'minted', - category: 'baking bonuses', - change: '-8533426', - origin: 'block', - }, - { - kind: 'contract', - contract: 'tz1PirbogVqfmBT9XCuYJ1KnDx4bnMSYfGru', - change: '8533426', - origin: 'block', - }, - ], - liquidity_baking_toggle_ema: 521773279, - implicit_operations_results: [ - { - kind: 'transaction', - storage: [ - { - int: '1', - }, - { - int: '158500000100', - }, - { - 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_gas: '205', - consumed_milligas: '204975', - storage_size: '4632', - }, - ], - consumed_milligas: '1521000', - }, - 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', - contents: [ - { - kind: 'endorsement', - slot: 2, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1foXHgRzdYdaLgX6XhpZGxbBv42LZ6ubvE', - endorsement_power: 471, - }, - }, - ], - signature: - 'sigQmXbRPsprFhuac6eeW66qp9Nf2RoHyjeNBwHYXSixdP7LiXNirCFAWB7YwV5cF3kQtaAqRTH21BjFbJo96ZAGTh6kK2PE', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'op3CxsBNtV1bkXM6rwqN7kW4AQ9pZYtnDDkZVNEgKGV7i1s5CXk', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 3, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1MvCE9dczhoij2bd4sLL2AfVuMtWfFAoCN', - endorsement_power: 220, - }, - }, - ], - signature: - 'sigf34YLEzjWP3iF5KPzBTAgv4942SgvwRje4dByVEVMVKGWSb48ygUdXtg7umiEfKVrNx5zoq6xTCXXb1T9wCFkGDQyCSHA', - }, - { - protocol: 'PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY', - chain_id: 'NetXLH1uAxK7CCh', - hash: 'op5xBzwaZ3xkSMLgpnUrJAR4baCjKAgNQjQCzDAo5hFZShe33or', - branch: 'BLWjScATovLPaC9CC2WTTcQLPtSeDsvi3KYQv9sdADCUckuKqAG', - contents: [ - { - kind: 'endorsement', - slot: 4, - level: 63400, - round: 0, - block_payload_hash: 'vh2rPXnC3mDgAQ5CR15VF91QfHtAzP5aEyR1VBV6NL3bJbck4th1', - metadata: { - delegate: 'tz1iTzWpFhURP5EnWqAc9hUkuVe2b2tSAGXC', - endorsement_power: 317, - }, - }, - ], - 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', @@ -5463,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', diff --git a/packages/taquito-rpc/test/taquito-rpc.spec.ts b/packages/taquito-rpc/test/taquito-rpc.spec.ts index b3ea27a8d0..b2fcb54d09 100644 --- a/packages/taquito-rpc/test/taquito-rpc.spec.ts +++ b/packages/taquito-rpc/test/taquito-rpc.spec.ts @@ -15,24 +15,11 @@ 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, @@ -53,7 +40,6 @@ import { } from '../src/types'; import { blockIthacanetResponse, - blockJakartanetResponse, blockKathmandunetResponse, blockLimanetResponse, blockMondaynetResponse, @@ -2933,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(); @@ -3950,8 +3507,8 @@ describe('RpcClient test', () => { const balanceUpdate = 'metadata' in response.contents[0] ? (response.contents[0]['metadata'][ - 'balance_updates' - ] as OperationMetadataBalanceUpdates[]) + 'balance_updates' + ] as OperationMetadataBalanceUpdates[]) : []; expect(balanceUpdate![0]['category']).toEqual(METADATA_BALANCE_UPDATES_CATEGORY.STORAGE_FEES); expect(balanceUpdate![1]['category']).toEqual(METADATA_BALANCE_UPDATES_CATEGORY.BLOCK_FEES); @@ -4012,8 +3569,8 @@ describe('RpcClient test', () => { const balanceUpdate = 'metadata' in response.contents[0] ? (response.contents[0]['metadata'][ - 'balance_updates' - ] as OperationMetadataBalanceUpdates[]) + 'balance_updates' + ] as OperationMetadataBalanceUpdates[]) : []; expect(balanceUpdate![0]['category']).toEqual(METADATA_BALANCE_UPDATES_CATEGORY.STORAGE_FEES); expect(balanceUpdate![1]['category']).toEqual(METADATA_BALANCE_UPDATES_CATEGORY.BLOCK_FEES); 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/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/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/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 9dd87a8134..f6b78fd038 100644 --- a/packages/taquito/src/operations/types.ts +++ b/packages/taquito/src/operations/types.ts @@ -20,8 +20,6 @@ export type ParamsWithKind = | withKind | withKind | withKind - | withKind - | withKind | withKind | withKind | 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 */ 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/test/contract/helper.ts b/packages/taquito/test/contract/helper.ts index 7789324efa..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: [ { diff --git a/packages/taquito/test/contract/rpc-contract-provider.spec.ts b/packages/taquito/test/contract/rpc-contract-provider.spec.ts index f0b6953dec..a80d95fdc8 100644 --- a/packages/taquito/test/contract/rpc-contract-provider.spec.ts +++ b/packages/taquito/test/contract/rpc-contract-provider.spec.ts @@ -80,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; @@ -140,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(), diff --git a/packages/taquito/test/estimate/rpc-estimate-provider.spec.ts b/packages/taquito/test/estimate/rpc-estimate-provider.spec.ts index 84683f47f8..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, @@ -1420,8 +1418,6 @@ describe('RPCEstimateProvider test wallet', () => { }, }, registerGlobalConstantNoReveal.contents[0], - txRollupOriginateNoReveal.contents[0], - txRollupSubmitBatchNoReveal.contents[0], ], }); const estimate = await estimateProvider.batch([ @@ -1435,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); 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/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",