diff --git a/generated_block.ts b/generated_block.ts index 1955251..5320eb0 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -2,6 +2,7 @@ import { Builder } from 'ton' import { Slice } from 'ton' import { beginCell } from 'ton' import { BitString } from 'ton' +import { Cell } from 'ton' export interface Unit { readonly kind: 'Unit'; } @@ -314,14 +315,14 @@ export interface VarUInteger { readonly kind: 'VarUInteger'; readonly n: number; readonly len: number; - readonly value: number; + readonly value: bigint; } export interface VarInteger { readonly kind: 'VarInteger'; readonly n: number; readonly len: number; - readonly value: number; + readonly value: bigint; } export interface Grams { @@ -329,6 +330,11 @@ export interface Grams { readonly amount: VarUInteger; } +export interface Coins { + readonly kind: 'Coins'; + readonly grams: Grams; +} + export interface ExtraCurrencyCollection { readonly kind: 'ExtraCurrencyCollection'; readonly dict: HashmapE; @@ -407,6 +413,15 @@ export interface StateInit { readonly special: Maybe; readonly code: Maybe; readonly data: Maybe; + readonly library: Maybe; +} + +export interface StateInitWithLibs { + readonly kind: 'StateInitWithLibs'; + readonly split_depth: Maybe; + readonly special: Maybe; + readonly code: Maybe; + readonly data: Maybe; readonly library: HashmapE; } @@ -815,7 +830,7 @@ export interface TrComputePhase_tr_phase_compute_vm { readonly vm_final_state_hash: BitString; } -export type ComputeSkipReason = ComputeSkipReason_cskip_no_state | ComputeSkipReason_cskip_bad_state | ComputeSkipReason_cskip_no_gas; +export type ComputeSkipReason = ComputeSkipReason_cskip_no_state | ComputeSkipReason_cskip_bad_state | ComputeSkipReason_cskip_no_gas | ComputeSkipReason_cskip_suspended; export interface ComputeSkipReason_cskip_no_state { readonly kind: 'ComputeSkipReason_cskip_no_state'; @@ -829,6 +844,10 @@ export interface ComputeSkipReason_cskip_no_gas { readonly kind: 'ComputeSkipReason_cskip_no_gas'; } +export interface ComputeSkipReason_cskip_suspended { + readonly kind: 'ComputeSkipReason_cskip_suspended'; +} + export interface TrActionPhase { readonly kind: 'TrActionPhase'; readonly success: Bool; @@ -949,6 +968,7 @@ export interface SmartContractInfo { readonly rand_seed: BitString; readonly balance_remaining: CurrencyCollection; readonly myself: MsgAddressInt; + readonly global_config: Maybe; } export type OutList = OutList_out_list_empty | OutList_out_list; @@ -1056,12 +1076,7 @@ export interface ShardStateUnsplit { readonly custom: Maybe; } -export type ShardState = ShardState__ | ShardState_split_state; - -export interface ShardState__ { - readonly kind: 'ShardState__'; - readonly anon0: ShardStateUnsplit; -} +export type ShardState = ShardState_split_state | ShardState__; export interface ShardState_split_state { readonly kind: 'ShardState_split_state'; @@ -1069,6 +1084,11 @@ export interface ShardState_split_state { readonly right: ShardStateUnsplit; } +export interface ShardState__ { + readonly kind: 'ShardState__'; + readonly anon0: ShardStateUnsplit; +} + export interface LibDescr { readonly kind: 'LibDescr'; readonly lib: Slice; @@ -1122,7 +1142,7 @@ export interface Block { readonly global_id: number; readonly info: BlockInfo; readonly value_flow: ValueFlow; - readonly state_update: MERKLE_UPDATE; + readonly state_update: Cell; readonly extra: BlockExtra; } @@ -1136,13 +1156,29 @@ export interface BlockExtra { readonly custom: Maybe; } -export interface ValueFlow { - readonly kind: 'ValueFlow'; +export type ValueFlow = ValueFlow_value_flow | ValueFlow_value_flow_v2; + +export interface ValueFlow_value_flow { + readonly kind: 'ValueFlow_value_flow'; + readonly from_prev_blk: CurrencyCollection; + readonly to_next_blk: CurrencyCollection; + readonly imported: CurrencyCollection; + readonly exported: CurrencyCollection; + readonly fees_collected: CurrencyCollection; + readonly fees_imported: CurrencyCollection; + readonly recovered: CurrencyCollection; + readonly created: CurrencyCollection; + readonly minted: CurrencyCollection; +} + +export interface ValueFlow_value_flow_v2 { + readonly kind: 'ValueFlow_value_flow_v2'; readonly from_prev_blk: CurrencyCollection; readonly to_next_blk: CurrencyCollection; readonly imported: CurrencyCollection; readonly exported: CurrencyCollection; readonly fees_collected: CurrencyCollection; + readonly burned: CurrencyCollection; readonly fees_imported: CurrencyCollection; readonly recovered: CurrencyCollection; readonly created: CurrencyCollection; @@ -1345,12 +1381,7 @@ export interface CryptoSignatureSimple { readonly s: BitString; } -export type CryptoSignature = CryptoSignature__ | CryptoSignature_chained_signature; - -export interface CryptoSignature__ { - readonly kind: 'CryptoSignature__'; - readonly anon0: CryptoSignatureSimple; -} +export type CryptoSignature = CryptoSignature_chained_signature | CryptoSignature__; export interface CryptoSignature_chained_signature { readonly kind: 'CryptoSignature_chained_signature'; @@ -1358,6 +1389,11 @@ export interface CryptoSignature_chained_signature { readonly temp_key_signature: CryptoSignatureSimple; } +export interface CryptoSignature__ { + readonly kind: 'CryptoSignature__'; + readonly anon0: CryptoSignatureSimple; +} + export interface CryptoSignaturePair { readonly kind: 'CryptoSignaturePair'; readonly node_id_short: BitString; @@ -1429,7 +1465,7 @@ export interface ValidatorSet_validators_ext { readonly list: HashmapE; } -export type ConfigParam = ConfigParam__ | ConfigParam__1 | ConfigParam__2 | ConfigParam__3 | ConfigParam__4 | ConfigParam__5 | ConfigParam__6 | ConfigParam__7 | ConfigParam__8 | ConfigParam__9 | ConfigParam__10 | ConfigParam__11 | ConfigParam__12 | ConfigParam__13 | ConfigParam__14 | ConfigParam__15 | ConfigParam__16 | ConfigParam__17 | ConfigParam__24 | ConfigParam__25 | ConfigParam__26 | ConfigParam__27 | ConfigParam__28 | ConfigParam__29 | ConfigParam__30 | ConfigParam__31 | ConfigParam__32 | ConfigParam__33 | ConfigParam__34 | ConfigParam__35 | ConfigParam__36 | ConfigParam__37 | ConfigParam_config_mc_gas_prices | ConfigParam_config_gas_prices | ConfigParam_config_mc_block_limits | ConfigParam_config_block_limits | ConfigParam_config_mc_fwd_prices | ConfigParam_config_fwd_prices; +export type ConfigParam = ConfigParam__ | ConfigParam__1 | ConfigParam__2 | ConfigParam__3 | ConfigParam__4 | ConfigParam__5 | ConfigParam__6 | ConfigParam__7 | ConfigParam__8 | ConfigParam__9 | ConfigParam__10 | ConfigParam__11 | ConfigParam__12 | ConfigParam__13 | ConfigParam__14 | ConfigParam__15 | ConfigParam__16 | ConfigParam__17 | ConfigParam__18 | ConfigParam__19 | ConfigParam_config_mc_gas_prices | ConfigParam_config_gas_prices | ConfigParam_config_mc_block_limits | ConfigParam_config_block_limits | ConfigParam_config_mc_fwd_prices | ConfigParam_config_fwd_prices | ConfigParam__26 | ConfigParam__27 | ConfigParam__28 | ConfigParam__29 | ConfigParam__30 | ConfigParam__31 | ConfigParam__32 | ConfigParam__33 | ConfigParam__34 | ConfigParam__35 | ConfigParam__36 | ConfigParam__37 | ConfigParam__38 | ConfigParam__39 | ConfigParam__40 | ConfigParam__41 | ConfigParam__42 | ConfigParam__43 | ConfigParam__44; export interface ConfigParam__ { readonly kind: 'ConfigParam__'; @@ -1458,176 +1494,218 @@ export interface ConfigParam__4 { export interface ConfigParam__5 { readonly kind: 'ConfigParam__5'; - readonly mint_new_price: Grams; - readonly mint_add_price: Grams; + readonly anon0: BurningConfig; } export interface ConfigParam__6 { readonly kind: 'ConfigParam__6'; - readonly to_mint: ExtraCurrencyCollection; + readonly mint_new_price: Grams; + readonly mint_add_price: Grams; } export interface ConfigParam__7 { readonly kind: 'ConfigParam__7'; - readonly anon0: GlobalVersion; + readonly to_mint: ExtraCurrencyCollection; } export interface ConfigParam__8 { readonly kind: 'ConfigParam__8'; - readonly mandatory_params: Hashmap; + readonly anon0: GlobalVersion; } export interface ConfigParam__9 { readonly kind: 'ConfigParam__9'; - readonly critical_params: Hashmap; + readonly mandatory_params: Hashmap; } export interface ConfigParam__10 { readonly kind: 'ConfigParam__10'; - readonly anon0: ConfigVotingSetup; + readonly critical_params: Hashmap; } export interface ConfigParam__11 { readonly kind: 'ConfigParam__11'; - readonly workchains: HashmapE; + readonly anon0: ConfigVotingSetup; } export interface ConfigParam__12 { readonly kind: 'ConfigParam__12'; - readonly anon0: ComplaintPricing; + readonly workchains: HashmapE; } export interface ConfigParam__13 { readonly kind: 'ConfigParam__13'; - readonly anon0: BlockCreateFees; + readonly anon0: ComplaintPricing; } export interface ConfigParam__14 { readonly kind: 'ConfigParam__14'; + readonly anon0: BlockCreateFees; +} + +export interface ConfigParam__15 { + readonly kind: 'ConfigParam__15'; readonly validators_elected_for: number; readonly elections_start_before: number; readonly elections_end_before: number; readonly stake_held_for: number; } -export interface ConfigParam__15 { - readonly kind: 'ConfigParam__15'; +export interface ConfigParam__16 { + readonly kind: 'ConfigParam__16'; readonly max_validators: number; readonly max_main_validators: number; readonly min_validators: number; } -export interface ConfigParam__16 { - readonly kind: 'ConfigParam__16'; +export interface ConfigParam__17 { + readonly kind: 'ConfigParam__17'; readonly min_stake: Grams; readonly max_stake: Grams; readonly min_total_stake: Grams; readonly max_stake_factor: number; } -export interface ConfigParam__17 { - readonly kind: 'ConfigParam__17'; +export interface ConfigParam__18 { + readonly kind: 'ConfigParam__18'; readonly anon0: Hashmap; } -export interface ConfigParam__24 { - readonly kind: 'ConfigParam__24'; - readonly anon0: CatchainConfig; +export interface ConfigParam__19 { + readonly kind: 'ConfigParam__19'; + readonly global_id: number; } -export interface ConfigParam__25 { - readonly kind: 'ConfigParam__25'; - readonly anon0: ConsensusConfig; +export interface ConfigParam_config_mc_gas_prices { + readonly kind: 'ConfigParam_config_mc_gas_prices'; + readonly anon0: GasLimitsPrices; +} + +export interface ConfigParam_config_gas_prices { + readonly kind: 'ConfigParam_config_gas_prices'; + readonly anon0: GasLimitsPrices; +} + +export interface ConfigParam_config_mc_block_limits { + readonly kind: 'ConfigParam_config_mc_block_limits'; + readonly anon0: BlockLimits; +} + +export interface ConfigParam_config_block_limits { + readonly kind: 'ConfigParam_config_block_limits'; + readonly anon0: BlockLimits; +} + +export interface ConfigParam_config_mc_fwd_prices { + readonly kind: 'ConfigParam_config_mc_fwd_prices'; + readonly anon0: MsgForwardPrices; +} + +export interface ConfigParam_config_fwd_prices { + readonly kind: 'ConfigParam_config_fwd_prices'; + readonly anon0: MsgForwardPrices; } export interface ConfigParam__26 { readonly kind: 'ConfigParam__26'; - readonly fundamental_smc_addr: HashmapE; + readonly anon0: CatchainConfig; } export interface ConfigParam__27 { readonly kind: 'ConfigParam__27'; - readonly prev_validators: ValidatorSet; + readonly anon0: ConsensusConfig; } export interface ConfigParam__28 { readonly kind: 'ConfigParam__28'; - readonly prev_temp_validators: ValidatorSet; + readonly fundamental_smc_addr: HashmapE; } export interface ConfigParam__29 { readonly kind: 'ConfigParam__29'; - readonly cur_validators: ValidatorSet; + readonly prev_validators: ValidatorSet; } export interface ConfigParam__30 { readonly kind: 'ConfigParam__30'; - readonly cur_temp_validators: ValidatorSet; + readonly prev_temp_validators: ValidatorSet; } export interface ConfigParam__31 { readonly kind: 'ConfigParam__31'; - readonly next_validators: ValidatorSet; + readonly cur_validators: ValidatorSet; } export interface ConfigParam__32 { readonly kind: 'ConfigParam__32'; - readonly next_temp_validators: ValidatorSet; + readonly cur_temp_validators: ValidatorSet; } export interface ConfigParam__33 { readonly kind: 'ConfigParam__33'; - readonly anon0: HashmapE; + readonly next_validators: ValidatorSet; } export interface ConfigParam__34 { readonly kind: 'ConfigParam__34'; - readonly anon0: MisbehaviourPunishmentConfig; + readonly next_temp_validators: ValidatorSet; } export interface ConfigParam__35 { readonly kind: 'ConfigParam__35'; - readonly anon0: OracleBridgeParams; + readonly anon0: HashmapE; } export interface ConfigParam__36 { readonly kind: 'ConfigParam__36'; - readonly anon0: OracleBridgeParams; + readonly anon0: MisbehaviourPunishmentConfig; } export interface ConfigParam__37 { readonly kind: 'ConfigParam__37'; + readonly anon0: SizeLimitsConfig; +} + +export interface ConfigParam__38 { + readonly kind: 'ConfigParam__38'; + readonly anon0: SuspendedAddressList; +} + +export interface ConfigParam__39 { + readonly kind: 'ConfigParam__39'; readonly anon0: OracleBridgeParams; } -export interface ConfigParam_config_mc_gas_prices { - readonly kind: 'ConfigParam_config_mc_gas_prices'; - readonly anon0: GasLimitsPrices; +export interface ConfigParam__40 { + readonly kind: 'ConfigParam__40'; + readonly anon0: OracleBridgeParams; } -export interface ConfigParam_config_gas_prices { - readonly kind: 'ConfigParam_config_gas_prices'; - readonly anon0: GasLimitsPrices; +export interface ConfigParam__41 { + readonly kind: 'ConfigParam__41'; + readonly anon0: OracleBridgeParams; } -export interface ConfigParam_config_mc_block_limits { - readonly kind: 'ConfigParam_config_mc_block_limits'; - readonly anon0: BlockLimits; +export interface ConfigParam__42 { + readonly kind: 'ConfigParam__42'; + readonly anon0: JettonBridgeParams; } -export interface ConfigParam_config_block_limits { - readonly kind: 'ConfigParam_config_block_limits'; - readonly anon0: BlockLimits; +export interface ConfigParam__43 { + readonly kind: 'ConfigParam__43'; + readonly anon0: JettonBridgeParams; } -export interface ConfigParam_config_mc_fwd_prices { - readonly kind: 'ConfigParam_config_mc_fwd_prices'; - readonly anon0: MsgForwardPrices; +export interface ConfigParam__44 { + readonly kind: 'ConfigParam__44'; + readonly anon0: JettonBridgeParams; } -export interface ConfigParam_config_fwd_prices { - readonly kind: 'ConfigParam_config_fwd_prices'; - readonly anon0: MsgForwardPrices; +export interface BurningConfig { + readonly kind: 'BurningConfig'; + readonly blackhole_addr: Maybe; + readonly fee_burn_num: number; + readonly fee_burn_denom: number; } export interface GlobalVersion { @@ -1690,8 +1768,34 @@ export interface WorkchainFormat_wfmt_ext { readonly workchain_type_id: number; } -export interface WorkchainDescr { - readonly kind: 'WorkchainDescr'; +export interface WcSplitMergeTimings { + readonly kind: 'WcSplitMergeTimings'; + readonly split_merge_delay: number; + readonly split_merge_interval: number; + readonly min_split_merge_interval: number; + readonly max_split_merge_delay: number; +} + +export type WorkchainDescr = WorkchainDescr_workchain | WorkchainDescr_workchain_v2; + +export interface WorkchainDescr_workchain { + readonly kind: 'WorkchainDescr_workchain'; + readonly enabled_since: number; + readonly actual_min_split: number; + readonly min_split: number; + readonly max_split: number; + readonly basic: number; + readonly active: Bool; + readonly accept_msgs: Bool; + readonly flags: number; + readonly zerostate_root_hash: BitString; + readonly zerostate_file_hash: BitString; + readonly version: number; + readonly format: WorkchainFormat; +} + +export interface WorkchainDescr_workchain_v2 { + readonly kind: 'WorkchainDescr_workchain_v2'; readonly enabled_since: number; readonly actual_min_split: number; readonly min_split: number; @@ -1704,6 +1808,7 @@ export interface WorkchainDescr { readonly zerostate_file_hash: BitString; readonly version: number; readonly format: WorkchainFormat; + readonly split_merge_timings: WcSplitMergeTimings; } export interface ComplaintPricing { @@ -1890,6 +1995,37 @@ export interface MisbehaviourPunishmentConfig { readonly medium_proportional_mult: number; } +export type SizeLimitsConfig = SizeLimitsConfig_size_limits_config | SizeLimitsConfig_size_limits_config_v2; + +export interface SizeLimitsConfig_size_limits_config { + readonly kind: 'SizeLimitsConfig_size_limits_config'; + readonly max_msg_bits: number; + readonly max_msg_cells: number; + readonly max_library_cells: number; + readonly max_vm_data_depth: number; + readonly max_ext_msg_size: number; + readonly max_ext_msg_depth: number; +} + +export interface SizeLimitsConfig_size_limits_config_v2 { + readonly kind: 'SizeLimitsConfig_size_limits_config_v2'; + readonly max_msg_bits: number; + readonly max_msg_cells: number; + readonly max_library_cells: number; + readonly max_vm_data_depth: number; + readonly max_ext_msg_size: number; + readonly max_ext_msg_depth: number; + readonly max_acc_state_cells: number; + readonly max_acc_state_bits: number; + readonly max_acc_public_libraries: number; +} + +export interface SuspendedAddressList { + readonly kind: 'SuspendedAddressList'; + readonly addresses: HashmapE; + readonly suspended_until: number; +} + export interface OracleBridgeParams { readonly kind: 'OracleBridgeParams'; readonly bridge_address: BitString; @@ -1898,6 +2034,37 @@ export interface OracleBridgeParams { readonly external_chain_address: BitString; } +export interface JettonBridgePrices { + readonly kind: 'JettonBridgePrices'; + readonly bridge_burn_fee: Coins; + readonly bridge_mint_fee: Coins; + readonly wallet_min_tons_for_storage: Coins; + readonly wallet_gas_consumption: Coins; + readonly minter_min_tons_for_storage: Coins; + readonly discover_gas_consumption: Coins; +} + +export type JettonBridgeParams = JettonBridgeParams_jetton_bridge_params_v0 | JettonBridgeParams_jetton_bridge_params_v1; + +export interface JettonBridgeParams_jetton_bridge_params_v0 { + readonly kind: 'JettonBridgeParams_jetton_bridge_params_v0'; + readonly bridge_address: BitString; + readonly oracles_address: BitString; + readonly oracles: HashmapE; + readonly state_flags: number; + readonly burn_bridge_fee: Coins; +} + +export interface JettonBridgeParams_jetton_bridge_params_v1 { + readonly kind: 'JettonBridgeParams_jetton_bridge_params_v1'; + readonly bridge_address: BitString; + readonly oracles_address: BitString; + readonly oracles: HashmapE; + readonly state_flags: number; + readonly prices: JettonBridgePrices; + readonly external_chain_address: BitString; +} + export interface BlockSignaturesPure { readonly kind: 'BlockSignaturesPure'; readonly sig_count: number; @@ -2214,7 +2381,7 @@ export interface Text { readonly rest: TextChunks; } -export type DNSRecord = DNSRecord_dns_text | DNSRecord_dns_next_resolver | DNSRecord_dns_adnl_address | DNSRecord_dns_smc_address; +export type DNSRecord = DNSRecord_dns_text | DNSRecord_dns_next_resolver | DNSRecord_dns_adnl_address | DNSRecord_dns_smc_address | DNSRecord_dns_storage_address; export interface DNSRecord_dns_text { readonly kind: 'DNSRecord_dns_text'; @@ -2240,6 +2407,11 @@ export interface DNSRecord_dns_smc_address { readonly cap_list: SmcCapList | undefined; } +export interface DNSRecord_dns_storage_address { + readonly kind: 'DNSRecord_dns_storage_address'; + readonly bag_id: BitString; +} + export type ProtoList = ProtoList_proto_list_nil | ProtoList_proto_list_next; export interface ProtoList_proto_list_nil { @@ -2880,22 +3052,17 @@ export function storeHashmapE(hashmapE: HashmapE, storeX: (x: X) => (build } export function loadBitstringSet(slice: Slice, n: number): BitstringSet { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xda553663))) { - slice.loadUint(32); - let _: Hashmap = loadHashmap(slice, n, loadTrue); - return { - kind: 'BitstringSet', - n: n, - _: _, - } - + let _: Hashmap = loadHashmap(slice, n, loadTrue); + return { + kind: 'BitstringSet', + n: n, + _: _, } - throw new Error(''); + } export function storeBitstringSet(bitstringSet: BitstringSet): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xda553663, 32); storeHashmap(bitstringSet._, storeTrue)(builder); }) @@ -3463,8 +3630,7 @@ export function storeMsgAddressInt(msgAddressInt: MsgAddressInt): (builder: Buil } export function loadMsgAddress(slice: Slice): MsgAddress { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xef3a10fa))) { - slice.loadUint(32); + if (true) { let _: MsgAddressInt = loadMsgAddressInt(slice); return { kind: 'MsgAddress__', @@ -3472,8 +3638,7 @@ export function loadMsgAddress(slice: Slice): MsgAddress { } } - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf942fd1))) { - slice.loadUint(32); + if (true) { let _: MsgAddressExt = loadMsgAddressExt(slice); return { kind: 'MsgAddress__1', @@ -3487,14 +3652,12 @@ export function loadMsgAddress(slice: Slice): MsgAddress { export function storeMsgAddress(msgAddress: MsgAddress): (builder: Builder) => void { if ((msgAddress.kind == 'MsgAddress__')) { return ((builder: Builder) => { - builder.storeUint(0xef3a10fa, 32); storeMsgAddressInt(msgAddress._)(builder); }) } if ((msgAddress.kind == 'MsgAddress__1')) { return ((builder: Builder) => { - builder.storeUint(0xcf942fd1, 32); storeMsgAddressExt(msgAddress._)(builder); }) @@ -3504,7 +3667,7 @@ export function storeMsgAddress(msgAddress: MsgAddress): (builder: Builder) => v export function loadVarUInteger(slice: Slice, n: number): VarUInteger { let len: number = slice.loadUint(bitLen((n - 1))); - let value: number = slice.loadUint((len * 8)); + let value: bigint = slice.loadUintBig((len * 8)); return { kind: 'VarUInteger', n: n, @@ -3524,7 +3687,7 @@ export function storeVarUInteger(varUInteger: VarUInteger): (builder: Builder) = export function loadVarInteger(slice: Slice, n: number): VarInteger { let len: number = slice.loadUint(bitLen((n - 1))); - let value: number = slice.loadInt((len * 8)); + let value: bigint = slice.loadIntBig((len * 8)); return { kind: 'VarInteger', n: n, @@ -3558,6 +3721,22 @@ export function storeGrams(grams: Grams): (builder: Builder) => void { } +export function loadCoins(slice: Slice): Coins { + let grams: Grams = loadGrams(slice); + return { + kind: 'Coins', + grams: grams, + } + +} + +export function storeCoins(coins: Coins): (builder: Builder) => void { + return ((builder: Builder) => { + storeGrams(coins.grams)(builder); + }) + +} + export function loadExtraCurrencyCollection(slice: Slice): ExtraCurrencyCollection { let dict: HashmapE = loadHashmapE(slice, 32, ((slice: Slice) => { return loadVarUInteger(slice, 32) @@ -3795,40 +3974,39 @@ export function storeTickTock(tickTock: TickTock): (builder: Builder) => void { } export function loadStateInit(slice: Slice): StateInit { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x91231967))) { - slice.loadUint(32); - let split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { - return slice.loadUint(5) + let split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadUint(5) - })); - let special: Maybe = loadMaybe(slice, loadTickTock); - let code: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1 + })); + let special: Maybe = loadMaybe(slice, loadTickTock); + let code: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 - })); - let data: Maybe = loadMaybe(slice, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1 + })); + let data: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 - })); - let library: HashmapE = loadHashmapE(slice, 256, loadSimpleLib); - return { - kind: 'StateInit', - split_depth: split_depth, - special: special, - code: code, - data: data, - library: library, - } + })); + let library: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 + })); + return { + kind: 'StateInit', + split_depth: split_depth, + special: special, + code: code, + data: data, + library: library, } - throw new Error(''); + } export function storeStateInit(stateInit: StateInit): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x91231967, 32); storeMaybe(stateInit.split_depth, ((arg: number) => { return ((builder: Builder) => { builder.storeUint(arg, 5); @@ -3854,15 +4032,83 @@ export function storeStateInit(stateInit: StateInit): (builder: Builder) => void }) }))(builder); - storeHashmapE(stateInit.library, storeSimpleLib)(builder); + storeMaybe(stateInit.library, ((arg: Slice) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeSlice(arg); + builder.storeRef(cell1); + + }) + + }))(builder); }) } -export function loadSimpleLib(slice: Slice): SimpleLib { - let public0: Bool = loadBool(slice); - let slice1 = slice.loadRef().beginParse(); - let root: Slice = slice1; +export function loadStateInitWithLibs(slice: Slice): StateInitWithLibs { + let split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadUint(5) + + })); + let special: Maybe = loadMaybe(slice, loadTickTock); + let code: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 + + })); + let data: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 + + })); + let library: HashmapE = loadHashmapE(slice, 256, loadSimpleLib); + return { + kind: 'StateInitWithLibs', + split_depth: split_depth, + special: special, + code: code, + data: data, + library: library, + } + +} + +export function storeStateInitWithLibs(stateInitWithLibs: StateInitWithLibs): (builder: Builder) => void { + return ((builder: Builder) => { + storeMaybe(stateInitWithLibs.split_depth, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 5); + }) + + }))(builder); + storeMaybe(stateInitWithLibs.special, storeTickTock)(builder); + storeMaybe(stateInitWithLibs.code, ((arg: Slice) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeSlice(arg); + builder.storeRef(cell1); + + }) + + }))(builder); + storeMaybe(stateInitWithLibs.data, ((arg: Slice) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + cell1.storeSlice(arg); + builder.storeRef(cell1); + + }) + + }))(builder); + storeHashmapE(stateInitWithLibs.library, storeSimpleLib)(builder); + }) + +} + +export function loadSimpleLib(slice: Slice): SimpleLib { + let public0: Bool = loadBool(slice); + let slice1 = slice.loadRef().beginParse(); + let root: Slice = slice1; return { kind: 'SimpleLib', public0: public0, @@ -3990,24 +4236,19 @@ export function storeMessageRelaxed(messageRelaxed: MessageRelaxed, storeX } export function loadMessageAny(slice: Slice): MessageAny { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c54aa4b))) { - slice.loadUint(32); - let anon0: Message = loadMessage(slice, ((slice: Slice) => { - return slice - - })); - return { - kind: 'MessageAny', - anon0: anon0, - } + let anon0: Message = loadMessage(slice, ((slice: Slice) => { + return slice + })); + return { + kind: 'MessageAny', + anon0: anon0, } - throw new Error(''); + } export function storeMessageAny(messageAny: MessageAny): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x9c54aa4b, 32); storeMessage(messageAny.anon0, ((arg: Slice) => { return ((builder: Builder) => { builder.storeSlice(arg); @@ -4112,7 +4353,7 @@ export function storeMsgEnvelope(msgEnvelope: MsgEnvelope): (builder: Builder) = let cell1 = beginCell(); storeMessage(msgEnvelope.msg, ((arg: Slice) => { return ((builder: Builder) => { - cell1.storeSlice(arg); + builder.storeSlice(arg); }) }))(cell1); @@ -4245,7 +4486,7 @@ export function storeInMsg(inMsg: InMsg): (builder: Builder) => void { let cell1 = beginCell(); storeMessage(inMsg.msg, ((arg: Slice) => { return ((builder: Builder) => { - cell1.storeSlice(arg); + builder.storeSlice(arg); }) }))(cell1); @@ -4262,7 +4503,7 @@ export function storeInMsg(inMsg: InMsg): (builder: Builder) => void { let cell1 = beginCell(); storeMessage(inMsg.msg, ((arg: Slice) => { return ((builder: Builder) => { - cell1.storeSlice(arg); + builder.storeSlice(arg); }) }))(cell1); @@ -4364,21 +4605,16 @@ export function storeImportFees(importFees: ImportFees): (builder: Builder) => v } export function loadInMsgDescr(slice: Slice): InMsgDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8615b8fd))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadInMsg, loadImportFees); - return { - kind: 'InMsgDescr', - anon0: anon0, - } - + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadInMsg, loadImportFees); + return { + kind: 'InMsgDescr', + anon0: anon0, } - throw new Error(''); + } export function storeInMsgDescr(inMsgDescr: InMsgDescr): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x8615b8fd, 32); storeHashmapAugE(inMsgDescr.anon0, storeInMsg, storeImportFees)(builder); }) @@ -4506,7 +4742,7 @@ export function storeOutMsg(outMsg: OutMsg): (builder: Builder) => void { let cell1 = beginCell(); storeMessage(outMsg.msg, ((arg: Slice) => { return ((builder: Builder) => { - cell1.storeSlice(arg); + builder.storeSlice(arg); }) }))(cell1); @@ -4604,24 +4840,19 @@ export function storeOutMsg(outMsg: OutMsg): (builder: Builder) => void { } export function loadEnqueuedMsg(slice: Slice): EnqueuedMsg { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98cd4c6e))) { - slice.loadUint(32); - let enqueued_lt: number = slice.loadUint(64); - let slice1 = slice.loadRef().beginParse(); - let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); - return { - kind: 'EnqueuedMsg', - enqueued_lt: enqueued_lt, - out_msg: out_msg, - } - + let enqueued_lt: number = slice.loadUint(64); + let slice1 = slice.loadRef().beginParse(); + let out_msg: MsgEnvelope = loadMsgEnvelope(slice1); + return { + kind: 'EnqueuedMsg', + enqueued_lt: enqueued_lt, + out_msg: out_msg, } - throw new Error(''); + } export function storeEnqueuedMsg(enqueuedMsg: EnqueuedMsg): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x98cd4c6e, 32); builder.storeUint(enqueuedMsg.enqueued_lt, 64); let cell1 = beginCell(); storeMsgEnvelope(enqueuedMsg.out_msg)(cell1); @@ -4631,45 +4862,35 @@ export function storeEnqueuedMsg(enqueuedMsg: EnqueuedMsg): (builder: Builder) = } export function loadOutMsgDescr(slice: Slice): OutMsgDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xbcd61b19))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadOutMsg, loadCurrencyCollection); - return { - kind: 'OutMsgDescr', - anon0: anon0, - } - + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadOutMsg, loadCurrencyCollection); + return { + kind: 'OutMsgDescr', + anon0: anon0, } - throw new Error(''); + } export function storeOutMsgDescr(outMsgDescr: OutMsgDescr): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xbcd61b19, 32); storeHashmapAugE(outMsgDescr.anon0, storeOutMsg, storeCurrencyCollection)(builder); }) } export function loadOutMsgQueue(slice: Slice): OutMsgQueue { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf5f0da2))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 352, loadEnqueuedMsg, ((slice: Slice) => { - return slice.loadUint(64) - - })); - return { - kind: 'OutMsgQueue', - anon0: anon0, - } + let anon0: HashmapAugE = loadHashmapAugE(slice, 352, loadEnqueuedMsg, ((slice: Slice) => { + return slice.loadUint(64) + })); + return { + kind: 'OutMsgQueue', + anon0: anon0, } - throw new Error(''); + } export function storeOutMsgQueue(outMsgQueue: OutMsgQueue): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xcf5f0da2, 32); storeHashmapAugE(outMsgQueue.anon0, storeEnqueuedMsg, ((arg: number) => { return ((builder: Builder) => { builder.storeUint(arg, 64); @@ -4700,21 +4921,16 @@ export function storeProcessedUpto(processedUpto: ProcessedUpto): (builder: Buil } export function loadProcessedInfo(slice: Slice): ProcessedInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x982f4fa3))) { - slice.loadUint(32); - let anon0: HashmapE = loadHashmapE(slice, 96, loadProcessedUpto); - return { - kind: 'ProcessedInfo', - anon0: anon0, - } - + let anon0: HashmapE = loadHashmapE(slice, 96, loadProcessedUpto); + return { + kind: 'ProcessedInfo', + anon0: anon0, } - throw new Error(''); + } export function storeProcessedInfo(processedInfo: ProcessedInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x982f4fa3, 32); storeHashmapE(processedInfo.anon0, storeProcessedUpto)(builder); }) @@ -4737,46 +4953,36 @@ export function storeIhrPendingSince(ihrPendingSince: IhrPendingSince): (builder } export function loadIhrPendingInfo(slice: Slice): IhrPendingInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc31463df))) { - slice.loadUint(32); - let anon0: HashmapE = loadHashmapE(slice, 320, loadIhrPendingSince); - return { - kind: 'IhrPendingInfo', - anon0: anon0, - } - + let anon0: HashmapE = loadHashmapE(slice, 320, loadIhrPendingSince); + return { + kind: 'IhrPendingInfo', + anon0: anon0, } - throw new Error(''); + } export function storeIhrPendingInfo(ihrPendingInfo: IhrPendingInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xc31463df, 32); storeHashmapE(ihrPendingInfo.anon0, storeIhrPendingSince)(builder); }) } export function loadOutMsgQueueInfo(slice: Slice): OutMsgQueueInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98bb9b21))) { - slice.loadUint(32); - let out_queue: OutMsgQueue = loadOutMsgQueue(slice); - let proc_info: ProcessedInfo = loadProcessedInfo(slice); - let ihr_pending: IhrPendingInfo = loadIhrPendingInfo(slice); - return { - kind: 'OutMsgQueueInfo', - out_queue: out_queue, - proc_info: proc_info, - ihr_pending: ihr_pending, - } - + let out_queue: OutMsgQueue = loadOutMsgQueue(slice); + let proc_info: ProcessedInfo = loadProcessedInfo(slice); + let ihr_pending: IhrPendingInfo = loadIhrPendingInfo(slice); + return { + kind: 'OutMsgQueueInfo', + out_queue: out_queue, + proc_info: proc_info, + ihr_pending: ihr_pending, } - throw new Error(''); + } export function storeOutMsgQueueInfo(outMsgQueueInfo: OutMsgQueueInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x98bb9b21, 32); storeOutMsgQueue(outMsgQueueInfo.out_queue)(builder); storeProcessedInfo(outMsgQueueInfo.proc_info)(builder); storeIhrPendingInfo(outMsgQueueInfo.ihr_pending)(builder); @@ -5070,21 +5276,16 @@ export function storeDepthBalanceInfo(depthBalanceInfo: DepthBalanceInfo): (buil } export function loadShardAccounts(slice: Slice): ShardAccounts { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xa59aef08))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadShardAccount, loadDepthBalanceInfo); - return { - kind: 'ShardAccounts', - anon0: anon0, - } - + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadShardAccount, loadDepthBalanceInfo); + return { + kind: 'ShardAccounts', + anon0: anon0, } - throw new Error(''); + } export function storeShardAccounts(shardAccounts: ShardAccounts): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xa59aef08, 32); storeHashmapAugE(shardAccounts.anon0, storeShardAccount, storeDepthBalanceInfo)(builder); }) @@ -5161,7 +5362,7 @@ export function storeTransaction(transaction: Transaction): (builder: Builder) = let cell1 = beginCell(); storeMessage(arg, ((arg: Slice) => { return ((builder: Builder) => { - cell1.storeSlice(arg); + builder.storeSlice(arg); }) }))(cell1); @@ -5175,7 +5376,7 @@ export function storeTransaction(transaction: Transaction): (builder: Builder) = let cell1 = beginCell(); storeMessage(arg, ((arg: Slice) => { return ((builder: Builder) => { - cell1.storeSlice(arg); + builder.storeSlice(arg); }) }))(cell1); @@ -5329,21 +5530,16 @@ export function storeAccountBlock(accountBlock: AccountBlock): (builder: Builder } export function loadShardAccountBlocks(slice: Slice): ShardAccountBlocks { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc67c889))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadAccountBlock, loadCurrencyCollection); - return { - kind: 'ShardAccountBlocks', - anon0: anon0, - } - + let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadAccountBlock, loadCurrencyCollection); + return { + kind: 'ShardAccountBlocks', + anon0: anon0, } - throw new Error(''); + } export function storeShardAccountBlocks(shardAccountBlocks: ShardAccountBlocks): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xdc67c889, 32); storeHashmapAugE(shardAccountBlocks.anon0, storeAccountBlock, storeCurrencyCollection)(builder); }) @@ -5518,7 +5714,7 @@ export function storeTrComputePhase(trComputePhase: TrComputePhase): (builder: B cell1.storeInt(trComputePhase.exit_code, 32); storeMaybe(trComputePhase.exit_arg, ((arg: number) => { return ((builder: Builder) => { - cell1.storeInt(arg, 32); + builder.storeInt(arg, 32); }) }))(cell1); @@ -5553,6 +5749,13 @@ export function loadComputeSkipReason(slice: Slice): ComputeSkipReason { kind: 'ComputeSkipReason_cskip_no_gas', } + } + if (((slice.remainingBits >= 3) && (slice.preloadUint(3) == 0b110))) { + slice.loadUint(3); + return { + kind: 'ComputeSkipReason_cskip_suspended', + } + } throw new Error(''); } @@ -5575,6 +5778,12 @@ export function storeComputeSkipReason(computeSkipReason: ComputeSkipReason): (b builder.storeUint(0b10, 2); }) + } + if ((computeSkipReason.kind == 'ComputeSkipReason_cskip_suspended')) { + return ((builder: Builder) => { + builder.storeUint(0b110, 3); + }) + } throw new Error(''); } @@ -5998,6 +6207,10 @@ export function loadSmartContractInfo(slice: Slice): SmartContractInfo { let rand_seed: BitString = slice.loadBits(256); let balance_remaining: CurrencyCollection = loadCurrencyCollection(slice); let myself: MsgAddressInt = loadMsgAddressInt(slice); + let global_config: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice + + })); return { kind: 'SmartContractInfo', actions: actions, @@ -6008,6 +6221,7 @@ export function loadSmartContractInfo(slice: Slice): SmartContractInfo { rand_seed: rand_seed, balance_remaining: balance_remaining, myself: myself, + global_config: global_config, } } @@ -6025,6 +6239,12 @@ export function storeSmartContractInfo(smartContractInfo: SmartContractInfo): (b builder.storeBits(smartContractInfo.rand_seed); storeCurrencyCollection(smartContractInfo.balance_remaining)(builder); storeMsgAddressInt(smartContractInfo.myself)(builder); + storeMaybe(smartContractInfo.global_config, ((arg: Slice) => { + return ((builder: Builder) => { + builder.storeSlice(arg); + }) + + }))(builder); }) } @@ -6110,9 +6330,6 @@ export function loadOutAction(slice: Slice): OutAction { slice.loadUint(32); let mode: number = slice.loadUint(7); let libref: LibRef = loadLibRef(slice); - if ((!(mode <= 2))) { - throw new Error(''); - } return { kind: 'OutAction_action_change_library', mode: mode, @@ -6131,7 +6348,7 @@ export function storeOutAction(outAction: OutAction): (builder: Builder) => void let cell1 = beginCell(); storeMessageRelaxed(outAction.out_msg, ((arg: Slice) => { return ((builder: Builder) => { - cell1.storeSlice(arg); + builder.storeSlice(arg); }) }))(cell1); @@ -6161,9 +6378,6 @@ export function storeOutAction(outAction: OutAction): (builder: Builder) => void builder.storeUint(0x26fa1dd4, 32); builder.storeUint(outAction.mode, 7); storeLibRef(outAction.libref)(builder); - if ((!(outAction.mode <= 2))) { - throw new Error(''); - } }) } @@ -6419,15 +6633,6 @@ export function storeShardStateUnsplit(shardStateUnsplit: ShardStateUnsplit): (b } export function loadShardState(slice: Slice): ShardState { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x81e52440))) { - slice.loadUint(32); - let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice); - return { - kind: 'ShardState__', - anon0: anon0, - } - - } if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5f327da5))) { slice.loadUint(32); let slice1 = slice.loadRef().beginParse(); @@ -6440,18 +6645,19 @@ export function loadShardState(slice: Slice): ShardState { right: right, } + } + if (true) { + let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice); + return { + kind: 'ShardState__', + anon0: anon0, + } + } throw new Error(''); } export function storeShardState(shardState: ShardState): (builder: Builder) => void { - if ((shardState.kind == 'ShardState__')) { - return ((builder: Builder) => { - builder.storeUint(0x81e52440, 32); - storeShardStateUnsplit(shardState.anon0)(builder); - }) - - } if ((shardState.kind == 'ShardState_split_state')) { return ((builder: Builder) => { builder.storeUint(0x5f327da5, 32); @@ -6463,6 +6669,12 @@ export function storeShardState(shardState: ShardState): (builder: Builder) => v builder.storeRef(cell2); }) + } + if ((shardState.kind == 'ShardState__')) { + return ((builder: Builder) => { + storeShardStateUnsplit(shardState.anon0)(builder); + }) + } throw new Error(''); } @@ -6673,8 +6885,8 @@ export function loadBlock(slice: Slice): Block { let info: BlockInfo = loadBlockInfo(slice1); let slice2 = slice.loadRef().beginParse(); let value_flow: ValueFlow = loadValueFlow(slice2); - let slice3 = slice.loadRef().beginParse(); - let state_update: MERKLE_UPDATE = loadMERKLE_UPDATE(slice3, loadShardState); + let cell3 = slice.loadRef(); + let state_update = cell3; let slice4 = slice.loadRef().beginParse(); let extra: BlockExtra = loadBlockExtra(slice4); return { @@ -6700,9 +6912,7 @@ export function storeBlock(block: Block): (builder: Builder) => void { let cell2 = beginCell(); storeValueFlow(block.value_flow)(cell2); builder.storeRef(cell2); - let cell3 = beginCell(); - storeMERKLE_UPDATE(block.state_update, storeShardState)(cell3); - builder.storeRef(cell3); + builder.storeRef(block.state_update); let cell4 = beginCell(); storeBlockExtra(block.extra)(cell4); builder.storeRef(cell4); @@ -6711,7 +6921,7 @@ export function storeBlock(block: Block): (builder: Builder) => void { } export function loadBlockExtra(slice: Slice): BlockExtra { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8e7f7ff8))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4a33f6fd))) { slice.loadUint(32); let slice1 = slice.loadRef().beginParse(); let in_msg_descr: InMsgDescr = loadInMsgDescr(slice1); @@ -6742,7 +6952,7 @@ export function loadBlockExtra(slice: Slice): BlockExtra { export function storeBlockExtra(blockExtra: BlockExtra): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x8e7f7ff8, 32); + builder.storeUint(0x4a33f6fd, 32); let cell1 = beginCell(); storeInMsgDescr(blockExtra.in_msg_descr)(cell1); builder.storeRef(cell1); @@ -6768,7 +6978,34 @@ export function storeBlockExtra(blockExtra: BlockExtra): (builder: Builder) => v } export function loadValueFlow(slice: Slice): ValueFlow { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98055e37))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xb8e48dfb))) { + slice.loadUint(32); + let slice1 = slice.loadRef().beginParse(); + let from_prev_blk: CurrencyCollection = loadCurrencyCollection(slice1); + let to_next_blk: CurrencyCollection = loadCurrencyCollection(slice1); + let imported: CurrencyCollection = loadCurrencyCollection(slice1); + let exported: CurrencyCollection = loadCurrencyCollection(slice1); + let fees_collected: CurrencyCollection = loadCurrencyCollection(slice); + let slice2 = slice.loadRef().beginParse(); + let fees_imported: CurrencyCollection = loadCurrencyCollection(slice2); + let recovered: CurrencyCollection = loadCurrencyCollection(slice2); + let created: CurrencyCollection = loadCurrencyCollection(slice2); + let minted: CurrencyCollection = loadCurrencyCollection(slice2); + return { + kind: 'ValueFlow_value_flow', + from_prev_blk: from_prev_blk, + to_next_blk: to_next_blk, + imported: imported, + exported: exported, + fees_collected: fees_collected, + fees_imported: fees_imported, + recovered: recovered, + created: created, + minted: minted, + } + + } + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x3ebf98b7))) { slice.loadUint(32); let slice1 = slice.loadRef().beginParse(); let from_prev_blk: CurrencyCollection = loadCurrencyCollection(slice1); @@ -6776,18 +7013,20 @@ export function loadValueFlow(slice: Slice): ValueFlow { let imported: CurrencyCollection = loadCurrencyCollection(slice1); let exported: CurrencyCollection = loadCurrencyCollection(slice1); let fees_collected: CurrencyCollection = loadCurrencyCollection(slice); + let burned: CurrencyCollection = loadCurrencyCollection(slice); let slice2 = slice.loadRef().beginParse(); let fees_imported: CurrencyCollection = loadCurrencyCollection(slice2); let recovered: CurrencyCollection = loadCurrencyCollection(slice2); let created: CurrencyCollection = loadCurrencyCollection(slice2); let minted: CurrencyCollection = loadCurrencyCollection(slice2); return { - kind: 'ValueFlow', + kind: 'ValueFlow_value_flow_v2', from_prev_blk: from_prev_blk, to_next_blk: to_next_blk, imported: imported, exported: exported, fees_collected: fees_collected, + burned: burned, fees_imported: fees_imported, recovered: recovered, created: created, @@ -6799,23 +7038,46 @@ export function loadValueFlow(slice: Slice): ValueFlow { } export function storeValueFlow(valueFlow: ValueFlow): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0x98055e37, 32); - let cell1 = beginCell(); - storeCurrencyCollection(valueFlow.from_prev_blk)(cell1); - storeCurrencyCollection(valueFlow.to_next_blk)(cell1); - storeCurrencyCollection(valueFlow.imported)(cell1); - storeCurrencyCollection(valueFlow.exported)(cell1); - builder.storeRef(cell1); - storeCurrencyCollection(valueFlow.fees_collected)(builder); - let cell2 = beginCell(); - storeCurrencyCollection(valueFlow.fees_imported)(cell2); - storeCurrencyCollection(valueFlow.recovered)(cell2); - storeCurrencyCollection(valueFlow.created)(cell2); - storeCurrencyCollection(valueFlow.minted)(cell2); - builder.storeRef(cell2); - }) + if ((valueFlow.kind == 'ValueFlow_value_flow')) { + return ((builder: Builder) => { + builder.storeUint(0xb8e48dfb, 32); + let cell1 = beginCell(); + storeCurrencyCollection(valueFlow.from_prev_blk)(cell1); + storeCurrencyCollection(valueFlow.to_next_blk)(cell1); + storeCurrencyCollection(valueFlow.imported)(cell1); + storeCurrencyCollection(valueFlow.exported)(cell1); + builder.storeRef(cell1); + storeCurrencyCollection(valueFlow.fees_collected)(builder); + let cell2 = beginCell(); + storeCurrencyCollection(valueFlow.fees_imported)(cell2); + storeCurrencyCollection(valueFlow.recovered)(cell2); + storeCurrencyCollection(valueFlow.created)(cell2); + storeCurrencyCollection(valueFlow.minted)(cell2); + builder.storeRef(cell2); + }) + + } + if ((valueFlow.kind == 'ValueFlow_value_flow_v2')) { + return ((builder: Builder) => { + builder.storeUint(0x3ebf98b7, 32); + let cell1 = beginCell(); + storeCurrencyCollection(valueFlow.from_prev_blk)(cell1); + storeCurrencyCollection(valueFlow.to_next_blk)(cell1); + storeCurrencyCollection(valueFlow.imported)(cell1); + storeCurrencyCollection(valueFlow.exported)(cell1); + builder.storeRef(cell1); + storeCurrencyCollection(valueFlow.fees_collected)(builder); + storeCurrencyCollection(valueFlow.burned)(builder); + let cell2 = beginCell(); + storeCurrencyCollection(valueFlow.fees_imported)(cell2); + storeCurrencyCollection(valueFlow.recovered)(cell2); + storeCurrencyCollection(valueFlow.created)(cell2); + storeCurrencyCollection(valueFlow.minted)(cell2); + builder.storeRef(cell2); + }) + } + throw new Error(''); } export function loadBinTree(slice: Slice, loadX: (slice: Slice) => X): BinTree { @@ -7090,25 +7352,20 @@ export function storeShardDescr(shardDescr: ShardDescr): (builder: Builder) => v } export function loadShardHashes(slice: Slice): ShardHashes { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd7c80ab1))) { - slice.loadUint(32); - let anon0: HashmapE> = loadHashmapE>(slice, 32, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadBinTree(slice1, loadShardDescr) - - })); - return { - kind: 'ShardHashes', - anon0: anon0, - } + let anon0: HashmapE> = loadHashmapE>(slice, 32, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadBinTree(slice1, loadShardDescr) + })); + return { + kind: 'ShardHashes', + anon0: anon0, } - throw new Error(''); + } export function storeShardHashes(shardHashes: ShardHashes): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xd7c80ab1, 32); storeHashmapE>(shardHashes.anon0, ((arg: BinTree) => { return ((builder: Builder) => { let cell1 = beginCell(); @@ -7178,23 +7435,18 @@ export function storeBinTreeAug(binTreeAug: BinTreeAug, storeX: (x: } export function loadShardFeeCreated(slice: Slice): ShardFeeCreated { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe537952e))) { - slice.loadUint(32); - let fees: CurrencyCollection = loadCurrencyCollection(slice); - let create: CurrencyCollection = loadCurrencyCollection(slice); - return { - kind: 'ShardFeeCreated', - fees: fees, - create: create, - } - + let fees: CurrencyCollection = loadCurrencyCollection(slice); + let create: CurrencyCollection = loadCurrencyCollection(slice); + return { + kind: 'ShardFeeCreated', + fees: fees, + create: create, } - throw new Error(''); + } export function storeShardFeeCreated(shardFeeCreated: ShardFeeCreated): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xe537952e, 32); storeCurrencyCollection(shardFeeCreated.fees)(builder); storeCurrencyCollection(shardFeeCreated.create)(builder); }) @@ -7202,49 +7454,39 @@ export function storeShardFeeCreated(shardFeeCreated: ShardFeeCreated): (builder } export function loadShardFees(slice: Slice): ShardFees { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xfea0d880))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 96, loadShardFeeCreated, loadShardFeeCreated); - return { - kind: 'ShardFees', - anon0: anon0, - } - + let anon0: HashmapAugE = loadHashmapAugE(slice, 96, loadShardFeeCreated, loadShardFeeCreated); + return { + kind: 'ShardFees', + anon0: anon0, } - throw new Error(''); + } export function storeShardFees(shardFees: ShardFees): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xfea0d880, 32); storeHashmapAugE(shardFees.anon0, storeShardFeeCreated, storeShardFeeCreated)(builder); }) } export function loadConfigParams(slice: Slice): ConfigParams { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x88116702))) { - slice.loadUint(32); - let config_addr: BitString = slice.loadBits(256); + let config_addr: BitString = slice.loadBits(256); + let slice1 = slice.loadRef().beginParse(); + let config: Hashmap = loadHashmap(slice1, 32, ((slice: Slice) => { let slice1 = slice.loadRef().beginParse(); - let config: Hashmap = loadHashmap(slice1, 32, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1 - - })); - return { - kind: 'ConfigParams', - config_addr: config_addr, - config: config, - } + return slice1 + })); + return { + kind: 'ConfigParams', + config_addr: config_addr, + config: config, } - throw new Error(''); + } export function storeConfigParams(configParams: ConfigParams): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x88116702, 32); builder.storeBits(configParams.config_addr); let cell1 = beginCell(); storeHashmap(configParams.config, ((arg: Slice) => { @@ -7303,23 +7545,18 @@ export function storeValidatorBaseInfo(validatorBaseInfo: ValidatorBaseInfo): (b } export function loadKeyMaxLt(slice: Slice): KeyMaxLt { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9a6d79a5))) { - slice.loadUint(32); - let key: Bool = loadBool(slice); - let max_end_lt: number = slice.loadUint(64); - return { - kind: 'KeyMaxLt', - key: key, - max_end_lt: max_end_lt, - } - + let key: Bool = loadBool(slice); + let max_end_lt: number = slice.loadUint(64); + return { + kind: 'KeyMaxLt', + key: key, + max_end_lt: max_end_lt, } - throw new Error(''); + } export function storeKeyMaxLt(keyMaxLt: KeyMaxLt): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x9a6d79a5, 32); storeBool(keyMaxLt.key)(builder); builder.storeUint(keyMaxLt.max_end_lt, 64); }) @@ -7327,23 +7564,18 @@ export function storeKeyMaxLt(keyMaxLt: KeyMaxLt): (builder: Builder) => void { } export function loadKeyExtBlkRef(slice: Slice): KeyExtBlkRef { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafeab488))) { - slice.loadUint(32); - let key: Bool = loadBool(slice); - let blk_ref: ExtBlkRef = loadExtBlkRef(slice); - return { - kind: 'KeyExtBlkRef', - key: key, - blk_ref: blk_ref, - } - + let key: Bool = loadBool(slice); + let blk_ref: ExtBlkRef = loadExtBlkRef(slice); + return { + kind: 'KeyExtBlkRef', + key: key, + blk_ref: blk_ref, } - throw new Error(''); + } export function storeKeyExtBlkRef(keyExtBlkRef: KeyExtBlkRef): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xafeab488, 32); storeBool(keyExtBlkRef.key)(builder); storeExtBlkRef(keyExtBlkRef.blk_ref)(builder); }) @@ -7351,21 +7583,16 @@ export function storeKeyExtBlkRef(keyExtBlkRef: KeyExtBlkRef): (builder: Builder } export function loadOldMcBlocksInfo(slice: Slice): OldMcBlocksInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xf385c1e3))) { - slice.loadUint(32); - let anon0: HashmapAugE = loadHashmapAugE(slice, 32, loadKeyExtBlkRef, loadKeyMaxLt); - return { - kind: 'OldMcBlocksInfo', - anon0: anon0, - } - + let anon0: HashmapAugE = loadHashmapAugE(slice, 32, loadKeyExtBlkRef, loadKeyMaxLt); + return { + kind: 'OldMcBlocksInfo', + anon0: anon0, } - throw new Error(''); + } export function storeOldMcBlocksInfo(oldMcBlocksInfo: OldMcBlocksInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xf385c1e3, 32); storeHashmapAugE(oldMcBlocksInfo.anon0, storeKeyExtBlkRef, storeKeyMaxLt)(builder); }) @@ -7564,15 +7791,6 @@ export function storeCryptoSignatureSimple(cryptoSignatureSimple: CryptoSignatur } export function loadCryptoSignature(slice: Slice): CryptoSignature { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdaa99887))) { - slice.loadUint(32); - let anon0: CryptoSignatureSimple = loadCryptoSignatureSimple(slice); - return { - kind: 'CryptoSignature__', - anon0: anon0, - } - - } if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0xf))) { slice.loadUint(4); let slice1 = slice.loadRef().beginParse(); @@ -7584,18 +7802,19 @@ export function loadCryptoSignature(slice: Slice): CryptoSignature { temp_key_signature: temp_key_signature, } + } + if (true) { + let anon0: CryptoSignatureSimple = loadCryptoSignatureSimple(slice); + return { + kind: 'CryptoSignature__', + anon0: anon0, + } + } throw new Error(''); } export function storeCryptoSignature(cryptoSignature: CryptoSignature): (builder: Builder) => void { - if ((cryptoSignature.kind == 'CryptoSignature__')) { - return ((builder: Builder) => { - builder.storeUint(0xdaa99887, 32); - storeCryptoSignatureSimple(cryptoSignature.anon0)(builder); - }) - - } if ((cryptoSignature.kind == 'CryptoSignature_chained_signature')) { return ((builder: Builder) => { builder.storeUint(0xf, 4); @@ -7605,6 +7824,12 @@ export function storeCryptoSignature(cryptoSignature: CryptoSignature): (builder storeCryptoSignatureSimple(cryptoSignature.temp_key_signature)(builder); }) + } + if ((cryptoSignature.kind == 'CryptoSignature__')) { + return ((builder: Builder) => { + storeCryptoSignatureSimple(cryptoSignature.anon0)(builder); + }) + } throw new Error(''); } @@ -7904,8 +8129,7 @@ export function storeValidatorSet(validatorSet: ValidatorSet): (builder: Builder } export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbc7f2648) && (arg0 == 0)))) { - slice.loadUint(32); + if ((arg0 == 0)) { let config_addr: BitString = slice.loadBits(256); return { kind: 'ConfigParam__', @@ -7913,8 +8137,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x84659d0d) && (arg0 == 1)))) { - slice.loadUint(32); + if ((arg0 == 1)) { let elector_addr: BitString = slice.loadBits(256); return { kind: 'ConfigParam__1', @@ -7922,8 +8145,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8648b2c4) && (arg0 == 2)))) { - slice.loadUint(32); + if ((arg0 == 2)) { let minter_addr: BitString = slice.loadBits(256); return { kind: 'ConfigParam__2', @@ -7931,8 +8153,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8a752dc5) && (arg0 == 3)))) { - slice.loadUint(32); + if ((arg0 == 3)) { let fee_collector_addr: BitString = slice.loadBits(256); return { kind: 'ConfigParam__3', @@ -7940,8 +8161,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8ceae93f) && (arg0 == 4)))) { - slice.loadUint(32); + if ((arg0 == 4)) { let dns_root_addr: BitString = slice.loadBits(256); return { kind: 'ConfigParam__4', @@ -7949,97 +8169,95 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb2571db5) && (arg0 == 6)))) { - slice.loadUint(32); + if ((arg0 == 5)) { + let anon0: BurningConfig = loadBurningConfig(slice); + return { + kind: 'ConfigParam__5', + anon0: anon0, + } + + } + if ((arg0 == 6)) { let mint_new_price: Grams = loadGrams(slice); let mint_add_price: Grams = loadGrams(slice); return { - kind: 'ConfigParam__5', + kind: 'ConfigParam__6', mint_new_price: mint_new_price, mint_add_price: mint_add_price, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xd2115c6f) && (arg0 == 7)))) { - slice.loadUint(32); + if ((arg0 == 7)) { let to_mint: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice); return { - kind: 'ConfigParam__6', + kind: 'ConfigParam__7', to_mint: to_mint, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb19d2da6) && (arg0 == 8)))) { - slice.loadUint(32); + if ((arg0 == 8)) { let anon0: GlobalVersion = loadGlobalVersion(slice); return { - kind: 'ConfigParam__7', + kind: 'ConfigParam__8', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f3b81de) && (arg0 == 9)))) { - slice.loadUint(32); + if ((arg0 == 9)) { let mandatory_params: Hashmap = loadHashmap(slice, 32, loadTrue); return { - kind: 'ConfigParam__8', + kind: 'ConfigParam__9', mandatory_params: mandatory_params, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfbcb8998) && (arg0 == 10)))) { - slice.loadUint(32); + if ((arg0 == 10)) { let critical_params: Hashmap = loadHashmap(slice, 32, loadTrue); return { - kind: 'ConfigParam__9', + kind: 'ConfigParam__10', critical_params: critical_params, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9358b12f) && (arg0 == 11)))) { - slice.loadUint(32); + if ((arg0 == 11)) { let anon0: ConfigVotingSetup = loadConfigVotingSetup(slice); return { - kind: 'ConfigParam__10', + kind: 'ConfigParam__11', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9059857d) && (arg0 == 12)))) { - slice.loadUint(32); + if ((arg0 == 12)) { let workchains: HashmapE = loadHashmapE(slice, 32, loadWorkchainDescr); return { - kind: 'ConfigParam__11', + kind: 'ConfigParam__12', workchains: workchains, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8ae7dd3) && (arg0 == 13)))) { - slice.loadUint(32); + if ((arg0 == 13)) { let anon0: ComplaintPricing = loadComplaintPricing(slice); return { - kind: 'ConfigParam__12', + kind: 'ConfigParam__13', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf282db94) && (arg0 == 14)))) { - slice.loadUint(32); + if ((arg0 == 14)) { let anon0: BlockCreateFees = loadBlockCreateFees(slice); return { - kind: 'ConfigParam__13', + kind: 'ConfigParam__14', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xed67ebd2) && (arg0 == 15)))) { - slice.loadUint(32); + if ((arg0 == 15)) { let validators_elected_for: number = slice.loadUint(32); let elections_start_before: number = slice.loadUint(32); let elections_end_before: number = slice.loadUint(32); let stake_held_for: number = slice.loadUint(32); return { - kind: 'ConfigParam__14', + kind: 'ConfigParam__15', validators_elected_for: validators_elected_for, elections_start_before: elections_start_before, elections_end_before: elections_end_before, @@ -8047,8 +8265,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8298d51) && (arg0 == 16)))) { - slice.loadUint(32); + if ((arg0 == 16)) { let max_validators: number = slice.loadUint(16); let max_main_validators: number = slice.loadUint(16); let min_validators: number = slice.loadUint(16); @@ -8062,21 +8279,20 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { throw new Error(''); } return { - kind: 'ConfigParam__15', + kind: 'ConfigParam__16', max_validators: max_validators, max_main_validators: max_main_validators, min_validators: min_validators, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa81c566c) && (arg0 == 17)))) { - slice.loadUint(32); + if ((arg0 == 17)) { let min_stake: Grams = loadGrams(slice); let max_stake: Grams = loadGrams(slice); let min_total_stake: Grams = loadGrams(slice); let max_stake_factor: number = slice.loadUint(32); return { - kind: 'ConfigParam__16', + kind: 'ConfigParam__17', min_stake: min_stake, max_stake: max_stake, min_total_stake: min_total_stake, @@ -8084,185 +8300,218 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xeab9843a) && (arg0 == 18)))) { - slice.loadUint(32); + if ((arg0 == 18)) { let anon0: Hashmap = loadHashmap(slice, 32, loadStoragePrices); return { - kind: 'ConfigParam__17', + kind: 'ConfigParam__18', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf666426a) && (arg0 == 28)))) { - slice.loadUint(32); + if ((arg0 == 19)) { + let global_id: number = slice.loadInt(32); + return { + kind: 'ConfigParam__19', + global_id: global_id, + } + + } + if ((arg0 == 20)) { + let anon0: GasLimitsPrices = loadGasLimitsPrices(slice); + return { + kind: 'ConfigParam_config_mc_gas_prices', + anon0: anon0, + } + + } + if ((arg0 == 21)) { + let anon0: GasLimitsPrices = loadGasLimitsPrices(slice); + return { + kind: 'ConfigParam_config_gas_prices', + anon0: anon0, + } + + } + if ((arg0 == 22)) { + let anon0: BlockLimits = loadBlockLimits(slice); + return { + kind: 'ConfigParam_config_mc_block_limits', + anon0: anon0, + } + + } + if ((arg0 == 23)) { + let anon0: BlockLimits = loadBlockLimits(slice); + return { + kind: 'ConfigParam_config_block_limits', + anon0: anon0, + } + + } + if ((arg0 == 24)) { + let anon0: MsgForwardPrices = loadMsgForwardPrices(slice); + return { + kind: 'ConfigParam_config_mc_fwd_prices', + anon0: anon0, + } + + } + if ((arg0 == 25)) { + let anon0: MsgForwardPrices = loadMsgForwardPrices(slice); + return { + kind: 'ConfigParam_config_fwd_prices', + anon0: anon0, + } + + } + if ((arg0 == 28)) { let anon0: CatchainConfig = loadCatchainConfig(slice); return { - kind: 'ConfigParam__24', + kind: 'ConfigParam__26', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf5b85ad3) && (arg0 == 29)))) { - slice.loadUint(32); + if ((arg0 == 29)) { let anon0: ConsensusConfig = loadConsensusConfig(slice); return { - kind: 'ConfigParam__25', + kind: 'ConfigParam__27', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x849fe3cc) && (arg0 == 31)))) { - slice.loadUint(32); + if ((arg0 == 31)) { let fundamental_smc_addr: HashmapE = loadHashmapE(slice, 256, loadTrue); return { - kind: 'ConfigParam__26', + kind: 'ConfigParam__28', fundamental_smc_addr: fundamental_smc_addr, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xcfc8ceeb) && (arg0 == 32)))) { - slice.loadUint(32); + if ((arg0 == 32)) { let prev_validators: ValidatorSet = loadValidatorSet(slice); return { - kind: 'ConfigParam__27', + kind: 'ConfigParam__29', prev_validators: prev_validators, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xa1a5d63c) && (arg0 == 33)))) { - slice.loadUint(32); + if ((arg0 == 33)) { let prev_temp_validators: ValidatorSet = loadValidatorSet(slice); return { - kind: 'ConfigParam__28', + kind: 'ConfigParam__30', prev_temp_validators: prev_temp_validators, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xfd569be3) && (arg0 == 34)))) { - slice.loadUint(32); + if ((arg0 == 34)) { let cur_validators: ValidatorSet = loadValidatorSet(slice); return { - kind: 'ConfigParam__29', + kind: 'ConfigParam__31', cur_validators: cur_validators, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc271315a) && (arg0 == 35)))) { - slice.loadUint(32); + if ((arg0 == 35)) { let cur_temp_validators: ValidatorSet = loadValidatorSet(slice); return { - kind: 'ConfigParam__30', + kind: 'ConfigParam__32', cur_temp_validators: cur_temp_validators, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x85d02f6c) && (arg0 == 36)))) { - slice.loadUint(32); + if ((arg0 == 36)) { let next_validators: ValidatorSet = loadValidatorSet(slice); return { - kind: 'ConfigParam__31', + kind: 'ConfigParam__33', next_validators: next_validators, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xffa3b0f8) && (arg0 == 37)))) { - slice.loadUint(32); + if ((arg0 == 37)) { let next_temp_validators: ValidatorSet = loadValidatorSet(slice); return { - kind: 'ConfigParam__32', + kind: 'ConfigParam__34', next_temp_validators: next_temp_validators, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x86dfef76) && (arg0 == 39)))) { - slice.loadUint(32); + if ((arg0 == 39)) { let anon0: HashmapE = loadHashmapE(slice, 256, loadValidatorSignedTempKey); return { - kind: 'ConfigParam__33', + kind: 'ConfigParam__35', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8517b916) && (arg0 == 40)))) { - slice.loadUint(32); + if ((arg0 == 40)) { let anon0: MisbehaviourPunishmentConfig = loadMisbehaviourPunishmentConfig(slice); return { - kind: 'ConfigParam__34', + kind: 'ConfigParam__36', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbd424af1) && (arg0 == 71)))) { - slice.loadUint(32); - let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); + if ((arg0 == 43)) { + let anon0: SizeLimitsConfig = loadSizeLimitsConfig(slice); return { - kind: 'ConfigParam__35', + kind: 'ConfigParam__37', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x966f1932) && (arg0 == 72)))) { - slice.loadUint(32); - let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); + if ((arg0 == 44)) { + let anon0: SuspendedAddressList = loadSuspendedAddressList(slice); return { - kind: 'ConfigParam__36', + kind: 'ConfigParam__38', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f742873) && (arg0 == 73)))) { - slice.loadUint(32); + if ((arg0 == 71)) { let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); return { - kind: 'ConfigParam__37', + kind: 'ConfigParam__39', anon0: anon0, } } - if ((arg0 == 20)) { - let anon0: GasLimitsPrices = loadGasLimitsPrices(slice); + if ((arg0 == 72)) { + let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); return { - kind: 'ConfigParam_config_mc_gas_prices', + kind: 'ConfigParam__40', anon0: anon0, } } - if ((arg0 == 21)) { - let anon0: GasLimitsPrices = loadGasLimitsPrices(slice); + if ((arg0 == 73)) { + let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); return { - kind: 'ConfigParam_config_gas_prices', + kind: 'ConfigParam__41', anon0: anon0, } } - if ((arg0 == 22)) { - let anon0: BlockLimits = loadBlockLimits(slice); + if ((arg0 == 79)) { + let anon0: JettonBridgeParams = loadJettonBridgeParams(slice); return { - kind: 'ConfigParam_config_mc_block_limits', + kind: 'ConfigParam__42', anon0: anon0, } } - if ((arg0 == 23)) { - let anon0: BlockLimits = loadBlockLimits(slice); + if ((arg0 == 81)) { + let anon0: JettonBridgeParams = loadJettonBridgeParams(slice); return { - kind: 'ConfigParam_config_block_limits', + kind: 'ConfigParam__43', anon0: anon0, } } - if ((arg0 == 24)) { - let anon0: MsgForwardPrices = loadMsgForwardPrices(slice); + if ((arg0 == 82)) { + let anon0: JettonBridgeParams = loadJettonBridgeParams(slice); return { - kind: 'ConfigParam_config_mc_fwd_prices', - anon0: anon0, - } - - } - if ((arg0 == 25)) { - let anon0: MsgForwardPrices = loadMsgForwardPrices(slice); - return { - kind: 'ConfigParam_config_fwd_prices', + kind: 'ConfigParam__44', anon0: anon0, } @@ -8273,106 +8522,97 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { export function storeConfigParam(configParam: ConfigParam): (builder: Builder) => void { if ((configParam.kind == 'ConfigParam__')) { return ((builder: Builder) => { - builder.storeUint(0xbc7f2648, 32); builder.storeBits(configParam.config_addr); }) } if ((configParam.kind == 'ConfigParam__1')) { return ((builder: Builder) => { - builder.storeUint(0x84659d0d, 32); builder.storeBits(configParam.elector_addr); }) } if ((configParam.kind == 'ConfigParam__2')) { return ((builder: Builder) => { - builder.storeUint(0x8648b2c4, 32); builder.storeBits(configParam.minter_addr); }) } if ((configParam.kind == 'ConfigParam__3')) { return ((builder: Builder) => { - builder.storeUint(0x8a752dc5, 32); builder.storeBits(configParam.fee_collector_addr); }) } if ((configParam.kind == 'ConfigParam__4')) { return ((builder: Builder) => { - builder.storeUint(0x8ceae93f, 32); builder.storeBits(configParam.dns_root_addr); }) } if ((configParam.kind == 'ConfigParam__5')) { return ((builder: Builder) => { - builder.storeUint(0xb2571db5, 32); + storeBurningConfig(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam__6')) { + return ((builder: Builder) => { storeGrams(configParam.mint_new_price)(builder); storeGrams(configParam.mint_add_price)(builder); }) } - if ((configParam.kind == 'ConfigParam__6')) { + if ((configParam.kind == 'ConfigParam__7')) { return ((builder: Builder) => { - builder.storeUint(0xd2115c6f, 32); storeExtraCurrencyCollection(configParam.to_mint)(builder); }) } - if ((configParam.kind == 'ConfigParam__7')) { + if ((configParam.kind == 'ConfigParam__8')) { return ((builder: Builder) => { - builder.storeUint(0xb19d2da6, 32); storeGlobalVersion(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__8')) { + if ((configParam.kind == 'ConfigParam__9')) { return ((builder: Builder) => { - builder.storeUint(0x8f3b81de, 32); storeHashmap(configParam.mandatory_params, storeTrue)(builder); }) } - if ((configParam.kind == 'ConfigParam__9')) { + if ((configParam.kind == 'ConfigParam__10')) { return ((builder: Builder) => { - builder.storeUint(0xfbcb8998, 32); storeHashmap(configParam.critical_params, storeTrue)(builder); }) } - if ((configParam.kind == 'ConfigParam__10')) { + if ((configParam.kind == 'ConfigParam__11')) { return ((builder: Builder) => { - builder.storeUint(0x9358b12f, 32); storeConfigVotingSetup(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__11')) { + if ((configParam.kind == 'ConfigParam__12')) { return ((builder: Builder) => { - builder.storeUint(0x9059857d, 32); storeHashmapE(configParam.workchains, storeWorkchainDescr)(builder); }) } - if ((configParam.kind == 'ConfigParam__12')) { + if ((configParam.kind == 'ConfigParam__13')) { return ((builder: Builder) => { - builder.storeUint(0xe8ae7dd3, 32); storeComplaintPricing(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__13')) { + if ((configParam.kind == 'ConfigParam__14')) { return ((builder: Builder) => { - builder.storeUint(0xf282db94, 32); storeBlockCreateFees(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__14')) { + if ((configParam.kind == 'ConfigParam__15')) { return ((builder: Builder) => { - builder.storeUint(0xed67ebd2, 32); builder.storeUint(configParam.validators_elected_for, 32); builder.storeUint(configParam.elections_start_before, 32); builder.storeUint(configParam.elections_end_before, 32); @@ -8380,9 +8620,8 @@ export function storeConfigParam(configParam: ConfigParam): (builder: Builder) = }) } - if ((configParam.kind == 'ConfigParam__15')) { + if ((configParam.kind == 'ConfigParam__16')) { return ((builder: Builder) => { - builder.storeUint(0xe8298d51, 32); builder.storeUint(configParam.max_validators, 16); builder.storeUint(configParam.max_main_validators, 16); builder.storeUint(configParam.min_validators, 16); @@ -8398,9 +8637,8 @@ export function storeConfigParam(configParam: ConfigParam): (builder: Builder) = }) } - if ((configParam.kind == 'ConfigParam__16')) { + if ((configParam.kind == 'ConfigParam__17')) { return ((builder: Builder) => { - builder.storeUint(0xa81c566c, 32); storeGrams(configParam.min_stake)(builder); storeGrams(configParam.max_stake)(builder); storeGrams(configParam.min_total_stake)(builder); @@ -8408,150 +8646,218 @@ export function storeConfigParam(configParam: ConfigParam): (builder: Builder) = }) } - if ((configParam.kind == 'ConfigParam__17')) { + if ((configParam.kind == 'ConfigParam__18')) { return ((builder: Builder) => { - builder.storeUint(0xeab9843a, 32); storeHashmap(configParam.anon0, storeStoragePrices)(builder); }) } - if ((configParam.kind == 'ConfigParam__24')) { + if ((configParam.kind == 'ConfigParam__19')) { return ((builder: Builder) => { - builder.storeUint(0xf666426a, 32); - storeCatchainConfig(configParam.anon0)(builder); + builder.storeInt(configParam.global_id, 32); }) } - if ((configParam.kind == 'ConfigParam__25')) { + if ((configParam.kind == 'ConfigParam_config_mc_gas_prices')) { return ((builder: Builder) => { - builder.storeUint(0xf5b85ad3, 32); - storeConsensusConfig(configParam.anon0)(builder); + storeGasLimitsPrices(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam_config_gas_prices')) { + return ((builder: Builder) => { + storeGasLimitsPrices(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam_config_mc_block_limits')) { + return ((builder: Builder) => { + storeBlockLimits(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam_config_block_limits')) { + return ((builder: Builder) => { + storeBlockLimits(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam_config_mc_fwd_prices')) { + return ((builder: Builder) => { + storeMsgForwardPrices(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam_config_fwd_prices')) { + return ((builder: Builder) => { + storeMsgForwardPrices(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__26')) { return ((builder: Builder) => { - builder.storeUint(0x849fe3cc, 32); - storeHashmapE(configParam.fundamental_smc_addr, storeTrue)(builder); + storeCatchainConfig(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__27')) { return ((builder: Builder) => { - builder.storeUint(0xcfc8ceeb, 32); - storeValidatorSet(configParam.prev_validators)(builder); + storeConsensusConfig(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__28')) { return ((builder: Builder) => { - builder.storeUint(0xa1a5d63c, 32); - storeValidatorSet(configParam.prev_temp_validators)(builder); + storeHashmapE(configParam.fundamental_smc_addr, storeTrue)(builder); }) } if ((configParam.kind == 'ConfigParam__29')) { return ((builder: Builder) => { - builder.storeUint(0xfd569be3, 32); - storeValidatorSet(configParam.cur_validators)(builder); + storeValidatorSet(configParam.prev_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__30')) { return ((builder: Builder) => { - builder.storeUint(0xc271315a, 32); - storeValidatorSet(configParam.cur_temp_validators)(builder); + storeValidatorSet(configParam.prev_temp_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__31')) { return ((builder: Builder) => { - builder.storeUint(0x85d02f6c, 32); - storeValidatorSet(configParam.next_validators)(builder); + storeValidatorSet(configParam.cur_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__32')) { return ((builder: Builder) => { - builder.storeUint(0xffa3b0f8, 32); - storeValidatorSet(configParam.next_temp_validators)(builder); + storeValidatorSet(configParam.cur_temp_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__33')) { return ((builder: Builder) => { - builder.storeUint(0x86dfef76, 32); - storeHashmapE(configParam.anon0, storeValidatorSignedTempKey)(builder); + storeValidatorSet(configParam.next_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__34')) { return ((builder: Builder) => { - builder.storeUint(0x8517b916, 32); - storeMisbehaviourPunishmentConfig(configParam.anon0)(builder); + storeValidatorSet(configParam.next_temp_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__35')) { return ((builder: Builder) => { - builder.storeUint(0xbd424af1, 32); - storeOracleBridgeParams(configParam.anon0)(builder); + storeHashmapE(configParam.anon0, storeValidatorSignedTempKey)(builder); }) } if ((configParam.kind == 'ConfigParam__36')) { return ((builder: Builder) => { - builder.storeUint(0x966f1932, 32); - storeOracleBridgeParams(configParam.anon0)(builder); + storeMisbehaviourPunishmentConfig(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__37')) { return ((builder: Builder) => { - builder.storeUint(0x8f742873, 32); + storeSizeLimitsConfig(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam__38')) { + return ((builder: Builder) => { + storeSuspendedAddressList(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam__39')) { + return ((builder: Builder) => { storeOracleBridgeParams(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam_config_mc_gas_prices')) { + if ((configParam.kind == 'ConfigParam__40')) { return ((builder: Builder) => { - storeGasLimitsPrices(configParam.anon0)(builder); + storeOracleBridgeParams(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam_config_gas_prices')) { + if ((configParam.kind == 'ConfigParam__41')) { return ((builder: Builder) => { - storeGasLimitsPrices(configParam.anon0)(builder); + storeOracleBridgeParams(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam_config_mc_block_limits')) { + if ((configParam.kind == 'ConfigParam__42')) { return ((builder: Builder) => { - storeBlockLimits(configParam.anon0)(builder); + storeJettonBridgeParams(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam_config_block_limits')) { + if ((configParam.kind == 'ConfigParam__43')) { return ((builder: Builder) => { - storeBlockLimits(configParam.anon0)(builder); + storeJettonBridgeParams(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam_config_mc_fwd_prices')) { + if ((configParam.kind == 'ConfigParam__44')) { return ((builder: Builder) => { - storeMsgForwardPrices(configParam.anon0)(builder); + storeJettonBridgeParams(configParam.anon0)(builder); }) - } - if ((configParam.kind == 'ConfigParam_config_fwd_prices')) { - return ((builder: Builder) => { - storeMsgForwardPrices(configParam.anon0)(builder); - }) + } + throw new Error(''); +} + +export function loadBurningConfig(slice: Slice): BurningConfig { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { + slice.loadUint(8); + let blackhole_addr: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadBits(256) + + })); + let fee_burn_num: number = slice.loadUint(32); + let fee_burn_denom: number = slice.loadUint(32); + if ((!(fee_burn_num <= fee_burn_denom))) { + throw new Error(''); + } + if ((!(fee_burn_denom >= 1))) { + throw new Error(''); + } + return { + kind: 'BurningConfig', + blackhole_addr: blackhole_addr, + fee_burn_num: fee_burn_num, + fee_burn_denom: fee_burn_denom, + } } throw new Error(''); } +export function storeBurningConfig(burningConfig: BurningConfig): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x01, 8); + storeMaybe(burningConfig.blackhole_addr, ((arg: BitString) => { + return ((builder: Builder) => { + builder.storeBits(arg); + }) + + }))(builder); + builder.storeUint(burningConfig.fee_burn_num, 32); + builder.storeUint(burningConfig.fee_burn_denom, 32); + if ((!(burningConfig.fee_burn_num <= burningConfig.fee_burn_denom))) { + throw new Error(''); + } + if ((!(burningConfig.fee_burn_denom >= 1))) { + throw new Error(''); + } + }) + +} + export function loadGlobalVersion(slice: Slice): GlobalVersion { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xc4))) { slice.loadUint(8); @@ -8825,6 +9131,36 @@ export function storeWorkchainFormat(workchainFormat: WorkchainFormat): (builder throw new Error(''); } +export function loadWcSplitMergeTimings(slice: Slice): WcSplitMergeTimings { + if (((slice.remainingBits >= 4) && (slice.preloadUint(4) == 0x0))) { + slice.loadUint(4); + let split_merge_delay: number = slice.loadUint(32); + let split_merge_interval: number = slice.loadUint(32); + let min_split_merge_interval: number = slice.loadUint(32); + let max_split_merge_delay: number = slice.loadUint(32); + return { + kind: 'WcSplitMergeTimings', + split_merge_delay: split_merge_delay, + split_merge_interval: split_merge_interval, + min_split_merge_interval: min_split_merge_interval, + max_split_merge_delay: max_split_merge_delay, + } + + } + throw new Error(''); +} + +export function storeWcSplitMergeTimings(wcSplitMergeTimings: WcSplitMergeTimings): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x0, 4); + builder.storeUint(wcSplitMergeTimings.split_merge_delay, 32); + builder.storeUint(wcSplitMergeTimings.split_merge_interval, 32); + builder.storeUint(wcSplitMergeTimings.min_split_merge_interval, 32); + builder.storeUint(wcSplitMergeTimings.max_split_merge_delay, 32); + }) + +} + export function loadWorkchainDescr(slice: Slice): WorkchainDescr { if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xa6))) { slice.loadUint(8); @@ -8847,7 +9183,7 @@ export function loadWorkchainDescr(slice: Slice): WorkchainDescr { throw new Error(''); } return { - kind: 'WorkchainDescr', + kind: 'WorkchainDescr_workchain', enabled_since: enabled_since, actual_min_split: actual_min_split, min_split: min_split, @@ -8863,32 +9199,99 @@ export function loadWorkchainDescr(slice: Slice): WorkchainDescr { } } - throw new Error(''); -} - -export function storeWorkchainDescr(workchainDescr: WorkchainDescr): (builder: Builder) => void { - return ((builder: Builder) => { - builder.storeUint(0xa6, 8); - builder.storeUint(workchainDescr.enabled_since, 32); - builder.storeUint(workchainDescr.actual_min_split, 8); - builder.storeUint(workchainDescr.min_split, 8); - builder.storeUint(workchainDescr.max_split, 8); - builder.storeUint(workchainDescr.basic, 1); - storeBool(workchainDescr.active)(builder); - storeBool(workchainDescr.accept_msgs)(builder); - builder.storeUint(workchainDescr.flags, 13); - builder.storeBits(workchainDescr.zerostate_root_hash); - builder.storeBits(workchainDescr.zerostate_file_hash); - builder.storeUint(workchainDescr.version, 32); - storeWorkchainFormat(workchainDescr.format)(builder); - if ((!(workchainDescr.actual_min_split <= workchainDescr.min_split))) { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0xa7))) { + slice.loadUint(8); + let enabled_since: number = slice.loadUint(32); + let actual_min_split: number = slice.loadUint(8); + let min_split: number = slice.loadUint(8); + let max_split: number = slice.loadUint(8); + let basic: number = slice.loadUint(1); + let active: Bool = loadBool(slice); + let accept_msgs: Bool = loadBool(slice); + let flags: number = slice.loadUint(13); + let zerostate_root_hash: BitString = slice.loadBits(256); + let zerostate_file_hash: BitString = slice.loadBits(256); + let version: number = slice.loadUint(32); + let format: WorkchainFormat = loadWorkchainFormat(slice, basic); + let split_merge_timings: WcSplitMergeTimings = loadWcSplitMergeTimings(slice); + if ((!(actual_min_split <= min_split))) { throw new Error(''); } - if ((!(workchainDescr.flags == 0))) { + if ((!(flags == 0))) { throw new Error(''); } - }) + return { + kind: 'WorkchainDescr_workchain_v2', + enabled_since: enabled_since, + actual_min_split: actual_min_split, + min_split: min_split, + max_split: max_split, + basic: basic, + active: active, + accept_msgs: accept_msgs, + flags: flags, + zerostate_root_hash: zerostate_root_hash, + zerostate_file_hash: zerostate_file_hash, + version: version, + format: format, + split_merge_timings: split_merge_timings, + } + + } + throw new Error(''); +} + +export function storeWorkchainDescr(workchainDescr: WorkchainDescr): (builder: Builder) => void { + if ((workchainDescr.kind == 'WorkchainDescr_workchain')) { + return ((builder: Builder) => { + builder.storeUint(0xa6, 8); + builder.storeUint(workchainDescr.enabled_since, 32); + builder.storeUint(workchainDescr.actual_min_split, 8); + builder.storeUint(workchainDescr.min_split, 8); + builder.storeUint(workchainDescr.max_split, 8); + builder.storeUint(workchainDescr.basic, 1); + storeBool(workchainDescr.active)(builder); + storeBool(workchainDescr.accept_msgs)(builder); + builder.storeUint(workchainDescr.flags, 13); + builder.storeBits(workchainDescr.zerostate_root_hash); + builder.storeBits(workchainDescr.zerostate_file_hash); + builder.storeUint(workchainDescr.version, 32); + storeWorkchainFormat(workchainDescr.format)(builder); + if ((!(workchainDescr.actual_min_split <= workchainDescr.min_split))) { + throw new Error(''); + } + if ((!(workchainDescr.flags == 0))) { + throw new Error(''); + } + }) + + } + if ((workchainDescr.kind == 'WorkchainDescr_workchain_v2')) { + return ((builder: Builder) => { + builder.storeUint(0xa7, 8); + builder.storeUint(workchainDescr.enabled_since, 32); + builder.storeUint(workchainDescr.actual_min_split, 8); + builder.storeUint(workchainDescr.min_split, 8); + builder.storeUint(workchainDescr.max_split, 8); + builder.storeUint(workchainDescr.basic, 1); + storeBool(workchainDescr.active)(builder); + storeBool(workchainDescr.accept_msgs)(builder); + builder.storeUint(workchainDescr.flags, 13); + builder.storeBits(workchainDescr.zerostate_root_hash); + builder.storeBits(workchainDescr.zerostate_file_hash); + builder.storeUint(workchainDescr.version, 32); + storeWorkchainFormat(workchainDescr.format)(builder); + storeWcSplitMergeTimings(workchainDescr.split_merge_timings)(builder); + if ((!(workchainDescr.actual_min_split <= workchainDescr.min_split))) { + throw new Error(''); + } + if ((!(workchainDescr.flags == 0))) { + throw new Error(''); + } + }) + } + throw new Error(''); } export function loadComplaintPricing(slice: Slice): ComplaintPricing { @@ -9575,6 +9978,109 @@ export function storeMisbehaviourPunishmentConfig(misbehaviourPunishmentConfig: } +export function loadSizeLimitsConfig(slice: Slice): SizeLimitsConfig { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { + slice.loadUint(8); + let max_msg_bits: number = slice.loadUint(32); + let max_msg_cells: number = slice.loadUint(32); + let max_library_cells: number = slice.loadUint(32); + let max_vm_data_depth: number = slice.loadUint(16); + let max_ext_msg_size: number = slice.loadUint(32); + let max_ext_msg_depth: number = slice.loadUint(16); + return { + kind: 'SizeLimitsConfig_size_limits_config', + max_msg_bits: max_msg_bits, + max_msg_cells: max_msg_cells, + max_library_cells: max_library_cells, + max_vm_data_depth: max_vm_data_depth, + max_ext_msg_size: max_ext_msg_size, + max_ext_msg_depth: max_ext_msg_depth, + } + + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x02))) { + slice.loadUint(8); + let max_msg_bits: number = slice.loadUint(32); + let max_msg_cells: number = slice.loadUint(32); + let max_library_cells: number = slice.loadUint(32); + let max_vm_data_depth: number = slice.loadUint(16); + let max_ext_msg_size: number = slice.loadUint(32); + let max_ext_msg_depth: number = slice.loadUint(16); + let max_acc_state_cells: number = slice.loadUint(32); + let max_acc_state_bits: number = slice.loadUint(32); + let max_acc_public_libraries: number = slice.loadUint(32); + return { + kind: 'SizeLimitsConfig_size_limits_config_v2', + max_msg_bits: max_msg_bits, + max_msg_cells: max_msg_cells, + max_library_cells: max_library_cells, + max_vm_data_depth: max_vm_data_depth, + max_ext_msg_size: max_ext_msg_size, + max_ext_msg_depth: max_ext_msg_depth, + max_acc_state_cells: max_acc_state_cells, + max_acc_state_bits: max_acc_state_bits, + max_acc_public_libraries: max_acc_public_libraries, + } + + } + throw new Error(''); +} + +export function storeSizeLimitsConfig(sizeLimitsConfig: SizeLimitsConfig): (builder: Builder) => void { + if ((sizeLimitsConfig.kind == 'SizeLimitsConfig_size_limits_config')) { + return ((builder: Builder) => { + builder.storeUint(0x01, 8); + builder.storeUint(sizeLimitsConfig.max_msg_bits, 32); + builder.storeUint(sizeLimitsConfig.max_msg_cells, 32); + builder.storeUint(sizeLimitsConfig.max_library_cells, 32); + builder.storeUint(sizeLimitsConfig.max_vm_data_depth, 16); + builder.storeUint(sizeLimitsConfig.max_ext_msg_size, 32); + builder.storeUint(sizeLimitsConfig.max_ext_msg_depth, 16); + }) + + } + if ((sizeLimitsConfig.kind == 'SizeLimitsConfig_size_limits_config_v2')) { + return ((builder: Builder) => { + builder.storeUint(0x02, 8); + builder.storeUint(sizeLimitsConfig.max_msg_bits, 32); + builder.storeUint(sizeLimitsConfig.max_msg_cells, 32); + builder.storeUint(sizeLimitsConfig.max_library_cells, 32); + builder.storeUint(sizeLimitsConfig.max_vm_data_depth, 16); + builder.storeUint(sizeLimitsConfig.max_ext_msg_size, 32); + builder.storeUint(sizeLimitsConfig.max_ext_msg_depth, 16); + builder.storeUint(sizeLimitsConfig.max_acc_state_cells, 32); + builder.storeUint(sizeLimitsConfig.max_acc_state_bits, 32); + builder.storeUint(sizeLimitsConfig.max_acc_public_libraries, 32); + }) + + } + throw new Error(''); +} + +export function loadSuspendedAddressList(slice: Slice): SuspendedAddressList { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x00))) { + slice.loadUint(8); + let addresses: HashmapE = loadHashmapE(slice, 288, loadUnit); + let suspended_until: number = slice.loadUint(32); + return { + kind: 'SuspendedAddressList', + addresses: addresses, + suspended_until: suspended_until, + } + + } + throw new Error(''); +} + +export function storeSuspendedAddressList(suspendedAddressList: SuspendedAddressList): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x00, 8); + storeHashmapE(suspendedAddressList.addresses, storeUnit)(builder); + builder.storeUint(suspendedAddressList.suspended_until, 32); + }) + +} + export function loadOracleBridgeParams(slice: Slice): OracleBridgeParams { let bridge_address: BitString = slice.loadBits(256); let oracle_mutlisig_address: BitString = slice.loadBits(256); @@ -9608,6 +10114,123 @@ export function storeOracleBridgeParams(oracleBridgeParams: OracleBridgeParams): } +export function loadJettonBridgePrices(slice: Slice): JettonBridgePrices { + let bridge_burn_fee: Coins = loadCoins(slice); + let bridge_mint_fee: Coins = loadCoins(slice); + let wallet_min_tons_for_storage: Coins = loadCoins(slice); + let wallet_gas_consumption: Coins = loadCoins(slice); + let minter_min_tons_for_storage: Coins = loadCoins(slice); + let discover_gas_consumption: Coins = loadCoins(slice); + return { + kind: 'JettonBridgePrices', + bridge_burn_fee: bridge_burn_fee, + bridge_mint_fee: bridge_mint_fee, + wallet_min_tons_for_storage: wallet_min_tons_for_storage, + wallet_gas_consumption: wallet_gas_consumption, + minter_min_tons_for_storage: minter_min_tons_for_storage, + discover_gas_consumption: discover_gas_consumption, + } + +} + +export function storeJettonBridgePrices(jettonBridgePrices: JettonBridgePrices): (builder: Builder) => void { + return ((builder: Builder) => { + storeCoins(jettonBridgePrices.bridge_burn_fee)(builder); + storeCoins(jettonBridgePrices.bridge_mint_fee)(builder); + storeCoins(jettonBridgePrices.wallet_min_tons_for_storage)(builder); + storeCoins(jettonBridgePrices.wallet_gas_consumption)(builder); + storeCoins(jettonBridgePrices.minter_min_tons_for_storage)(builder); + storeCoins(jettonBridgePrices.discover_gas_consumption)(builder); + }) + +} + +export function loadJettonBridgeParams(slice: Slice): JettonBridgeParams { + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x00))) { + slice.loadUint(8); + let bridge_address: BitString = slice.loadBits(256); + let oracles_address: BitString = slice.loadBits(256); + let oracles: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { + return slice.loadUint(256) + + })); + let state_flags: number = slice.loadUint(8); + let burn_bridge_fee: Coins = loadCoins(slice); + return { + kind: 'JettonBridgeParams_jetton_bridge_params_v0', + bridge_address: bridge_address, + oracles_address: oracles_address, + oracles: oracles, + state_flags: state_flags, + burn_bridge_fee: burn_bridge_fee, + } + + } + if (((slice.remainingBits >= 8) && (slice.preloadUint(8) == 0x01))) { + slice.loadUint(8); + let bridge_address: BitString = slice.loadBits(256); + let oracles_address: BitString = slice.loadBits(256); + let oracles: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { + return slice.loadUint(256) + + })); + let state_flags: number = slice.loadUint(8); + let slice1 = slice.loadRef().beginParse(); + let prices: JettonBridgePrices = loadJettonBridgePrices(slice1); + let external_chain_address: BitString = slice.loadBits(256); + return { + kind: 'JettonBridgeParams_jetton_bridge_params_v1', + bridge_address: bridge_address, + oracles_address: oracles_address, + oracles: oracles, + state_flags: state_flags, + prices: prices, + external_chain_address: external_chain_address, + } + + } + throw new Error(''); +} + +export function storeJettonBridgeParams(jettonBridgeParams: JettonBridgeParams): (builder: Builder) => void { + if ((jettonBridgeParams.kind == 'JettonBridgeParams_jetton_bridge_params_v0')) { + return ((builder: Builder) => { + builder.storeUint(0x00, 8); + builder.storeBits(jettonBridgeParams.bridge_address); + builder.storeBits(jettonBridgeParams.oracles_address); + storeHashmapE(jettonBridgeParams.oracles, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 256); + }) + + }))(builder); + builder.storeUint(jettonBridgeParams.state_flags, 8); + storeCoins(jettonBridgeParams.burn_bridge_fee)(builder); + }) + + } + if ((jettonBridgeParams.kind == 'JettonBridgeParams_jetton_bridge_params_v1')) { + return ((builder: Builder) => { + builder.storeUint(0x01, 8); + builder.storeBits(jettonBridgeParams.bridge_address); + builder.storeBits(jettonBridgeParams.oracles_address); + storeHashmapE(jettonBridgeParams.oracles, ((arg: number) => { + return ((builder: Builder) => { + builder.storeUint(arg, 256); + }) + + }))(builder); + builder.storeUint(jettonBridgeParams.state_flags, 8); + let cell1 = beginCell(); + storeJettonBridgePrices(jettonBridgeParams.prices)(cell1); + builder.storeRef(cell1); + builder.storeBits(jettonBridgeParams.external_chain_address); + }) + + } + throw new Error(''); +} + export function loadBlockSignaturesPure(slice: Slice): BlockSignaturesPure { let sig_count: number = slice.loadUint(32); let sig_weight: number = slice.loadUint(64); @@ -9869,7 +10492,7 @@ export function storeProducerInfo(producerInfo: ProducerInfo): (builder: Builder } export function loadComplaintDescr(slice: Slice): ComplaintDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c436252))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x450e8bd9))) { slice.loadUint(32); let from_utime: number = slice.loadUint(32); let slice1 = slice.loadRef().beginParse(); @@ -9881,7 +10504,7 @@ export function loadComplaintDescr(slice: Slice): ComplaintDescr { } } - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x987f1ab7))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4737b0ca))) { slice.loadUint(32); let slice1 = slice.loadRef().beginParse(); let prod_info_old: ProducerInfo = loadProducerInfo(slice1); @@ -9900,7 +10523,7 @@ export function loadComplaintDescr(slice: Slice): ComplaintDescr { export function storeComplaintDescr(complaintDescr: ComplaintDescr): (builder: Builder) => void { if ((complaintDescr.kind == 'ComplaintDescr_no_blk_gen')) { return ((builder: Builder) => { - builder.storeUint(0x9c436252, 32); + builder.storeUint(0x450e8bd9, 32); builder.storeUint(complaintDescr.from_utime, 32); let cell1 = beginCell(); storeProducerInfo(complaintDescr.prod_info)(cell1); @@ -9910,7 +10533,7 @@ export function storeComplaintDescr(complaintDescr: ComplaintDescr): (builder: B } if ((complaintDescr.kind == 'ComplaintDescr_no_blk_gen_diff')) { return ((builder: Builder) => { - builder.storeUint(0x987f1ab7, 32); + builder.storeUint(0x4737b0ca, 32); let cell1 = beginCell(); storeProducerInfo(complaintDescr.prod_info_old)(cell1); builder.storeRef(cell1); @@ -10157,36 +10780,31 @@ export function storeVmStackValue(vmStackValue: VmStackValue): (builder: Builder } export function loadVmCellSlice(slice: Slice): VmCellSlice { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6a63245))) { - slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let _cell: Slice = slice1; - let st_bits: number = slice.loadUint(10); - let end_bits: number = slice.loadUint(10); - let st_ref: number = slice.loadUint(bitLen(4)); - let end_ref: number = slice.loadUint(bitLen(4)); - if ((!(st_bits <= end_bits))) { - throw new Error(''); - } - if ((!(st_ref <= end_ref))) { - throw new Error(''); - } - return { - kind: 'VmCellSlice', - _cell: _cell, - st_bits: st_bits, - end_bits: end_bits, - st_ref: st_ref, - end_ref: end_ref, - } - + let slice1 = slice.loadRef().beginParse(); + let _cell: Slice = slice1; + let st_bits: number = slice.loadUint(10); + let end_bits: number = slice.loadUint(10); + let st_ref: number = slice.loadUint(bitLen(4)); + let end_ref: number = slice.loadUint(bitLen(4)); + if ((!(st_bits <= end_bits))) { + throw new Error(''); } - throw new Error(''); + if ((!(st_ref <= end_ref))) { + throw new Error(''); + } + return { + kind: 'VmCellSlice', + _cell: _cell, + st_bits: st_bits, + end_bits: end_bits, + st_ref: st_ref, + end_ref: end_ref, + } + } export function storeVmCellSlice(vmCellSlice: VmCellSlice): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xd6a63245, 32); let cell1 = beginCell(); cell1.storeSlice(vmCellSlice._cell); builder.storeRef(cell1); @@ -10358,21 +10976,16 @@ export function storeVmStackList(vmStackList: VmStackList): (builder: Builder) = } export function loadVmSaveList(slice: Slice): VmSaveList { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xeed28f11))) { - slice.loadUint(32); - let cregs: HashmapE = loadHashmapE(slice, 4, loadVmStackValue); - return { - kind: 'VmSaveList', - cregs: cregs, - } - + let cregs: HashmapE = loadHashmapE(slice, 4, loadVmStackValue); + return { + kind: 'VmSaveList', + cregs: cregs, } - throw new Error(''); + } export function storeVmSaveList(vmSaveList: VmSaveList): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xeed28f11, 32); storeHashmapE(vmSaveList.cregs, storeVmStackValue)(builder); }) @@ -10407,25 +11020,20 @@ export function storeVmGasLimits(vmGasLimits: VmGasLimits): (builder: Builder) = } export function loadVmLibraries(slice: Slice): VmLibraries { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe9be85ef))) { - slice.loadUint(32); - let libraries: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return slice1 - - })); - return { - kind: 'VmLibraries', - libraries: libraries, - } + let libraries: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 + })); + return { + kind: 'VmLibraries', + libraries: libraries, } - throw new Error(''); + } export function storeVmLibraries(vmLibraries: VmLibraries): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xe9be85ef, 32); storeHashmapE(vmLibraries.libraries, ((arg: Slice) => { return ((builder: Builder) => { let cell1 = beginCell(); @@ -10715,22 +11323,29 @@ export function storeVmCont(vmCont: VmCont): (builder: Builder) => void { } export function loadDNS_RecordSet(slice: Slice): DNS_RecordSet { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafbffed3))) { - slice.loadUint(32); - let anon0: HashmapE = loadHashmapE(slice, 256, loadDNSRecord); - return { - kind: 'DNS_RecordSet', - anon0: anon0, - } + let anon0: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadDNSRecord(slice1) + })); + return { + kind: 'DNS_RecordSet', + anon0: anon0, } - throw new Error(''); + } export function storeDNS_RecordSet(dNS_RecordSet: DNS_RecordSet): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xafbffed3, 32); - storeHashmapE(dNS_RecordSet.anon0, storeDNSRecord)(builder); + storeHashmapE(dNS_RecordSet.anon0, ((arg: DNSRecord) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeDNSRecord(arg)(cell1); + builder.storeRef(cell1); + + }) + + }))(builder); }) } @@ -10881,6 +11496,15 @@ export function loadDNSRecord(slice: Slice): DNSRecord { cap_list: cap_list, } + } + if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0x7473))) { + slice.loadUint(16); + let bag_id: BitString = slice.loadBits(256); + return { + kind: 'DNSRecord_dns_storage_address', + bag_id: bag_id, + } + } throw new Error(''); } @@ -10927,6 +11551,13 @@ export function storeDNSRecord(dNSRecord: DNSRecord): (builder: Builder) => void } }) + } + if ((dNSRecord.kind == 'DNSRecord_dns_storage_address')) { + return ((builder: Builder) => { + builder.storeUint(0x7473, 16); + builder.storeBits(dNSRecord.bag_id); + }) + } throw new Error(''); } diff --git a/generated_test.ts b/generated_test.ts index 0bd6d11..1bd3394 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -2,6 +2,7 @@ import { Builder } from 'ton' import { Slice } from 'ton' import { beginCell } from 'ton' import { BitString } from 'ton' +import { Cell } from 'ton' export interface Simple { readonly kind: 'Simple'; readonly a: number; @@ -70,7 +71,7 @@ export interface Either_right { export interface BitLenArg { readonly kind: 'BitLenArg'; readonly x: number; - readonly value: number; + readonly value: bigint; } export interface BitLenArgUser { @@ -81,7 +82,7 @@ export interface BitLenArgUser { export interface ExprArg { readonly kind: 'ExprArg'; readonly x: number; - readonly value: number; + readonly value: bigint; } export interface ExprArgUser { @@ -121,7 +122,7 @@ export interface IntBits { export interface IntBitsInside { readonly kind: 'IntBitsInside'; readonly x: number; - readonly a: IntBits; + readonly a: IntBits; } export interface IntBitsOutside { @@ -132,11 +133,11 @@ export interface IntBitsOutside { export interface IntBitsParametrized { readonly kind: 'IntBitsParametrized'; readonly e: number; - readonly h: number; - readonly f: number; + readonly h: bigint; + readonly f: bigint; readonly i: BitString; readonly j: number; - readonly k: number; + readonly k: bigint; readonly tc: Slice; } @@ -436,18 +437,18 @@ export interface FalseAnonField { readonly value: number; } -export type ConstructorOrder = ConstructorOrder__ | ConstructorOrder_a; - -export interface ConstructorOrder__ { - readonly kind: 'ConstructorOrder__'; - readonly anon0: Simple; -} +export type ConstructorOrder = ConstructorOrder_a | ConstructorOrder__; export interface ConstructorOrder_a { readonly kind: 'ConstructorOrder_a'; readonly a: Simple; } +export interface ConstructorOrder__ { + readonly kind: 'ConstructorOrder__'; + readonly anon0: Simple; +} + export type CheckCrc32 = CheckCrc32_a | CheckCrc32_b; export interface CheckCrc32_a { @@ -466,6 +467,17 @@ export interface CheckKeyword { readonly const0: number; } +export interface RefCombinatorInRefHelper { + readonly kind: 'RefCombinatorInRefHelper'; + readonly t: number; + readonly y: Maybe; +} + +export interface RefCombinatorInRef { + readonly kind: 'RefCombinatorInRef'; + readonly msg: RefCombinatorInRefHelper; +} + export function bitLen(n: number) { return n.toString(2).length;; } @@ -683,7 +695,7 @@ export function storeEither(either: Either, storeX: (x: X) => (build } export function loadBitLenArg(slice: Slice, x: number): BitLenArg { - let value: number = slice.loadUint(x); + let value: bigint = slice.loadUintBig(x); return { kind: 'BitLenArg', x: x, @@ -716,7 +728,7 @@ export function storeBitLenArgUser(bitLenArgUser: BitLenArgUser): (builder: Buil } export function loadExprArg(slice: Slice, arg0: number): ExprArg { - let value: number = slice.loadUint((arg0 - 2)); + let value: bigint = slice.loadUintBig((arg0 - 2)); return { kind: 'ExprArg', x: (arg0 - 2), @@ -858,8 +870,8 @@ export function storeIntBits(intBits: IntBits, storeArg: (arg: Arg) => } export function loadIntBitsInside(slice: Slice, arg0: number): IntBitsInside { - let a: IntBits = loadIntBits(slice, ((slice: Slice) => { - return slice.loadInt((1 + (arg0 / 2))) + let a: IntBits = loadIntBits(slice, ((slice: Slice) => { + return slice.loadIntBig((1 + (arg0 / 2))) })); return { @@ -872,7 +884,7 @@ export function loadIntBitsInside(slice: Slice, arg0: number): IntBitsInside { export function storeIntBitsInside(intBitsInside: IntBitsInside): (builder: Builder) => void { return ((builder: Builder) => { - storeIntBits(intBitsInside.a, ((arg: number) => { + storeIntBits(intBitsInside.a, ((arg: bigint) => { return ((builder: Builder) => { builder.storeInt(arg, (1 + intBitsInside.x)); }) @@ -899,11 +911,11 @@ export function storeIntBitsOutside(intBitsOutside: IntBitsOutside): (builder: B } export function loadIntBitsParametrized(slice: Slice, e: number): IntBitsParametrized { - let h: number = slice.loadInt((e * 8)); - let f: number = slice.loadUint((7 * e)); + let h: bigint = slice.loadIntBig((e * 8)); + let f: bigint = slice.loadUintBig((7 * e)); let i: BitString = slice.loadBits((5 + e)); let j: number = slice.loadInt(5); - let k: number = slice.loadUint(e); + let k: bigint = slice.loadUintBig(e); let tc: Slice = slice; return { kind: 'IntBitsParametrized', @@ -1509,21 +1521,16 @@ export function storeMathExprAsCombArg(mathExprAsCombArg: MathExprAsCombArg): (b } export function loadEmptyTag(slice: Slice): EmptyTag { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xab787f76))) { - slice.loadUint(32); - let a: number = slice.loadUint(32); - return { - kind: 'EmptyTag', - a: a, - } - + let a: number = slice.loadUint(32); + return { + kind: 'EmptyTag', + a: a, } - throw new Error(''); + } export function storeEmptyTag(emptyTag: EmptyTag): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xab787f76, 32); builder.storeUint(emptyTag.a, 32); }) @@ -1846,23 +1853,18 @@ export function storeHashmapEUser(hashmapEUser: HashmapEUser): (builder: Builder } export function loadConditionalField(slice: Slice): ConditionalField { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc165658))) { - slice.loadUint(32); - let a: number = slice.loadUint(1); - let b: number | undefined = (a ? slice.loadUint(32) : undefined); - return { - kind: 'ConditionalField', - a: a, - b: b, - } - + let a: number = slice.loadUint(1); + let b: number | undefined = (a ? slice.loadUint(32) : undefined); + return { + kind: 'ConditionalField', + a: a, + b: b, } - throw new Error(''); + } export function storeConditionalField(conditionalField: ConditionalField): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xdc165658, 32); builder.storeUint(conditionalField.a, 1); if ((conditionalField.b != undefined)) { builder.storeUint(conditionalField.b, 32); @@ -1872,23 +1874,18 @@ export function storeConditionalField(conditionalField: ConditionalField): (buil } export function loadBitSelection(slice: Slice): BitSelection { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe1a2049e))) { - slice.loadUint(32); - let a: number = slice.loadUint(6); - let b: number | undefined = ((a & (1 << 2)) ? slice.loadUint(32) : undefined); - return { - kind: 'BitSelection', - a: a, - b: b, - } - + let a: number = slice.loadUint(6); + let b: number | undefined = ((a & (1 << 2)) ? slice.loadUint(32) : undefined); + return { + kind: 'BitSelection', + a: a, + b: b, } - throw new Error(''); + } export function storeBitSelection(bitSelection: BitSelection): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xe1a2049e, 32); builder.storeUint(bitSelection.a, 6); if ((bitSelection.b != undefined)) { builder.storeUint(bitSelection.b, 32); @@ -1898,24 +1895,19 @@ export function storeBitSelection(bitSelection: BitSelection): (builder: Builder } export function loadImplicitCondition(slice: Slice): ImplicitCondition { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd86a5028))) { - slice.loadUint(32); - let flags: number = slice.loadUint(10); - if ((!(flags <= 100))) { - throw new Error(''); - } - return { - kind: 'ImplicitCondition', - flags: flags, - } - + let flags: number = slice.loadUint(10); + if ((!(flags <= 100))) { + throw new Error(''); } - throw new Error(''); + return { + kind: 'ImplicitCondition', + flags: flags, + } + } export function storeImplicitCondition(implicitCondition: ImplicitCondition): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xd86a5028, 32); builder.storeUint(implicitCondition.flags, 10); if ((!(implicitCondition.flags <= 100))) { throw new Error(''); @@ -1925,8 +1917,7 @@ export function storeImplicitCondition(implicitCondition: ImplicitCondition): (b } export function loadMultipleEmptyConstructor(slice: Slice, arg0: number): MultipleEmptyConstructor { - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x85e93c51) && (arg0 == 0)))) { - slice.loadUint(32); + if ((arg0 == 0)) { let a: number = slice.loadUint(32); return { kind: 'MultipleEmptyConstructor__', @@ -1934,8 +1925,7 @@ export function loadMultipleEmptyConstructor(slice: Slice, arg0: number): Multip } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc5d27bf1) && (arg0 == 1)))) { - slice.loadUint(32); + if ((arg0 == 1)) { let b: number = slice.loadUint(5); return { kind: 'MultipleEmptyConstructor__1', @@ -1957,14 +1947,12 @@ export function loadMultipleEmptyConstructor(slice: Slice, arg0: number): Multip export function storeMultipleEmptyConstructor(multipleEmptyConstructor: MultipleEmptyConstructor): (builder: Builder) => void { if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor__')) { return ((builder: Builder) => { - builder.storeUint(0x85e93c51, 32); builder.storeUint(multipleEmptyConstructor.a, 32); }) } if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor__1')) { return ((builder: Builder) => { - builder.storeUint(0xc5d27bf1, 32); builder.storeUint(multipleEmptyConstructor.b, 5); }) @@ -2045,7 +2033,7 @@ export function storeRefCombinatorAny(refCombinatorAny: RefCombinatorAny): (buil let cell1 = beginCell(); storeMaybe(refCombinatorAny.msg, ((arg: Slice) => { return ((builder: Builder) => { - cell1.storeSlice(arg); + builder.storeSlice(arg); }) }))(cell1); @@ -2164,15 +2152,6 @@ export function storeFalseAnonField(falseAnonField: FalseAnonField): (builder: B } export function loadConstructorOrder(slice: Slice): ConstructorOrder { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc6cc03c3))) { - slice.loadUint(32); - let anon0: Simple = loadSimple(slice); - return { - kind: 'ConstructorOrder__', - anon0: anon0, - } - - } if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) { slice.loadUint(1); let a: Simple = loadSimple(slice); @@ -2181,22 +2160,29 @@ export function loadConstructorOrder(slice: Slice): ConstructorOrder { a: a, } + } + if (true) { + let anon0: Simple = loadSimple(slice); + return { + kind: 'ConstructorOrder__', + anon0: anon0, + } + } throw new Error(''); } export function storeConstructorOrder(constructorOrder: ConstructorOrder): (builder: Builder) => void { - if ((constructorOrder.kind == 'ConstructorOrder__')) { + if ((constructorOrder.kind == 'ConstructorOrder_a')) { return ((builder: Builder) => { - builder.storeUint(0xc6cc03c3, 32); - storeSimple(constructorOrder.anon0)(builder); + builder.storeUint(0b0, 1); + storeSimple(constructorOrder.a)(builder); }) } - if ((constructorOrder.kind == 'ConstructorOrder_a')) { + if ((constructorOrder.kind == 'ConstructorOrder__')) { return ((builder: Builder) => { - builder.storeUint(0b0, 1); - storeSimple(constructorOrder.a)(builder); + storeSimple(constructorOrder.anon0)(builder); }) } @@ -2204,7 +2190,7 @@ export function storeConstructorOrder(constructorOrder: ConstructorOrder): (buil } export function loadCheckCrc32(slice: Slice): CheckCrc32 { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6e7c617))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9d97e7a))) { slice.loadUint(32); let a: number = slice.loadUint(32); return { @@ -2213,7 +2199,7 @@ export function loadCheckCrc32(slice: Slice): CheckCrc32 { } } - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xde1cb606))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x2842b3f0))) { slice.loadUint(32); let b: number = slice.loadUint(32); let c: number = slice.loadUint(32); @@ -2230,14 +2216,14 @@ export function loadCheckCrc32(slice: Slice): CheckCrc32 { export function storeCheckCrc32(checkCrc32: CheckCrc32): (builder: Builder) => void { if ((checkCrc32.kind == 'CheckCrc32_a')) { return ((builder: Builder) => { - builder.storeUint(0xd6e7c617, 32); + builder.storeUint(0x9d97e7a, 32); builder.storeUint(checkCrc32.a, 32); }) } if ((checkCrc32.kind == 'CheckCrc32_b')) { return ((builder: Builder) => { - builder.storeUint(0xde1cb606, 32); + builder.storeUint(0x2842b3f0, 32); builder.storeUint(checkCrc32.b, 32); builder.storeUint(checkCrc32.c, 32); }) @@ -2262,3 +2248,61 @@ export function storeCheckKeyword(checkKeyword: CheckKeyword): (builder: Builder } +export function loadRefCombinatorInRefHelper(slice: Slice, loadX: (slice: Slice) => X): RefCombinatorInRefHelper { + let t: number = slice.loadUint(32); + let y: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadX(slice1) + + })); + return { + kind: 'RefCombinatorInRefHelper', + t: t, + y: y, + } + +} + +export function storeRefCombinatorInRefHelper(refCombinatorInRefHelper: RefCombinatorInRefHelper, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(refCombinatorInRefHelper.t, 32); + storeMaybe(refCombinatorInRefHelper.y, ((arg: X) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeX(arg)(cell1); + builder.storeRef(cell1); + + }) + + }))(builder); + }) + +} + +export function loadRefCombinatorInRef(slice: Slice): RefCombinatorInRef { + let slice1 = slice.loadRef().beginParse(); + let msg: RefCombinatorInRefHelper = loadRefCombinatorInRefHelper(slice1, ((slice: Slice) => { + return slice + + })); + return { + kind: 'RefCombinatorInRef', + msg: msg, + } + +} + +export function storeRefCombinatorInRef(refCombinatorInRef: RefCombinatorInRef): (builder: Builder) => void { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeRefCombinatorInRefHelper(refCombinatorInRef.msg, ((arg: Slice) => { + return ((builder: Builder) => { + builder.storeSlice(arg); + }) + + }))(cell1); + builder.storeRef(cell1); + }) + +} + diff --git a/src/codegen/combinator.ts b/src/codegen/combinator.ts index 7586760..c68968f 100644 --- a/src/codegen/combinator.ts +++ b/src/codegen/combinator.ts @@ -39,7 +39,7 @@ export function handleCombinator(expr: ParserExpression, fieldName: string, isFi insideStoreParameters = [tMemberExpression(tIdentifier(variableCombinatorName), tIdentifier(goodVariableName(fieldName)))]; let insideStoreParameters2: Expression[] = [tIdentifier('arg')] - + if (expr instanceof BuiltinZeroArgs) { if (expr.name == '#') { exprForParam = {argLoadExpr: tNumericLiteral(32), argStoreExpr: tNumericLiteral(32), paramType: 'number', fieldLoadStoreSuffix: 'Uint'} @@ -49,7 +49,12 @@ export function handleCombinator(expr: ParserExpression, fieldName: string, isFi } else if (expr instanceof BuiltinOneArgExpr) { if (expr.name.toString() == '##' || expr.name.toString() == '(##)') { if (expr.arg instanceof NumberExpr) { - exprForParam = {argLoadExpr: tNumericLiteral(expr.arg.num), argStoreExpr: tNumericLiteral(expr.arg.num), paramType: 'number', fieldLoadStoreSuffix: 'Uint'} + exprForParam = { + argLoadExpr: tNumericLiteral(expr.arg.num), + argStoreExpr: tNumericLiteral(expr.arg.num), + paramType: expr.arg.num <= 63 ? 'number' : 'bigint', + fieldLoadStoreSuffix: 'Uint' + } } if (expr.arg instanceof NameExpr) { let parameter = constructor.parametersMap.get(expr.arg.name) @@ -59,7 +64,7 @@ export function handleCombinator(expr: ParserExpression, fieldName: string, isFi exprForParam = { argLoadExpr: getParamVarExpr(parameter, constructor), argStoreExpr: tMemberExpression(tIdentifier(variableCombinatorName), tIdentifier(goodVariableName(expr.arg.name))), - paramType: 'number', fieldLoadStoreSuffix: 'Uint' + paramType: 'bigint', fieldLoadStoreSuffix: 'Uint' } } // TODO: handle other cases } else if (expr.name == '#<') { @@ -85,14 +90,16 @@ export function handleCombinator(expr: ParserExpression, fieldName: string, isFi exprForParam = { argLoadExpr: convertToAST(myMathExpr, constructor), argStoreExpr: convertToAST(myMathExpr, constructor, false, tIdentifier(variableSubStructName)), - paramType: 'number', fieldLoadStoreSuffix: 'Int' + paramType: (expr.args[0] instanceof NumberExpr && expr.args[0].num <= 63) ? 'number' : 'bigint', + fieldLoadStoreSuffix: 'Int' } } else if (expr.name == 'uint' && expr.args.length == 1 && (expr.args[0] instanceof MathExpr || expr.args[0] instanceof NumberExpr || expr.args[0] instanceof NameExpr)) { let myMathExpr = convertToMathExpr(expr.args[0]) exprForParam = { argLoadExpr: convertToAST(myMathExpr, constructor), argStoreExpr: convertToAST(myMathExpr, constructor, false, tIdentifier(variableSubStructName)), - paramType: 'number', fieldLoadStoreSuffix: 'Uint' + paramType: (expr.args[0] instanceof NumberExpr && expr.args[0].num <= 63) ? 'number' : 'bigint', + fieldLoadStoreSuffix: 'Uint' } } else if (expr.name == 'bits' && expr.args.length == 1 && (expr.args[0] instanceof MathExpr || expr.args[0] instanceof NumberExpr || expr.args[0] instanceof NameExpr)) { let myMathExpr = convertToMathExpr(expr.args[0]) @@ -255,23 +262,22 @@ export function handleCombinator(expr: ParserExpression, fieldName: string, isFi throw new Error('Expression not supported: ' + expr); } if (exprForParam) { - result.loadExpr = tFunctionCall(tMemberExpression(tIdentifier(theSlice), tIdentifier('load' + exprForParam.fieldLoadStoreSuffix)), [exprForParam.argLoadExpr]) + let fieldLoadSuffix = exprForParam.fieldLoadStoreSuffix; + if (exprForParam.paramType == 'bigint') { + fieldLoadSuffix += 'Big' + } if (exprForParam.paramType != 'BitString' && exprForParam.paramType != 'Slice') { insideStoreParameters.push(exprForParam.argStoreExpr); insideStoreParameters2.push(exprForParam.argStoreExpr); } - result.storeExpr = tExpressionStatement(tFunctionCall(tMemberExpression(tIdentifier(theCell), tIdentifier('store' + exprForParam.fieldLoadStoreSuffix)), insideStoreParameters)); - storeExpr2 = tExpressionStatement(tFunctionCall(tMemberExpression(tIdentifier(theCell), tIdentifier('store' + exprForParam.fieldLoadStoreSuffix)), insideStoreParameters2)); - } - if (exprForParam != undefined) { - result.loadExpr = tFunctionCall(tMemberExpression(tIdentifier(currentSlice), tIdentifier('load' + exprForParam.fieldLoadStoreSuffix)), [exprForParam.argLoadExpr]); + result.loadExpr = tFunctionCall(tMemberExpression(tIdentifier(currentSlice), tIdentifier('load' + fieldLoadSuffix)), [exprForParam.argLoadExpr]); if (exprForParam.paramType == 'Slice') { result.loadExpr = tIdentifier(currentSlice) result.loadFunctionExpr = tArrowFunctionExpression([tTypedIdentifier(tIdentifier('slice'), tIdentifier('Slice'))], [tReturnStatement(tIdentifier('slice'))]) } result.typeParamExpr = tIdentifier(exprForParam.paramType); - result.storeExpr = tExpressionStatement(tFunctionCall(tMemberExpression(tIdentifier(currentCell), tIdentifier('store' + exprForParam.fieldLoadStoreSuffix)), insideStoreParameters)); - storeExpr2 = tExpressionStatement(tFunctionCall(tMemberExpression(tIdentifier(currentCell), tIdentifier('store' + exprForParam.fieldLoadStoreSuffix)), insideStoreParameters2)); + result.storeExpr = tExpressionStatement(tFunctionCall(tMemberExpression(tIdentifier(theCell), tIdentifier('store' + exprForParam.fieldLoadStoreSuffix)), insideStoreParameters)); + storeExpr2 = tExpressionStatement(tFunctionCall(tMemberExpression(tIdentifier(theCell), tIdentifier('store' + exprForParam.fieldLoadStoreSuffix)), insideStoreParameters2)); } if (result.loadExpr && !result.loadFunctionExpr) { @@ -297,6 +303,5 @@ export function handleCombinator(expr: ParserExpression, fieldName: string, isFi } result.storeExpr2 = storeExpr2 - return result; } diff --git a/src/codegen/field.ts b/src/codegen/field.ts index a1f8ed8..5a305a5 100644 --- a/src/codegen/field.ts +++ b/src/codegen/field.ts @@ -47,14 +47,31 @@ export function handleField(field: FieldDefinition, slicePrefix: Array, } if (field.expr instanceof CellRefExpr) { - slicePrefix[slicePrefix.length - 1]++; - slicePrefix.push(0) - constructorLoadStatements.push(sliceLoad(slicePrefix, currentSlice)) - subStructStoreStatements.push(tExpressionStatement(tDeclareVariable(tIdentifier(getCurrentSlice(slicePrefix, 'cell')), tFunctionCall(tIdentifier('beginCell'), [])))) - handleField(new FieldNamedDef(fieldName, field.expr.expr), slicePrefix, tlbCode, constructor, constructorLoadStatements, subStructStoreStatements, subStructProperties, subStructLoadProperties, variableCombinatorName, variableSubStructName, jsCodeFunctionsDeclarations, fieldIndex) - subStructStoreStatements.push(tExpressionStatement(tFunctionCall(tMemberExpression(tIdentifier(currentCell), tIdentifier('storeRef')), [tIdentifier(getCurrentSlice(slicePrefix, 'cell'))]))) - slicePrefix.pop(); + if (field.expr.expr instanceof CombinatorExpr && (field.expr.expr.name == 'MERKLE_UPDATE' || field.expr.expr.name == 'MERKLE_ROOT')) { + slicePrefix[slicePrefix.length - 1]++; + slicePrefix.push(0); + constructorLoadStatements.push( + tExpressionStatement(tDeclareVariable(tIdentifier(getCurrentSlice(slicePrefix, 'cell')), + + tFunctionCall(tMemberExpression( + tIdentifier(currentSlice), tIdentifier('loadRef') + ), []),))) + addLoadProperty(goodVariableName(fieldName), tIdentifier(getCurrentSlice(slicePrefix, 'cell')), undefined, constructorLoadStatements, subStructLoadProperties) + subStructProperties.push(tTypedIdentifier(tIdentifier(goodVariableName(fieldName)), tIdentifier('Cell'))); + subStructStoreStatements.push(tExpressionStatement(tFunctionCall(tMemberExpression(tIdentifier(currentCell), tIdentifier('storeRef')), [tMemberExpression(tIdentifier(variableCombinatorName), tIdentifier(goodVariableName(fieldName)))]))) + + // subStructStoreStatements + slicePrefix.pop(); + } else { + slicePrefix[slicePrefix.length - 1]++; + slicePrefix.push(0) + constructorLoadStatements.push(sliceLoad(slicePrefix, currentSlice)) + subStructStoreStatements.push(tExpressionStatement(tDeclareVariable(tIdentifier(getCurrentSlice(slicePrefix, 'cell')), tFunctionCall(tIdentifier('beginCell'), [])))) + handleField(new FieldNamedDef(fieldName, field.expr.expr), slicePrefix, tlbCode, constructor, constructorLoadStatements, subStructStoreStatements, subStructProperties, subStructLoadProperties, variableCombinatorName, variableSubStructName, jsCodeFunctionsDeclarations, fieldIndex) + subStructStoreStatements.push(tExpressionStatement(tFunctionCall(tMemberExpression(tIdentifier(currentCell), tIdentifier('storeRef')), [tIdentifier(getCurrentSlice(slicePrefix, 'cell'))]))) + slicePrefix.pop(); + } } if (field.expr instanceof CombinatorExpr || field.expr instanceof NameExpr || field.expr instanceof BuiltinZeroArgs || field.expr instanceof BuiltinOneArgExpr || field.expr instanceof MathExpr || field.expr instanceof CondExpr) { diff --git a/src/codegen/helpers.ts b/src/codegen/helpers.ts index c43b59e..2421b99 100644 --- a/src/codegen/helpers.ts +++ b/src/codegen/helpers.ts @@ -120,8 +120,20 @@ export function addLoadProperty(name: string, loadExpr: Expression, typeExpr: Ty } export function calculateOpcode(declaration: Declaration, input: string[]): string { - let constructorString = getStringDeclaration(declaration, input) - const a = BigInt(crc32.str(constructorString)); - const b = BigInt(0x80000000); - return ((a | b) < 0 ? (a | b) + BigInt('4294967296') : a | b).toString(16); + let scheme = getStringDeclaration(declaration, input) + let constructor = scheme.substring(0, scheme.indexOf(' ')); + const rest = scheme.substring(scheme.indexOf(' ')); + if (constructor.includes('#')) { + constructor = constructor.substring(0, constructor.indexOf('#')); + } + scheme = + constructor + + ' ' + + rest + .replace(/\(/g, '') + .replace(/\)/g, '') + .replace(/\s+/g, ' ') + .replace(/;/g, '') + .trim() + return (BigInt(crc32.str(scheme)) & BigInt(0x7fffffff)).toString(16); } \ No newline at end of file diff --git a/src/codegen/main.ts b/src/codegen/main.ts index a8c9555..05136a9 100644 --- a/src/codegen/main.ts +++ b/src/codegen/main.ts @@ -15,6 +15,7 @@ export function generate(tree: Program, input: string) { jsCodeDeclarations.push(tImportDeclaration(tIdentifier('Slice'), tStringLiteral('ton'))) // importDeclaration([importSpecifier(identifier('Slice'), identifier('Slice'))], stringLiteral('../boc/Slice'))) jsCodeDeclarations.push(tImportDeclaration(tIdentifier('beginCell'), tStringLiteral('ton'))) jsCodeDeclarations.push(tImportDeclaration(tIdentifier('BitString'), tStringLiteral('ton'))) + jsCodeDeclarations.push(tImportDeclaration(tIdentifier('Cell'), tStringLiteral('ton'))) let jsCodeConstructorDeclarations: GenDeclaration[] = [] let jsCodeFunctionsDeclarations: FunctionDeclaration[] = [] diff --git a/src/codegen/util.ts b/src/codegen/util.ts index 07fae15..e724557 100644 --- a/src/codegen/util.ts +++ b/src/codegen/util.ts @@ -364,6 +364,12 @@ export function calculateVariables(constructor: TLBConstructor) { export function getConstructorTag(declaration: Declaration, input: string[]): TLBConstructorTag { let tag = declaration.constructorDef.tag; + if (tag == null && declaration.constructorDef.name == '_' || tag && tag.length > 1 && tag[1] == '_') { + return { + bitLen: 0, + binary: '' + }; + } if (tag == null) { let opCode = calculateOpcode(declaration, input) return { @@ -371,12 +377,6 @@ export function getConstructorTag(declaration: Declaration, input: string[]): TL binary: '0x' + opCode } } - if (tag == undefined || tag && tag.length > 1 && tag[1] == '_') { - return { - bitLen: 0, - binary: '' - }; - } if (tag[0] == '$') { return { bitLen: tag?.length - 1, diff --git a/tests/fixtures/tlb/block.tlb b/tests/fixtures/tlb/block.tlb index 9bb6613..5e6c602 100644 --- a/tests/fixtures/tlb/block.tlb +++ b/tests/fixtures/tlb/block.tlb @@ -19,11 +19,11 @@ bit$_ (## 1) = Bit; */ // ordinary Hashmap / HashmapE, with fixed length keys // -hm_edge#_ {n:#} {X:Type} {l:#} {m:#} label:(HmLabel ~l n) +hm_edge#_ {n:#} {X:Type} {l:#} {m:#} label:(HmLabel ~l n) {n = (~m) + l} node:(HashmapNode m X) = Hashmap n X; hmn_leaf#_ {X:Type} value:X = HashmapNode 0 X; -hmn_fork#_ {n:#} {X:Type} left:^(Hashmap n X) +hmn_fork#_ {n:#} {X:Type} left:^(Hashmap n X) right:^(Hashmap n X) = HashmapNode (n + 1) X; hml_short$0 {m:#} {n:#} len:(Unary ~n) {n <= m} s:(n * Bit) = HmLabel ~n m; @@ -39,38 +39,38 @@ hme_root$1 {n:#} {X:Type} root:^(Hashmap n X) = HashmapE n X; // true#_ = True; _ {n:#} _:(Hashmap n True) = BitstringSet n; -// HashmapAug, hashmap with an extra value +// HashmapAug, hashmap with an extra value // (augmentation) of type Y at every node // -ahm_edge#_ {n:#} {X:Type} {Y:Type} {l:#} {m:#} - label:(HmLabel ~l n) {n = (~m) + l} +ahm_edge#_ {n:#} {X:Type} {Y:Type} {l:#} {m:#} + label:(HmLabel ~l n) {n = (~m) + l} node:(HashmapAugNode m X Y) = HashmapAug n X Y; ahmn_leaf#_ {X:Type} {Y:Type} extra:Y value:X = HashmapAugNode 0 X Y; ahmn_fork#_ {n:#} {X:Type} {Y:Type} left:^(HashmapAug n X Y) right:^(HashmapAug n X Y) extra:Y = HashmapAugNode (n + 1) X Y; -ahme_empty$0 {n:#} {X:Type} {Y:Type} extra:Y +ahme_empty$0 {n:#} {X:Type} {Y:Type} extra:Y = HashmapAugE n X Y; -ahme_root$1 {n:#} {X:Type} {Y:Type} root:^(HashmapAug n X Y) +ahme_root$1 {n:#} {X:Type} {Y:Type} root:^(HashmapAug n X Y) extra:Y = HashmapAugE n X Y; // VarHashmap / VarHashmapE, with variable-length keys // -vhm_edge#_ {n:#} {X:Type} {l:#} {m:#} label:(HmLabel ~l n) - {n = (~m) + l} node:(VarHashmapNode m X) +vhm_edge#_ {n:#} {X:Type} {l:#} {m:#} label:(HmLabel ~l n) + {n = (~m) + l} node:(VarHashmapNode m X) = VarHashmap n X; vhmn_leaf$00 {n:#} {X:Type} value:X = VarHashmapNode n X; -vhmn_fork$01 {n:#} {X:Type} left:^(VarHashmap n X) - right:^(VarHashmap n X) value:(Maybe X) +vhmn_fork$01 {n:#} {X:Type} left:^(VarHashmap n X) + right:^(VarHashmap n X) value:(Maybe X) = VarHashmapNode (n + 1) X; -vhmn_cont$1 {n:#} {X:Type} branch:Bit child:^(VarHashmap n X) +vhmn_cont$1 {n:#} {X:Type} branch:Bit child:^(VarHashmap n X) value:X = VarHashmapNode (n + 1) X; // nothing$0 {X:Type} = Maybe X; // just$1 {X:Type} value:X = Maybe X; vhme_empty$0 {n:#} {X:Type} = VarHashmapE n X; -vhme_root$1 {n:#} {X:Type} root:^(VarHashmap n X) +vhme_root$1 {n:#} {X:Type} root:^(VarHashmap n X) = VarHashmapE n X; // @@ -78,16 +78,16 @@ vhme_root$1 {n:#} {X:Type} root:^(VarHashmap n X) // constituting a prefix code // -phm_edge#_ {n:#} {X:Type} {l:#} {m:#} label:(HmLabel ~l n) - {n = (~m) + l} node:(PfxHashmapNode m X) +phm_edge#_ {n:#} {X:Type} {l:#} {m:#} label:(HmLabel ~l n) + {n = (~m) + l} node:(PfxHashmapNode m X) = PfxHashmap n X; phmn_leaf$0 {n:#} {X:Type} value:X = PfxHashmapNode n X; -phmn_fork$1 {n:#} {X:Type} left:^(PfxHashmap n X) +phmn_fork$1 {n:#} {X:Type} left:^(PfxHashmap n X) right:^(PfxHashmap n X) = PfxHashmapNode (n + 1) X; phme_empty$0 {n:#} {X:Type} = PfxHashmapE n X; -phme_root$1 {n:#} {X:Type} root:^(PfxHashmap n X) +phme_root$1 {n:#} {X:Type} root:^(PfxHashmap n X) = PfxHashmapE n X; /* * @@ -98,39 +98,42 @@ phme_root$1 {n:#} {X:Type} root:^(PfxHashmap n X) // TON BLOCK LAYOUT // addr_none$00 = MsgAddressExt; -addr_extern$01 len:(## 9) external_address:(bits len) +addr_extern$01 len:(## 9) external_address:(bits len) = MsgAddressExt; anycast_info$_ depth:(#<= 30) { depth >= 1 } rewrite_pfx:(bits depth) = Anycast; -addr_std$10 anycast:(Maybe Anycast) +addr_std$10 anycast:(Maybe Anycast) workchain_id:int8 address:bits256 = MsgAddressInt; -addr_var$11 anycast:(Maybe Anycast) addr_len:(## 9) +addr_var$11 anycast:(Maybe Anycast) addr_len:(## 9) workchain_id:int32 address:(bits addr_len) = MsgAddressInt; _ _:MsgAddressInt = MsgAddress; _ _:MsgAddressExt = MsgAddress; // var_uint$_ {n:#} len:(#< n) value:(uint (len * 8)) = VarUInteger n; -var_int$_ {n:#} len:(#< n) value:(int (len * 8)) +var_int$_ {n:#} len:(#< n) value:(int (len * 8)) = VarInteger n; nanograms$_ amount:(VarUInteger 16) = Grams; + +_ grams:Grams = Coins; + // -extra_currencies$_ dict:(HashmapE 32 (VarUInteger 32)) +extra_currencies$_ dict:(HashmapE 32 (VarUInteger 32)) = ExtraCurrencyCollection; -currencies$_ grams:Grams other:ExtraCurrencyCollection +currencies$_ grams:Grams other:ExtraCurrencyCollection = CurrencyCollection; // int_msg_info$0 ihr_disabled:Bool bounce:Bool bounced:Bool - src:MsgAddressInt dest:MsgAddressInt + src:MsgAddressInt dest:MsgAddressInt value:CurrencyCollection ihr_fee:Grams fwd_fee:Grams created_lt:uint64 created_at:uint32 = CommonMsgInfo; -ext_in_msg_info$10 src:MsgAddressExt dest:MsgAddressInt +ext_in_msg_info$10 src:MsgAddressExt dest:MsgAddressInt import_fee:Grams = CommonMsgInfo; ext_out_msg_info$11 src:MsgAddressInt dest:MsgAddressExt created_lt:uint64 created_at:uint32 = CommonMsgInfo; int_msg_info$0 ihr_disabled:Bool bounce:Bool bounced:Bool - src:MsgAddress dest:MsgAddressInt + src:MsgAddress dest:MsgAddressInt value:CurrencyCollection ihr_fee:Grams fwd_fee:Grams created_lt:uint64 created_at:uint32 = CommonMsgInfoRelaxed; ext_out_msg_info$11 src:MsgAddress dest:MsgAddressExt @@ -140,7 +143,12 @@ tick_tock$_ tick:Bool tock:Bool = TickTock; _ split_depth:(Maybe (## 5)) special:(Maybe TickTock) code:(Maybe ^Cell) data:(Maybe ^Cell) - library:(HashmapE 256 SimpleLib) = StateInit; + library:(Maybe ^Cell) = StateInit; + +// StateInitWithLibs is used to validate sent and received messages +_ split_depth:(Maybe (## 5)) special:(Maybe TickTock) + code:(Maybe ^Cell) data:(Maybe ^Cell) + library:(HashmapE 256 SimpleLib) = StateInitWithLibs; simple_lib$_ public:Bool root:^Cell = SimpleLib; @@ -151,56 +159,56 @@ message$_ {X:Type} info:CommonMsgInfo message$_ {X:Type} info:CommonMsgInfoRelaxed init:(Maybe (Either StateInit ^StateInit)) body:(Either X ^X) = MessageRelaxed X; - + _ (Message Any) = MessageAny; // -interm_addr_regular$0 use_dest_bits:(#<= 96) +interm_addr_regular$0 use_dest_bits:(#<= 96) = IntermediateAddress; -interm_addr_simple$10 workchain_id:int8 addr_pfx:uint64 +interm_addr_simple$10 workchain_id:int8 addr_pfx:uint64 = IntermediateAddress; interm_addr_ext$11 workchain_id:int32 addr_pfx:uint64 = IntermediateAddress; -msg_envelope#4 cur_addr:IntermediateAddress - next_addr:IntermediateAddress fwd_fee_remaining:Grams +msg_envelope#4 cur_addr:IntermediateAddress + next_addr:IntermediateAddress fwd_fee_remaining:Grams msg:^(Message Any) = MsgEnvelope; // -msg_import_ext$000 msg:^(Message Any) transaction:^Transaction +msg_import_ext$000 msg:^(Message Any) transaction:^Transaction = InMsg; -msg_import_ihr$010 msg:^(Message Any) transaction:^Transaction +msg_import_ihr$010 msg:^(Message Any) transaction:^Transaction ihr_fee:Grams proof_created:^Cell = InMsg; msg_import_imm$011 in_msg:^MsgEnvelope transaction:^Transaction fwd_fee:Grams = InMsg; -msg_import_fin$100 in_msg:^MsgEnvelope +msg_import_fin$100 in_msg:^MsgEnvelope transaction:^Transaction fwd_fee:Grams = InMsg; -msg_import_tr$101 in_msg:^MsgEnvelope out_msg:^MsgEnvelope +msg_import_tr$101 in_msg:^MsgEnvelope out_msg:^MsgEnvelope transit_fee:Grams = InMsg; -msg_discard_fin$110 in_msg:^MsgEnvelope transaction_id:uint64 +msg_discard_fin$110 in_msg:^MsgEnvelope transaction_id:uint64 fwd_fee:Grams = InMsg; -msg_discard_tr$111 in_msg:^MsgEnvelope transaction_id:uint64 +msg_discard_tr$111 in_msg:^MsgEnvelope transaction_id:uint64 fwd_fee:Grams proof_delivered:^Cell = InMsg; // -import_fees$_ fees_collected:Grams +import_fees$_ fees_collected:Grams value_imported:CurrencyCollection = ImportFees; _ (HashmapAugE 256 InMsg ImportFees) = InMsgDescr; msg_export_ext$000 msg:^(Message Any) transaction:^Transaction = OutMsg; -msg_export_imm$010 out_msg:^MsgEnvelope +msg_export_imm$010 out_msg:^MsgEnvelope transaction:^Transaction reimport:^InMsg = OutMsg; -msg_export_new$001 out_msg:^MsgEnvelope +msg_export_new$001 out_msg:^MsgEnvelope transaction:^Transaction = OutMsg; -msg_export_tr$011 out_msg:^MsgEnvelope +msg_export_tr$011 out_msg:^MsgEnvelope imported:^InMsg = OutMsg; msg_export_deq$1100 out_msg:^MsgEnvelope import_block_lt:uint63 = OutMsg; msg_export_deq_short$1101 msg_env_hash:bits256 next_workchain:int32 next_addr_pfx:uint64 import_block_lt:uint64 = OutMsg; -msg_export_tr_req$111 out_msg:^MsgEnvelope +msg_export_tr_req$111 out_msg:^MsgEnvelope imported:^InMsg = OutMsg; -msg_export_deq_imm$100 out_msg:^MsgEnvelope +msg_export_deq_imm$100 out_msg:^MsgEnvelope reimport:^InMsg = OutMsg; _ enqueued_lt:uint64 out_msg:^MsgEnvelope = EnqueuedMsg; @@ -210,7 +218,7 @@ _ (HashmapAugE 256 OutMsg CurrencyCollection) = OutMsgDescr; _ (HashmapAugE 352 EnqueuedMsg uint64) = OutMsgQueue; processed_upto$_ last_msg_lt:uint64 last_msg_hash:bits256 = ProcessedUpto; -// key is [ shard:uint64 mc_seqno:uint32 ] +// key is [ shard:uint64 mc_seqno:uint32 ] _ (HashmapE 96 ProcessedUpto) = ProcessedInfo; ihr_pending$_ import_lt:uint64 = IhrPendingSince; @@ -219,10 +227,10 @@ _ (HashmapE 320 IhrPendingSince) = IhrPendingInfo; _ out_queue:OutMsgQueue proc_info:ProcessedInfo ihr_pending:IhrPendingInfo = OutMsgQueueInfo; // -storage_used$_ cells:(VarUInteger 7) bits:(VarUInteger 7) +storage_used$_ cells:(VarUInteger 7) bits:(VarUInteger 7) public_cells:(VarUInteger 7) = StorageUsed; -storage_used_short$_ cells:(VarUInteger 7) +storage_used_short$_ cells:(VarUInteger 7) bits:(VarUInteger 7) = StorageUsedShort; storage_info$_ used:StorageUsed last_paid:uint32 @@ -233,7 +241,7 @@ account$1 addr:MsgAddressInt storage_stat:StorageInfo storage:AccountStorage = Account; account_storage$_ last_trans_lt:uint64 - balance:CurrencyCollection state:AccountState + balance:CurrencyCollection state:AccountState = AccountStorage; account_uninit$00 = AccountState; @@ -253,14 +261,14 @@ _ split_depth:(Maybe (## 5)) special:(Maybe TickTock) library:(Maybe ^Cell) = StateInit; */ -account_descr$_ account:^Account last_trans_hash:bits256 +account_descr$_ account:^Account last_trans_hash:bits256 last_trans_lt:uint64 = ShardAccount; depth_balance$_ split_depth:(#<= 30) balance:CurrencyCollection = DepthBalanceInfo; _ (HashmapAugE 256 ShardAccount DepthBalanceInfo) = ShardAccounts; -transaction$0111 account_addr:bits256 lt:uint64 +transaction$0111 account_addr:bits256 lt:uint64 prev_trans_hash:bits256 prev_trans_lt:uint64 now:uint32 outmsg_cnt:uint15 orig_status:AccountStatus end_status:AccountStatus @@ -281,7 +289,7 @@ acc_trans#5 account_addr:bits256 _ (HashmapAugE 256 AccountBlock CurrencyCollection) = ShardAccountBlocks; // -tr_phase_storage$_ storage_fees_collected:Grams +tr_phase_storage$_ storage_fees_collected:Grams storage_fees_due:(Maybe Grams) status_change:AccStatusChange = TrStoragePhase; @@ -295,7 +303,7 @@ tr_phase_credit$_ due_fees_collected:(Maybe Grams) tr_phase_compute_skipped$0 reason:ComputeSkipReason = TrComputePhase; -tr_phase_compute_vm$1 success:Bool msg_state_used:Bool +tr_phase_compute_vm$1 success:Bool msg_state_used:Bool account_activated:Bool gas_fees:Grams ^[ gas_used:(VarUInteger 7) gas_limit:(VarUInteger 7) gas_credit:(Maybe (VarUInteger 3)) @@ -306,19 +314,20 @@ tr_phase_compute_vm$1 success:Bool msg_state_used:Bool cskip_no_state$00 = ComputeSkipReason; cskip_bad_state$01 = ComputeSkipReason; cskip_no_gas$10 = ComputeSkipReason; +cskip_suspended$110 = ComputeSkipReason; tr_phase_action$_ success:Bool valid:Bool no_funds:Bool status_change:AccStatusChange total_fwd_fees:(Maybe Grams) total_action_fees:(Maybe Grams) result_code:int32 result_arg:(Maybe int32) tot_actions:uint16 - spec_actions:uint16 skipped_actions:uint16 msgs_created:uint16 - action_list_hash:bits256 tot_msg_size:StorageUsedShort + spec_actions:uint16 skipped_actions:uint16 msgs_created:uint16 + action_list_hash:bits256 tot_msg_size:StorageUsedShort = TrActionPhase; tr_phase_bounce_negfunds$00 = TrBouncePhase; tr_phase_bounce_nofunds$01 msg_size:StorageUsedShort req_fwd_fees:Grams = TrBouncePhase; -tr_phase_bounce_ok$1 msg_size:StorageUsedShort +tr_phase_bounce_ok$1 msg_size:StorageUsedShort msg_fees:Grams fwd_fees:Grams = TrBouncePhase; // trans_ord$0000 credit_first:Bool @@ -360,32 +369,32 @@ trans_merge_install$0111 split_info:SplitMergeInfo = TransactionDescr; smc_info#076ef1ea actions:uint16 msgs_sent:uint16 - unixtime:uint32 block_lt:uint64 trans_lt:uint64 + unixtime:uint32 block_lt:uint64 trans_lt:uint64 rand_seed:bits256 balance_remaining:CurrencyCollection - myself:MsgAddressInt = SmartContractInfo; + myself:MsgAddressInt global_config:(Maybe Cell) = SmartContractInfo; // // out_list_empty$_ = OutList 0; out_list$_ {n:#} prev:^(OutList n) action:OutAction = OutList (n + 1); -action_send_msg#0ec3c86d mode:(## 8) +action_send_msg#0ec3c86d mode:(## 8) out_msg:^(MessageRelaxed Any) = OutAction; action_set_code#ad4de08e new_code:^Cell = OutAction; action_reserve_currency#36e6b809 mode:(## 8) currency:CurrencyCollection = OutAction; libref_hash$0 lib_hash:bits256 = LibRef; libref_ref$1 library:^Cell = LibRef; -action_change_library#26fa1dd4 mode:(## 7) { mode <= 2 } +action_change_library#26fa1dd4 mode:(## 7) libref:LibRef = OutAction; out_list_node$_ prev:^Cell action:OutAction = OutListNode; // // -shard_ident$00 shard_pfx_bits:(#<= 60) +shard_ident$00 shard_pfx_bits:(#<= 60) workchain_id:int32 shard_prefix:uint64 = ShardIdent; ext_blk_ref$_ end_lt:uint64 - seq_no:uint32 root_hash:bits256 file_hash:bits256 + seq_no:uint32 root_hash:bits256 file_hash:bits256 = ExtBlkRef; block_id_ext$_ shard_id:ShardIdent seq_no:uint32 @@ -394,7 +403,7 @@ block_id_ext$_ shard_id:ShardIdent seq_no:uint32 master_info$_ master:ExtBlkRef = BlkMasterInfo; shard_state#9023afe2 global_id:int32 - shard_id:ShardIdent + shard_id:ShardIdent seq_no:uint32 vert_seq_no:# gen_utime:uint32 gen_lt:uint64 min_ref_mc_seqno:uint32 @@ -408,22 +417,22 @@ shard_state#9023afe2 global_id:int32 master_ref:(Maybe BlkMasterInfo) ] custom:(Maybe ^McStateExtra) = ShardStateUnsplit; - + _ ShardStateUnsplit = ShardState; split_state#5f327da5 left:^ShardStateUnsplit right:^ShardStateUnsplit = ShardState; shared_lib_descr$00 lib:^Cell publishers:(Hashmap 256 True) = LibDescr; -block_info#9bc7a987 version:uint32 - not_master:(## 1) - after_merge:(## 1) before_split:(## 1) - after_split:(## 1) +block_info#9bc7a987 version:uint32 + not_master:(## 1) + after_merge:(## 1) before_split:(## 1) + after_split:(## 1) want_split:Bool want_merge:Bool key_block:Bool vert_seqno_incr:(## 1) flags:(## 8) { flags <= 1 } - seq_no:# vert_seq_no:# { vert_seq_no >= vert_seqno_incr } - { prev_seq_no:# } { ~prev_seq_no + 1 = seq_no } + seq_no:# vert_seq_no:# { vert_seq_no >= vert_seqno_incr } + { prev_seq_no:# } { ~prev_seq_no + 1 = seq_no } shard:ShardIdent gen_utime:uint32 start_lt:uint64 end_lt:uint64 gen_validator_list_hash_short:uint32 @@ -431,7 +440,7 @@ block_info#9bc7a987 version:uint32 min_ref_mc_seqno:uint32 prev_key_block_seqno:uint32 gen_software:flags . 0?GlobalVersion - master_ref:not_master?^BlkMasterInfo + master_ref:not_master?^BlkMasterInfo prev_ref:^(BlkPrevInfo after_merge) prev_vert_ref:vert_seqno_incr?^(BlkPrevInfo 0) = BlockInfo; @@ -441,7 +450,7 @@ prev_blks_info$_ prev1:^ExtBlkRef prev2:^ExtBlkRef = BlkPrevInfo 1; block#11ef55aa global_id:int32 info:^BlockInfo value_flow:^ValueFlow - state_update:^(MERKLE_UPDATE ShardState) + state_update:^(MERKLE_UPDATE ShardState) extra:^BlockExtra = Block; block_extra in_msg_descr:^InMsgDescr @@ -451,7 +460,7 @@ block_extra in_msg_descr:^InMsgDescr created_by:bits256 custom:(Maybe ^McBlockExtra) = BlockExtra; // -value_flow ^[ from_prev_blk:CurrencyCollection +value_flow#b8e48dfb ^[ from_prev_blk:CurrencyCollection to_next_blk:CurrencyCollection imported:CurrencyCollection exported:CurrencyCollection ] @@ -463,10 +472,23 @@ value_flow ^[ from_prev_blk:CurrencyCollection minted:CurrencyCollection ] = ValueFlow; +value_flow_v2#3ebf98b7 ^[ from_prev_blk:CurrencyCollection + to_next_blk:CurrencyCollection + imported:CurrencyCollection + exported:CurrencyCollection ] + fees_collected:CurrencyCollection + burned:CurrencyCollection + ^[ + fees_imported:CurrencyCollection + recovered:CurrencyCollection + created:CurrencyCollection + minted:CurrencyCollection + ] = ValueFlow; + // // bt_leaf$0 {X:Type} leaf:X = BinTree X; -bt_fork$1 {X:Type} left:^(BinTree X) right:^(BinTree X) +bt_fork$1 {X:Type} left:^(BinTree X) right:^(BinTree X) = BinTree X; fsm_none$0 = FutureSplitMerge; @@ -475,7 +497,7 @@ fsm_merge$11 merge_utime:uint32 interval:uint32 = FutureSplitMerge; shard_descr#b seq_no:uint32 reg_mc_seqno:uint32 start_lt:uint64 end_lt:uint64 - root_hash:bits256 file_hash:bits256 + root_hash:bits256 file_hash:bits256 before_split:Bool before_merge:Bool want_split:Bool want_merge:Bool nx_cc_updated:Bool flags:(## 3) { flags = 0 } @@ -487,7 +509,7 @@ shard_descr#b seq_no:uint32 reg_mc_seqno:uint32 shard_descr_new#a seq_no:uint32 reg_mc_seqno:uint32 start_lt:uint64 end_lt:uint64 - root_hash:bits256 file_hash:bits256 + root_hash:bits256 file_hash:bits256 before_split:Bool before_merge:Bool want_split:Bool want_merge:Bool nx_cc_updated:Bool flags:(## 3) { flags = 0 } @@ -500,23 +522,23 @@ shard_descr_new#a seq_no:uint32 reg_mc_seqno:uint32 _ (HashmapE 32 ^(BinTree ShardDescr)) = ShardHashes; bta_leaf$0 {X:Type} {Y:Type} extra:Y leaf:X = BinTreeAug X Y; -bta_fork$1 {X:Type} {Y:Type} left:^(BinTreeAug X Y) +bta_fork$1 {X:Type} {Y:Type} left:^(BinTreeAug X Y) right:^(BinTreeAug X Y) extra:Y = BinTreeAug X Y; _ fees:CurrencyCollection create:CurrencyCollection = ShardFeeCreated; _ (HashmapAugE 96 ShardFeeCreated ShardFeeCreated) = ShardFees; -_ config_addr:bits256 config:^(Hashmap 32 ^Cell) +_ config_addr:bits256 config:^(Hashmap 32 ^Cell) = ConfigParams; validator_info$_ - validator_list_hash_short:uint32 + validator_list_hash_short:uint32 catchain_seqno:uint32 nx_cc_updated:Bool = ValidatorInfo; validator_base_info$_ - validator_list_hash_short:uint32 + validator_list_hash_short:uint32 catchain_seqno:uint32 = ValidatorBaseInfo; @@ -526,8 +548,8 @@ _ key:Bool blk_ref:ExtBlkRef = KeyExtBlkRef; _ (HashmapAugE 32 KeyExtBlkRef KeyMaxLt) = OldMcBlocksInfo; -counters#_ last_updated:uint32 total:uint64 cnt2048:uint64 cnt65536:uint64 = Counters; -creator_info#4 mc_blocks:Counters shard_blocks:Counters = CreatorStats; +counters#_ last_updated:uint32 total:uint64 cnt2048:uint64 cnt65536:uint64 = Counters; +creator_info#4 mc_blocks:Counters shard_blocks:Counters = CreatorStats; block_create_stats#17 counters:(HashmapE 256 CreatorStats) = BlockCreateStats; block_create_stats_ext#34 counters:(HashmapAugE 256 CreatorStats uint32) = BlockCreateStats; @@ -573,11 +595,11 @@ masterchain_block_extra#cca5 validator#53 public_key:SigPubKey weight:uint64 = ValidatorDescr; validator_addr#73 public_key:SigPubKey weight:uint64 adnl_addr:bits256 = ValidatorDescr; -validators#11 utime_since:uint32 utime_until:uint32 - total:((##) 16) main:(## 16) { main <= total } { main >= 1 } +validators#11 utime_since:uint32 utime_until:uint32 + total:(## 16) main:(## 16) { main <= total } { main >= 1 } list:(Hashmap 16 ValidatorDescr) = ValidatorSet; -validators_ext#12 utime_since:uint32 utime_until:uint32 - total:(## 16) main:(## 16) { main <= total } { main >= 1 } +validators_ext#12 utime_since:uint32 utime_until:uint32 + total:(## 16) main:(## 16) { main <= total } { main >= 1 } total_weight:uint64 list:(HashmapE 16 ValidatorDescr) = ValidatorSet; _ config_addr:bits256 = ConfigParam 0; @@ -586,6 +608,11 @@ _ minter_addr:bits256 = ConfigParam 2; // ConfigParam 0 is used if absent _ fee_collector_addr:bits256 = ConfigParam 3; // ConfigParam 1 is used if absent _ dns_root_addr:bits256 = ConfigParam 4; // root TON DNS resolver +burning_config#01 + blackhole_addr:(Maybe bits256) + fee_burn_num:# fee_burn_denom:# { fee_burn_num <= fee_burn_denom } { fee_burn_denom >= 1 } = BurningConfig; +_ BurningConfig = ConfigParam 5; + _ mint_new_price:Grams mint_add_price:Grams = ConfigParam 6; _ to_mint:ExtraCurrencyCollection = ConfigParam 7; @@ -598,59 +625,75 @@ cfg_vote_cfg#36 min_tot_rounds:uint8 max_tot_rounds:uint8 min_wins:uint8 max_los cfg_vote_setup#91 normal_params:^ConfigProposalSetup critical_params:^ConfigProposalSetup = ConfigVotingSetup; _ ConfigVotingSetup = ConfigParam 11; -cfg_proposal#f3 param_id:int32 param_value:(Maybe ^Cell) if_hash_equal:(Maybe uint256) +cfg_proposal#f3 param_id:int32 param_value:(Maybe ^Cell) if_hash_equal:(Maybe uint256) = ConfigProposal; cfg_proposal_status#ce expires:uint32 proposal:^ConfigProposal is_critical:Bool - voters:(HashmapE 16 True) remaining_weight:int64 validator_set_id:uint256 + voters:(HashmapE 16 True) remaining_weight:int64 validator_set_id:uint256 rounds_remaining:uint8 wins:uint8 losses:uint8 = ConfigProposalStatus; wfmt_basic#1 vm_version:int32 vm_mode:uint64 = WorkchainFormat 1; wfmt_ext#0 min_addr_len:(## 12) max_addr_len:(## 12) addr_len_step:(## 12) - { min_addr_len >= 64 } { min_addr_len <= max_addr_len } + { min_addr_len >= 64 } { min_addr_len <= max_addr_len } { max_addr_len <= 1023 } { addr_len_step <= 1023 } workchain_type_id:(## 32) { workchain_type_id >= 1 } = WorkchainFormat 0; -workchain#a6 enabled_since:uint32 actual_min_split:(## 8) - min_split:(## 8) max_split:(## 8) { actual_min_split <= min_split } +wc_split_merge_timings#0 + split_merge_delay:uint32 split_merge_interval:uint32 + min_split_merge_interval:uint32 max_split_merge_delay:uint32 + = WcSplitMergeTimings; + //workchain#a5 enabled_since:uint32 min_split:(## 8) max_split:(## 8) // { min_split <= max_split } { max_split <= 60 } + +workchain#a6 enabled_since:uint32 actual_min_split:(## 8) + min_split:(## 8) max_split:(## 8) { actual_min_split <= min_split } + basic:(## 1) active:Bool accept_msgs:Bool flags:(## 13) { flags = 0 } + zerostate_root_hash:bits256 zerostate_file_hash:bits256 + version:uint32 format:(WorkchainFormat basic) + = WorkchainDescr; + +workchain_v2#a7 enabled_since:uint32 actual_min_split:(## 8) + min_split:(## 8) max_split:(## 8) { actual_min_split <= min_split } basic:(## 1) active:Bool accept_msgs:Bool flags:(## 13) { flags = 0 } zerostate_root_hash:bits256 zerostate_file_hash:bits256 version:uint32 format:(WorkchainFormat basic) + split_merge_timings:WcSplitMergeTimings = WorkchainDescr; _ workchains:(HashmapE 32 WorkchainDescr) = ConfigParam 12; -complaint_prices#1a deposit:Grams bit_price:Grams cell_price:Grams = ComplaintPricing; +complaint_prices#1a deposit:Grams bit_price:Grams cell_price:Grams = ComplaintPricing; _ ComplaintPricing = ConfigParam 13; block_grams_created#6b masterchain_block_fee:Grams basechain_block_fee:Grams = BlockCreateFees; _ BlockCreateFees = ConfigParam 14; -_ validators_elected_for:uint32 elections_start_before:uint32 +_ validators_elected_for:uint32 elections_start_before:uint32 elections_end_before:uint32 stake_held_for:uint32 = ConfigParam 15; - -_ max_validators:(## 16) max_main_validators:(## 16) min_validators:(## 16) - { max_validators >= max_main_validators } - { max_main_validators >= min_validators } + +_ max_validators:(## 16) max_main_validators:(## 16) min_validators:(## 16) + { max_validators >= max_main_validators } + { max_main_validators >= min_validators } { min_validators >= 1 } = ConfigParam 16; _ min_stake:Grams max_stake:Grams min_total_stake:Grams max_stake_factor:uint32 = ConfigParam 17; -_#cc utime_since:uint32 bit_price_ps:uint64 cell_price_ps:uint64 +_#cc utime_since:uint32 bit_price_ps:uint64 cell_price_ps:uint64 mc_bit_price_ps:uint64 mc_cell_price_ps:uint64 = StoragePrices; _ (Hashmap 32 StoragePrices) = ConfigParam 18; -gas_prices#dd gas_price:uint64 gas_limit:uint64 gas_credit:uint64 - block_gas_limit:uint64 freeze_due_limit:uint64 delete_due_limit:uint64 +_ global_id:int32 = ConfigParam 19; + +gas_prices#dd gas_price:uint64 gas_limit:uint64 gas_credit:uint64 + block_gas_limit:uint64 freeze_due_limit:uint64 delete_due_limit:uint64 = GasLimitsPrices; -gas_prices_ext#de gas_price:uint64 gas_limit:uint64 special_gas_limit:uint64 gas_credit:uint64 - block_gas_limit:uint64 freeze_due_limit:uint64 delete_due_limit:uint64 +gas_prices_ext#de gas_price:uint64 gas_limit:uint64 special_gas_limit:uint64 gas_credit:uint64 + block_gas_limit:uint64 freeze_due_limit:uint64 delete_due_limit:uint64 = GasLimitsPrices; gas_flat_pfx#d1 flat_gas_limit:uint64 flat_gas_price:uint64 other:GasLimitsPrices @@ -663,7 +706,7 @@ param_limits#c3 underload:# soft_limit:# { underload <= soft_limit } hard_limit:# { soft_limit <= hard_limit } = ParamLimits; block_limits#5d bytes:ParamLimits gas:ParamLimits lt_delta:ParamLimits = BlockLimits; - + config_mc_block_limits#_ BlockLimits = ConfigParam 22; config_block_limits#_ BlockLimits = ConfigParam 23; @@ -678,7 +721,7 @@ config_mc_fwd_prices#_ MsgForwardPrices = ConfigParam 24; // used for all other messages config_fwd_prices#_ MsgForwardPrices = ConfigParam 25; -catchain_config#c1 mc_catchain_lifetime:uint32 shard_catchain_lifetime:uint32 +catchain_config#c1 mc_catchain_lifetime:uint32 shard_catchain_lifetime:uint32 shard_validators_lifetime:uint32 shard_validators_num:uint32 = CatchainConfig; catchain_config_new#c2 flags:(## 7) { flags = 0 } shuffle_mc_validators:Bool @@ -700,7 +743,7 @@ consensus_config_v3#d8 flags:(## 7) { flags = 0 } new_catchain_ids:Bool round_candidates:(## 8) { round_candidates >= 1 } next_candidate_delay_ms:uint32 consensus_timeout_ms:uint32 fast_attempts:uint32 attempt_duration:uint32 catchain_max_deps:uint32 - max_block_bytes:uint32 max_collated_bytes:uint32 + max_block_bytes:uint32 max_collated_bytes:uint32 proto_version:uint16 = ConsensusConfig; consensus_config_v4#d9 flags:(## 7) { flags = 0 } new_catchain_ids:Bool @@ -725,7 +768,7 @@ validator_temp_key#3 adnl_addr:bits256 temp_public_key:SigPubKey seqno:# valid_u signed_temp_key#4 key:^ValidatorTempKey signature:CryptoSignature = ValidatorSignedTempKey; _ (HashmapE 256 ValidatorSignedTempKey) = ConfigParam 39; -misbehaviour_punishment_config_v1#01 +misbehaviour_punishment_config_v1#01 default_flat_fine:Grams default_proportional_fine:uint32 severity_flat_mult:uint16 severity_proportional_mult:uint16 unpunishable_interval:uint16 @@ -734,11 +777,37 @@ misbehaviour_punishment_config_v1#01 = MisbehaviourPunishmentConfig; _ MisbehaviourPunishmentConfig = ConfigParam 40; +size_limits_config#01 max_msg_bits:uint32 max_msg_cells:uint32 max_library_cells:uint32 max_vm_data_depth:uint16 + max_ext_msg_size:uint32 max_ext_msg_depth:uint16 = SizeLimitsConfig; +size_limits_config_v2#02 max_msg_bits:uint32 max_msg_cells:uint32 max_library_cells:uint32 max_vm_data_depth:uint16 + max_ext_msg_size:uint32 max_ext_msg_depth:uint16 max_acc_state_cells:uint32 max_acc_state_bits:uint32 + max_acc_public_libraries:uint32 = SizeLimitsConfig; +_ SizeLimitsConfig = ConfigParam 43; + +// key is [ wc:int32 addr:uint256 ] +suspended_address_list#00 addresses:(HashmapE 288 Unit) suspended_until:uint32 = SuspendedAddressList; +_ SuspendedAddressList = ConfigParam 44; + oracle_bridge_params#_ bridge_address:bits256 oracle_mutlisig_address:bits256 oracles:(HashmapE 256 uint256) external_chain_address:bits256 = OracleBridgeParams; _ OracleBridgeParams = ConfigParam 71; // Ethereum bridge _ OracleBridgeParams = ConfigParam 72; // Binance Smart Chain bridge _ OracleBridgeParams = ConfigParam 73; // Polygon bridge +// Note that chains in which bridge, minter and jetton-wallet operate are fixated +jetton_bridge_prices#_ bridge_burn_fee:Coins bridge_mint_fee:Coins + wallet_min_tons_for_storage:Coins + wallet_gas_consumption:Coins + minter_min_tons_for_storage:Coins + discover_gas_consumption:Coins = JettonBridgePrices; + +jetton_bridge_params_v0#00 bridge_address:bits256 oracles_address:bits256 oracles:(HashmapE 256 uint256) state_flags:uint8 burn_bridge_fee:Coins = JettonBridgeParams; +jetton_bridge_params_v1#01 bridge_address:bits256 oracles_address:bits256 oracles:(HashmapE 256 uint256) state_flags:uint8 prices:^JettonBridgePrices external_chain_address:bits256 = JettonBridgeParams; + +_ JettonBridgeParams = ConfigParam 79; // ETH->TON token bridge +_ JettonBridgeParams = ConfigParam 81; // BNB->TON token bridge +_ JettonBridgeParams = ConfigParam 82; // Polygon->TON token bridge + + // // PROOFS // @@ -749,7 +818,7 @@ block_proof#c3 proof_for:BlockIdExt root:^Cell signatures:(Maybe ^BlockSignature chain_empty$_ = ProofChain 0; chain_link$_ {n:#} root:^Cell prev:n?^(ProofChain n) = ProofChain (n + 1); -top_block_descr#d5 proof_for:BlockIdExt signatures:(Maybe ^BlockSignatures) +top_block_descr#d5 proof_for:BlockIdExt signatures:(Maybe ^BlockSignatures) len:(## 8) { len >= 1 } { len <= 8 } chain:(ProofChain len) = TopBlockDescr; // @@ -802,7 +871,7 @@ vmc_std$00 cdata:VmControlData code:VmCellSlice = VmCont; vmc_envelope$01 cdata:VmControlData next:^VmCont = VmCont; vmc_quit$1000 exit_code:int32 = VmCont; vmc_quit_exc$1001 = VmCont; -vmc_repeat$10100 count:uint63 body:^VmCont after:^VmCont = VmCont; +vmc_repeat$10100 count:uint63 body:^VmCont after:^VmCont = VmCont; vmc_until$110000 body:^VmCont after:^VmCont = VmCont; vmc_again$110001 body:^VmCont = VmCont; vmc_while_cond$110010 cond:^VmCont body:^VmCont @@ -814,7 +883,7 @@ vmc_pushint$1111 value:int32 next:^VmCont = VmCont; // // DNS RECORDS // -_ (HashmapE 256 DNSRecord) = DNS_RecordSet; +_ (HashmapE 256 ^DNSRecord) = DNS_RecordSet; chunk_ref$_ {n:#} ref:^(TextChunks (n + 1)) = TextChunkRef (n + 1); chunk_ref_empty$_ = TextChunkRef 0; @@ -840,11 +909,13 @@ cap_method_pubkey#71f4 = SmcCapability; cap_is_wallet#2177 = SmcCapability; cap_name#ff name:Text = SmcCapability; +dns_storage_address#7473 bag_id:bits256 = DNSRecord; + // // PAYMENT CHANNELS // -chan_config$_ init_timeout:uint32 close_timeout:uint32 a_key:bits256 b_key:bits256 +chan_config$_ init_timeout:uint32 close_timeout:uint32 a_key:bits256 b_key:bits256 a_addr:^MsgAddressInt b_addr:^MsgAddressInt channel_id:uint64 min_A_extra:Grams = ChanConfig; chan_state_init$000 signed_A:Bool signed_B:Bool min_A:Grams min_B:Grams expire_at:uint32 A:Grams B:Grams = ChanState; @@ -864,4 +935,4 @@ chan_signed_msg$_ sig_A:(Maybe ^bits512) sig_B:(Maybe ^bits512) msg:ChanMsg = Ch chan_op_cmd#912838d1 msg:ChanSignedMsg = ChanOp; -chan_data$_ config:^ChanConfig state:^ChanState = ChanData; +chan_data$_ config:^ChanConfig state:^ChanState = ChanData; \ No newline at end of file diff --git a/tests/fixtures/tlb/test.tlb b/tests/fixtures/tlb/test.tlb index b434a0b..1c17976 100644 --- a/tests/fixtures/tlb/test.tlb +++ b/tests/fixtures/tlb/test.tlb @@ -120,4 +120,7 @@ a$0 a:Simple = ConstructorOrder; a a:# = CheckCrc32; b b:# c:# = CheckCrc32; -a$_ const:# = CheckKeyword; \ No newline at end of file +a$_ const:# = CheckKeyword; + +a$_ {X:Type} t:# y:(Maybe ^X) = RefCombinatorInRefHelper X; +a$_ msg:^(RefCombinatorInRefHelper Any) = RefCombinatorInRef; \ No newline at end of file diff --git a/tests/my.spec.ts b/tests/my.spec.ts index 1357a5a..a260eb6 100644 --- a/tests/my.spec.ts +++ b/tests/my.spec.ts @@ -7,60 +7,27 @@ import { ast } from '../src' import { generate } from '../src/codegen/main' import { Program } from '../src/ast/nodes' -import { X, loadX, storeX } from '../generated_test' +import * as crc32 from 'crc-32'; +import { loadBlock, storeBlock } from '../generated_block' +import { Cell, beginCell , BitString} from 'ton' const fixturesDir = path.resolve(__dirname, 'fixtures') - describe('parsing into intermediate representation using grammar', () => { test('test.tlb can be parsed', () => { - // console.log(util.inspect(babelTestAst.program.body[2], false, null, true /* enable colors */)) - - expect.hasAssertions() - - const input = fs.readFileSync( - path.resolve(fixturesDir, 'tlb', 'test.tlb'), - 'utf-8', - ) - const parsed = parse(input) - - expect(parsed.shortMessage).toBe(undefined) - expect(parsed.succeeded()).toBe(true) - - const tree = ast(input) - - fs.writeFile('generated_test.ts', generate(tree), () => { }); - - expect(tree).toBeInstanceOf(Program) - }) -}) + let builder = beginCell();// + builder.storeUint(BigInt(0), 0); -describe('parsing into intermediate representation using grammar', () => { - test('my.tlb can be parsed', () => { - // console.log(util.inspect(babelTestAst.program.body[2], false, null, true /* enable colors */)) - - expect.hasAssertions() - - const input = fs.readFileSync( - path.resolve(fixturesDir, 'tlb', 'my.tlb'), - 'utf-8', - ) - const parsed = parse(input) - - expect(parsed.shortMessage).toBe(undefined) - expect(parsed.succeeded()).toBe(true) - - const tree = ast(input) + let x = beginCell().endCell().beginParse() + // let y = x.loadBits(0) - fs.writeFile('generated_my.ts', generate(tree), () => { }); - - - expect(tree).toBeInstanceOf(Program) + builder.storeBits(BitString.EMPTY) }) }) - /* storeY(y)(builder) -*/ \ No newline at end of file +*/ + +// 0010010110011011101101001111001010110000011011101110011101001101 \ No newline at end of file diff --git a/tests/tlbgen.spec.ts b/tests/tlbgen.spec.ts index 624411f..96ade9c 100644 --- a/tests/tlbgen.spec.ts +++ b/tests/tlbgen.spec.ts @@ -6,10 +6,11 @@ import { parse } from '../src' import { ast } from '../src' import { generate } from '../src/codegen/main' import { Program } from '../src/ast/nodes' -import { BitString, Slice, Builder } from 'ton' +import { BitString, Slice, Builder, Cell } from 'ton' -import { TwoConstructors, Simple, loadTwoConstructors, loadSimple, storeTwoConstructors, storeSimple, TypedParam, loadTypedParam, storeTypedParam, TypedField, loadTypedField, storeTypedField, ExprArg, BitLenArg, loadBitLenArg, storeBitLenArg, BitLenArgUser, loadBitLenArgUser, storeBitLenArgUser, ExprArgUser, loadExprArgUser, storeExprArgUser, ComplexTypedField, loadComplexTypedField, storeComplexTypedField, CellTypedField, storeCellTypedField, loadCellTypedField, CellsSimple, loadCellsSimple, storeCellsSimple, IntBitsOutside, loadIntBitsOutside, storeIntBitsOutside, IntBitsParametrizedOutside, loadIntBitsParametrizedOutside, storeIntBitsParametrizedOutside, LessThan, loadLessThan, storeLessThan, Unary, loadUnary, storeUnary, ParamConst, loadParamConst, storeParamConst, ParamDifNames, loadParamDifNames, storeParamDifNames, NegationFromImplicit, loadNegationFromImplicit, storeNegationFromImplicit, loadManyComb, storeManyComb, ManyComb, ParamDifNamesUser, loadParamDifNamesUser, storeParamDifNamesUser, UnaryUserCheckOrder, loadUnaryUserCheckOrder, storeUnaryUserCheckOrder, CombArgCellRef, loadCombArgCellRef, storeCombArgCellRef, CombArgCellRefUser, loadCombArgCellRefUser, storeCombArgCellRefUser, MathExprAsCombArg, loadMathExprAsCombArg, storeMathExprAsCombArg, SharpConstructor, loadSharpConstructor, storeSharpConstructor, EmptyTag, loadEmptyTag, storeEmptyTag, SharpTag, loadSharpTag, storeSharpTag, DollarTag, loadDollarTag, storeDollarTag, TupleCheck, loadTupleCheck, storeTupleCheck, HashmapE, loadHashmapE, storeHashmapE, HashmapEUser, loadHashmapEUser, storeHashmapEUser, ConditionalField, loadConditionalField, storeConditionalField, BitSelection, loadBitSelection, storeBitSelection, ImplicitCondition, loadImplicitCondition, storeImplicitCondition, MultipleEmptyConstructor, loadMultipleEmptyConstructor, storeMultipleEmptyConstructor, True, loadTrue, storeTrue, ParamNamedArgInSecondConstr, loadParamNamedArgInSecondConstr, storeParamNamedArgInSecondConstr, RefCombinatorAny, loadRefCombinatorAny, storeRefCombinatorAny, EqualityExpression, loadEqualityExpression, storeEqualityExpression, ConditionalRef, loadConditionalRef, storeConditionalRef, LoadFromNegationOutsideExpr, loadLoadFromNegationOutsideExpr, storeLoadFromNegationOutsideExpr, AnonymousData, loadAnonymousData, storeAnonymousData, FalseAnonField, loadFalseAnonField, storeFalseAnonField, ConstructorOrder, loadConstructorOrder, storeConstructorOrder, CheckCrc32, loadCheckCrc32, storeCheckCrc32, CheckKeyword, loadCheckKeyword, storeCheckKeyword } from '../generated_test' +import { TwoConstructors, Simple, loadTwoConstructors, loadSimple, storeTwoConstructors, storeSimple, TypedParam, loadTypedParam, storeTypedParam, TypedField, loadTypedField, storeTypedField, ExprArg, BitLenArg, loadBitLenArg, storeBitLenArg, BitLenArgUser, loadBitLenArgUser, storeBitLenArgUser, ExprArgUser, loadExprArgUser, storeExprArgUser, ComplexTypedField, loadComplexTypedField, storeComplexTypedField, CellTypedField, storeCellTypedField, loadCellTypedField, CellsSimple, loadCellsSimple, storeCellsSimple, IntBitsOutside, loadIntBitsOutside, storeIntBitsOutside, IntBitsParametrizedOutside, loadIntBitsParametrizedOutside, storeIntBitsParametrizedOutside, LessThan, loadLessThan, storeLessThan, Unary, loadUnary, storeUnary, ParamConst, loadParamConst, storeParamConst, ParamDifNames, loadParamDifNames, storeParamDifNames, NegationFromImplicit, loadNegationFromImplicit, storeNegationFromImplicit, loadManyComb, storeManyComb, ManyComb, ParamDifNamesUser, loadParamDifNamesUser, storeParamDifNamesUser, UnaryUserCheckOrder, loadUnaryUserCheckOrder, storeUnaryUserCheckOrder, CombArgCellRef, loadCombArgCellRef, storeCombArgCellRef, CombArgCellRefUser, loadCombArgCellRefUser, storeCombArgCellRefUser, MathExprAsCombArg, loadMathExprAsCombArg, storeMathExprAsCombArg, SharpConstructor, loadSharpConstructor, storeSharpConstructor, EmptyTag, loadEmptyTag, storeEmptyTag, SharpTag, loadSharpTag, storeSharpTag, DollarTag, loadDollarTag, storeDollarTag, TupleCheck, loadTupleCheck, storeTupleCheck, HashmapE, loadHashmapE, storeHashmapE, HashmapEUser, loadHashmapEUser, storeHashmapEUser, ConditionalField, loadConditionalField, storeConditionalField, BitSelection, loadBitSelection, storeBitSelection, ImplicitCondition, loadImplicitCondition, storeImplicitCondition, MultipleEmptyConstructor, loadMultipleEmptyConstructor, storeMultipleEmptyConstructor, True, loadTrue, storeTrue, ParamNamedArgInSecondConstr, loadParamNamedArgInSecondConstr, storeParamNamedArgInSecondConstr, RefCombinatorAny, loadRefCombinatorAny, storeRefCombinatorAny, EqualityExpression, loadEqualityExpression, storeEqualityExpression, ConditionalRef, loadConditionalRef, storeConditionalRef, LoadFromNegationOutsideExpr, loadLoadFromNegationOutsideExpr, storeLoadFromNegationOutsideExpr, AnonymousData, loadAnonymousData, storeAnonymousData, FalseAnonField, loadFalseAnonField, storeFalseAnonField, ConstructorOrder, loadConstructorOrder, storeConstructorOrder, CheckCrc32, loadCheckCrc32, storeCheckCrc32, CheckKeyword, loadCheckKeyword, storeCheckKeyword, RefCombinatorInRef, loadRefCombinatorInRef, storeRefCombinatorInRef} from '../generated_test' import { beginCell } from 'ton' +import { loadBit, loadBlock, storeBlock } from '../generated_block' const fixturesDir = path.resolve(__dirname, 'fixtures') @@ -96,19 +97,8 @@ export type TLFunction = { encode: any }; -function theEncode(a: number, b: number, c: number) { - console.log(a, b, c); -} - -function callf(x: TLFunction) { - x.encode(5, 6, 7); -} - describe('Generating tlb code', () => { test('Basic types', () => { - let tlf: TLFunction = {decode: null, encode:theEncode} - callf(tlf); - expect.hasAssertions() let simple: Simple = { kind: 'Simple', a: 827, b: 387 } @@ -125,17 +115,17 @@ describe('Generating tlb code', () => { checkSameOnStoreLoad(typedParamValue, loadTypedParam, storeTypedParam); let typedParamNothing: TypedParam = {'kind': 'TypedParam', x:{'kind': 'Maybe_nothing'}} checkSameOnStoreLoad(typedParamNothing, loadTypedParam, storeTypedParam); - let bitlenArgUser: BitLenArgUser = {'kind': 'BitLenArgUser', t: {'kind': 'BitLenArg', x: 4, value: 10}} + let bitlenArgUser: BitLenArgUser = {'kind': 'BitLenArgUser', t: {'kind': 'BitLenArg', x: 4, value: BigInt(10)}} checkSameOnStoreLoad(bitlenArgUser, loadBitLenArgUser, storeBitLenArgUser); - let bitlenArgUserIncorrect: BitLenArgUser = {'kind': 'BitLenArgUser', t: {'kind': 'BitLenArg', x: 3, value: 10}} + let bitlenArgUserIncorrect: BitLenArgUser = {'kind': 'BitLenArgUser', t: {'kind': 'BitLenArg', x: 3, value: BigInt(10)}} checkThrowOnStoreLoad(bitlenArgUserIncorrect, loadBitLenArgUser, storeBitLenArgUser); - let exprArgUser: ExprArgUser = {'kind': 'ExprArgUser', t: {'kind': 'ExprArg', x: 4, value: 10}} + let exprArgUser: ExprArgUser = {'kind': 'ExprArgUser', t: {'kind': 'ExprArg', x: 4, value: BigInt(10)}} checkSameOnStoreLoad(exprArgUser, loadExprArgUser, storeExprArgUser); - let exprArgUserIncorrect: ExprArgUser = {'kind': 'ExprArgUser', t: {'kind': 'ExprArg', x: 5, value: 10}} + let exprArgUserIncorrect: ExprArgUser = {'kind': 'ExprArgUser', t: {'kind': 'ExprArg', x: 5, value: BigInt(10)}} checkDifferOnStoreLoad(exprArgUserIncorrect, loadExprArgUser, storeExprArgUser); - let complexTypedField: ComplexTypedField = {'kind': 'ComplexTypedField', a:{'kind': 'ExprArgUser', t: {'kind': 'ExprArg', x: 4, value: 10}}} + let complexTypedField: ComplexTypedField = {'kind': 'ComplexTypedField', a:{'kind': 'ExprArgUser', t: {'kind': 'ExprArg', x: 4, value: BigInt(10)}}} checkSameOnStoreLoad(complexTypedField, loadComplexTypedField, storeComplexTypedField); - let cellTypedField: CellTypedField = {'kind': 'CellTypedField', a:{'kind': 'ExprArgUser', t: {'kind': 'ExprArg', x: 4, value: 10}}} + let cellTypedField: CellTypedField = {'kind': 'CellTypedField', a:{'kind': 'ExprArgUser', t: {'kind': 'ExprArg', x: 4, value: BigInt(10)}}} checkSameOnStoreLoad(cellTypedField, loadCellTypedField, storeCellTypedField); let lessThan: LessThan = {kind: 'LessThan', x: 3, y: 7} checkSameOnStoreLoad(lessThan, loadLessThan, storeLessThan); @@ -151,6 +141,9 @@ describe('Generating tlb code', () => { checkSameOnStoreLoad(falseAnonField, loadFalseAnonField, storeFalseAnonField) let checkKeyword: CheckKeyword = {kind: 'CheckKeyword', const0: 3} checkSameOnStoreLoad(checkKeyword, loadCheckKeyword, storeCheckKeyword); + + let checkBigInt: BitLenArg = {kind: 'BitLenArg', x: 100, value: BigInt(2709958555) * BigInt(1e9) + BigInt(228628813)} + checkSameOnStoreLoad(checkBigInt, (slice: Slice) => {return loadBitLenArg(slice, checkBigInt.x)}, storeBitLenArg) }) test('Combinators', () => { @@ -161,8 +154,17 @@ describe('Generating tlb code', () => { checkThrowOnStoreLoad(manyCombIncorrect, loadManyComb, storeManyComb); let combArgCellRefUser: CombArgCellRefUser = {kind: 'CombArgCellRefUser', x: {kind: 'CombArgCellRef', body: {'kind': 'Either_right', value: 3}, info: 4, other: {kind: 'Either_right', value: {kind: 'OneComb', t: 5, x: 5}}, init: {kind: 'Maybe_just', value: {kind: 'Either_right', value: 4}}}} checkSameOnStoreLoad(combArgCellRefUser, loadCombArgCellRefUser, storeCombArgCellRefUser); - let mathExprAsCombArg: MathExprAsCombArg = {kind: 'MathExprAsCombArg', n: 8, ref: {kind: 'BitLenArg', x: 10, value: 1000}} + let mathExprAsCombArg: MathExprAsCombArg = {kind: 'MathExprAsCombArg', n: 8, ref: {kind: 'BitLenArg', x: 10, value: BigInt(1000)}} checkSameOnStoreLoad(mathExprAsCombArg, (slice: Slice) => {return loadMathExprAsCombArg(slice, mathExprAsCombArg.n + 2)}, storeMathExprAsCombArg); + + let refCombinatorAny: RefCombinatorAny = { + kind: 'RefCombinatorAny', + msg: {kind: 'Maybe_just', value: beginCell().storeUint(676, 10).endCell().beginParse()} + } + checkSameOnStoreLoad(refCombinatorAny, loadRefCombinatorAny, storeRefCombinatorAny); + + let msgEnvelope: RefCombinatorInRef = {kind: 'RefCombinatorInRef', msg: {kind: 'RefCombinatorInRefHelper', t: 3, y: {kind: 'Maybe_just', value: beginCell().storeUint(3, 32).endCell().beginParse()}} } + checkSameOnStoreLoad(msgEnvelope, loadRefCombinatorInRef, storeRefCombinatorInRef); }); test('Naming', () => { @@ -221,7 +223,7 @@ describe('Generating tlb code', () => { loadImplicitCondition(implicitConditionIncorrectCell) }).toThrow(Error); - let implicitConditionCell = beginCell().storeUint(0xd86a5028, 32).storeUint(100, 10).endCell().beginParse(); + let implicitConditionCell = beginCell().storeUint(100, 10).endCell().beginParse(); expect(loadImplicitCondition(implicitConditionCell).flags == 100).toBeTruthy() let equalityExpression: EqualityExpression = {kind: 'EqualityExpression', n: 2} @@ -332,7 +334,7 @@ describe('Generating tlb code', () => { checkSameOnStoreLoad(emptyTag, loadEmptyTag, storeEmptyTag); let emptyTagCell = beginCell(); storeEmptyTag(emptyTag)(emptyTagCell); - expect(emptyTagCell.endCell().beginParse().remainingBits == 64).toBeTruthy(); + expect(emptyTagCell.endCell().beginParse().remainingBits == 32).toBeTruthy(); let sharpTag: SharpTag = {kind: 'SharpTag', x: 3} checkSameOnStoreLoad(sharpTag, loadSharpTag, storeSharpTag); @@ -358,6 +360,9 @@ describe('Generating tlb code', () => { let checkCrc32B: CheckCrc32 = {kind: 'CheckCrc32_b', b: 4, c: 5} checkSameOnStoreLoad(checkCrc32B, loadCheckCrc32, storeCheckCrc32); + + let checkCrc32AOpCode = beginCell().storeUint(0x9d97e7a, 32).storeUint(76, 32).endCell().beginParse(); + loadCheckCrc32(checkCrc32AOpCode); }) test('Advanced types', () => { @@ -440,7 +445,7 @@ describe('Generating tlb code', () => { x: { 'kind': 'IntBitsInside', a: { - 'kind': 'IntBits', arg: 3, d: 5, + 'kind': 'IntBits', arg: BigInt(3), d: 5, g: beginCell().storeUint(3, 2).endCell().beginParse().loadBits(2), x: beginCell().storeUint(76, 10).endCell().beginParse() }, @@ -454,7 +459,7 @@ describe('Generating tlb code', () => { x: { kind: 'IntBitsParametrizedInside', a: { - kind: 'IntBitsParametrized', e: 5, f: 3, h: 7, j: 9, k: 10, + kind: 'IntBitsParametrized', e: 5, f: BigInt(3), h: BigInt(7), j: 9, k: BigInt(10), i: beginCell().storeUint(676, 10).endCell().beginParse().loadBits(10), tc: beginCell().storeUint(76, 10).endCell().beginParse() }, @@ -468,7 +473,7 @@ describe('Generating tlb code', () => { x: { kind: 'IntBitsParametrizedInside', a: { - kind: 'IntBitsParametrized', e: 6, f: 3, h: 7, j: 9, k: 10, + kind: 'IntBitsParametrized', e: 6, f: BigInt(3), h: BigInt(7), j: 9, k: BigInt(10), i: beginCell().storeUint(676, 10).endCell().beginParse().loadBits(10), tc: beginCell().storeUint(76, 10).endCell().beginParse() }, @@ -476,11 +481,16 @@ describe('Generating tlb code', () => { } } checkDifferOnStoreLoad(intBitsParametrizedOutsideIncorrect, loadIntBitsParametrizedOutside, storeIntBitsParametrizedOutside); + }) - let refCombinatorAny: RefCombinatorAny = { - kind: 'RefCombinatorAny', - msg: {kind: 'Maybe_just', value: beginCell().storeUint(676, 10).endCell().beginParse()} - } - checkSameOnStoreLoad(refCombinatorAny, loadRefCombinatorAny, storeRefCombinatorAny); + test('block tlb tests', () => { + const state = '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'; + const cs = Cell.fromBase64(state); + + let blk = loadBlock(cs.beginParse()); + let builder = beginCell(); + storeBlock(blk)(builder); + + expect(deepEqual(cs.hash(), builder.endCell().hash())).toBeTruthy() }) })