Skip to content

Commit

Permalink
removed remaining tx_rollup references (#2675)
Browse files Browse the repository at this point in the history
* removed remaining tx_rollup references

* fixed unit test

* added back some types

* removed docs for tx rollups, and added back previous version

* removed txr1 address references
  • Loading branch information
dsawali authored Sep 29, 2023
1 parent 1253770 commit a0f22c3
Show file tree
Hide file tree
Showing 40 changed files with 34 additions and 3,716 deletions.
108 changes: 0 additions & 108 deletions docs/tx_rollups.md

This file was deleted.

52 changes: 0 additions & 52 deletions integration-tests/data/contract-txr1-address.ts

This file was deleted.

21 changes: 0 additions & 21 deletions packages/taquito-local-forging/src/codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`;
};
Expand Down
7 changes: 0 additions & 7 deletions packages/taquito-local-forging/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
12 changes: 0 additions & 12 deletions packages/taquito-local-forging/src/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ import {
smartContractAddressDecoder,
smartRollupAddressDecoder,
smartRollupCommitmentHashDecoder,
txRollupBatchContentDecoder,
txRollupIdDecoder,
txRollupOriginationParamDecoder,
tz1Decoder,
valueParameterDecoder,
zarithDecoder,
Expand All @@ -48,8 +45,6 @@ import {
SeedNonceRevelationSchema,
TransactionSchema,
TransferTicketSchema,
TxRollupOriginationSchema,
TxRollupSubmitBatchSchema,
SetDepositsLimitSchema,
SmartRollupOriginateSchema,
SmartRollupAddMessagesSchema,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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) =>
Expand Down
12 changes: 0 additions & 12 deletions packages/taquito-local-forging/src/encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ import {
smartContractAddressEncoder,
smartRollupAddressEncoder,
smartRollupCommitmentHashEncoder,
txRollupBatchContentEncoder,
txRollupIdEncoder,
txRollupOriginationParamEncoder,
tz1Encoder,
valueParameterEncoder,
zarithEncoder,
Expand All @@ -47,8 +44,6 @@ import {
SeedNonceRevelationSchema,
TransactionSchema,
TransferTicketSchema,
TxRollupOriginationSchema,
TxRollupSubmitBatchSchema,
SmartRollupOriginateSchema,
SmartRollupExecuteOutboxMessageSchema,
SmartRollupAddMessagesSchema,
Expand Down Expand Up @@ -80,9 +75,6 @@ export const encoders: { [key: string]: Encoder<any> } = {
[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,
Expand All @@ -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) =>
Expand Down
20 changes: 0 additions & 20 deletions packages/taquito-local-forging/src/schema/operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions packages/taquito-local-forging/src/taquito-local-forging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ')}"`);
}
Expand Down
6 changes: 0 additions & 6 deletions packages/taquito-local-forging/src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import {
AttestationSchema,
EndorsementSchema,
TransferTicketSchema,
TxRollupOriginationSchema,
TxRollupSubmitBatchSchema,
IncreasePaidStorageSchema,
UpdateConsensusKeySchema,
DrainDelegateSchema,
Expand All @@ -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
Expand All @@ -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,
Expand Down
1 change: 0 additions & 1 deletion packages/taquito-michel-codec/src/michelson-typecheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ function assertDataValidInternal(d: MichelsonData, t: MichelsonType, ctx: Contex
'SECP256K1PublicKeyHash',
'P256PublicKeyHash',
'ContractHash',
'TxRollupL2Address',
'RollupAddress'
) !== null
) {
Expand Down
4 changes: 1 addition & 3 deletions packages/taquito-michel-codec/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,7 @@ export type TezosIDType =
| 'P256Signature'
| 'GenericSignature'
| 'ChainID'
| 'RollupAddress'
| 'TxRollupL2Address';
| 'RollupAddress';

export type TezosIDPrefix = [number, number[]]; // payload length, prefix

Expand Down Expand Up @@ -309,7 +308,6 @@ export const tezosPrefix: Record<TezosIDType, TezosIDPrefix> = {
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<T extends TezosIDType[]>(
Expand Down
3 changes: 1 addition & 2 deletions packages/taquito-michelson-encoder/src/schema/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, TokenSchema> };
Expand Down
Loading

0 comments on commit a0f22c3

Please sign in to comment.