From 2621e5fc10af072ac6764fbb2f2391e16515a1c2 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Tue, 12 Dec 2023 20:10:06 -0500 Subject: [PATCH 01/14] tmp --- tests/fixtures/tlb/block.tlb | 295 ++++++++++++++++++++++------------- 1 file changed, 183 insertions(+), 112 deletions(-) diff --git a/tests/fixtures/tlb/block.tlb b/tests/fixtures/tlb/block.tlb index 9bb6613..b67a1a5 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 @@ -268,11 +276,11 @@ transaction$0111 account_addr:bits256 lt:uint64 total_fees:CurrencyCollection state_update:^(HASH_UPDATE Account) description:^TransactionDescr = Transaction; -merkle_update#02 {X:Type} old_hash:bits256 new_hash:bits256 +!merkle_update#02 {X:Type} old_hash:bits256 new_hash:bits256 old:^X new:^X = MERKLE_UPDATE X; update_hashes#72 {X:Type} old_hash:bits256 new_hash:bits256 = HASH_UPDATE X; -merkle_proof#03 {X:Type} virtual_hash:bits256 depth:uint16 virtual_root:^X = MERKLE_PROOF X; +!merkle_proof#03 {X:Type} virtual_hash:bits256 depth:uint16 virtual_root:^X = MERKLE_PROOF X; acc_trans#5 account_addr:bits256 transactions:(HashmapAug 64 ^Transaction CurrencyCollection) @@ -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 From 9481a7a1cbfe8ad71babf30c317be69a0eb6639a Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Tue, 12 Dec 2023 21:48:10 -0500 Subject: [PATCH 02/14] tmp --- generated_block.ts | 1400 +++++++++++++++++++++++++++------- generated_test.ts | 36 +- kek.txt | 327 ++++++++ src/codegen/helpers.ts | 20 +- tests/fixtures/tlb/block.tlb | 4 +- tests/my.spec.ts | 69 +- tests/tlbgen.spec.ts | 30 +- 7 files changed, 1540 insertions(+), 346 deletions(-) create mode 100644 kek.txt diff --git a/generated_block.ts b/generated_block.ts index 1955251..46fc466 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -329,6 +329,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 +412,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 +829,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 +843,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 +967,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; @@ -1122,7 +1141,7 @@ export interface Block { readonly global_id: number; readonly info: BlockInfo; readonly value_flow: ValueFlow; - readonly state_update: MERKLE_UPDATE; + // readonly state_update: MERKLE_UPDATE; readonly extra: BlockExtra; } @@ -1136,13 +1155,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; @@ -1429,7 +1464,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__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 | 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 interface ConfigParam__ { readonly kind: 'ConfigParam__'; @@ -1458,148 +1493,183 @@ 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__25 { - readonly kind: 'ConfigParam__25'; - readonly anon0: ConsensusConfig; +export interface ConfigParam__19 { + readonly kind: 'ConfigParam__19'; + readonly global_id: number; } 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__40 { + readonly kind: 'ConfigParam__40'; + readonly anon0: OracleBridgeParams; +} + +export interface ConfigParam__41 { + readonly kind: 'ConfigParam__41'; + readonly anon0: OracleBridgeParams; +} + +export interface ConfigParam__42 { + readonly kind: 'ConfigParam__42'; + readonly anon0: JettonBridgeParams; +} + +export interface ConfigParam__43 { + readonly kind: 'ConfigParam__43'; + readonly anon0: JettonBridgeParams; +} + +export interface ConfigParam__44 { + readonly kind: 'ConfigParam__44'; + readonly anon0: JettonBridgeParams; +} + export interface ConfigParam_config_mc_gas_prices { readonly kind: 'ConfigParam_config_mc_gas_prices'; readonly anon0: GasLimitsPrices; @@ -1630,6 +1700,13 @@ export interface 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 { readonly kind: 'GlobalVersion'; readonly version: number; @@ -1690,8 +1767,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 +1807,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 +1994,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 +2033,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 +2380,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 +2406,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,7 +3051,7 @@ 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))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x13b7747e))) { slice.loadUint(32); let _: Hashmap = loadHashmap(slice, n, loadTrue); return { @@ -2895,7 +3066,7 @@ export function loadBitstringSet(slice: Slice, n: number): BitstringSet { export function storeBitstringSet(bitstringSet: BitstringSet): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xda553663, 32); + builder.storeUint(0x13b7747e, 32); storeHashmap(bitstringSet._, storeTrue)(builder); }) @@ -3463,7 +3634,7 @@ export function storeMsgAddressInt(msgAddressInt: MsgAddressInt): (builder: Buil } export function loadMsgAddress(slice: Slice): MsgAddress { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xef3a10fa))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x606aa05e))) { slice.loadUint(32); let _: MsgAddressInt = loadMsgAddressInt(slice); return { @@ -3472,7 +3643,7 @@ export function loadMsgAddress(slice: Slice): MsgAddress { } } - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf942fd1))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x21d0382b))) { slice.loadUint(32); let _: MsgAddressExt = loadMsgAddressExt(slice); return { @@ -3487,14 +3658,14 @@ 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); + builder.storeUint(0x606aa05e, 32); storeMsgAddressInt(msgAddress._)(builder); }) } if ((msgAddress.kind == 'MsgAddress__1')) { return ((builder: Builder) => { - builder.storeUint(0xcf942fd1, 32); + builder.storeUint(0x21d0382b, 32); storeMsgAddressExt(msgAddress._)(builder); }) @@ -3558,6 +3729,27 @@ export function storeGrams(grams: Grams): (builder: Builder) => void { } +export function loadCoins(slice: Slice): Coins { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x258097e8))) { + slice.loadUint(32); + let grams: Grams = loadGrams(slice); + return { + kind: 'Coins', + grams: grams, + } + + } + throw new Error(''); +} + +export function storeCoins(coins: Coins): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x258097e8, 32); + storeGrams(coins.grams)(builder); + }) + +} + export function loadExtraCurrencyCollection(slice: Slice): ExtraCurrencyCollection { let dict: HashmapE = loadHashmapE(slice, 32, ((slice: Slice) => { return loadVarUInteger(slice, 32) @@ -3795,7 +3987,7 @@ export function storeTickTock(tickTock: TickTock): (builder: Builder) => void { } export function loadStateInit(slice: Slice): StateInit { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x91231967))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x6fb8b949))) { slice.loadUint(32); let split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { return slice.loadUint(5) @@ -3812,7 +4004,11 @@ export function loadStateInit(slice: Slice): StateInit { return slice1 })); - let library: HashmapE = loadHashmapE(slice, 256, loadSimpleLib); + let library: Maybe = loadMaybe(slice, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return slice1 + + })); return { kind: 'StateInit', split_depth: split_depth, @@ -3828,7 +4024,7 @@ export function loadStateInit(slice: Slice): StateInit { export function storeStateInit(stateInit: StateInit): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x91231967, 32); + builder.storeUint(0x6fb8b949, 32); storeMaybe(stateInit.split_depth, ((arg: number) => { return ((builder: Builder) => { builder.storeUint(arg, 5); @@ -3854,7 +4050,80 @@ 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 loadStateInitWithLibs(slice: Slice): StateInitWithLibs { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x458004e3))) { + slice.loadUint(32); + 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, + } + + } + throw new Error(''); +} + +export function storeStateInitWithLibs(stateInitWithLibs: StateInitWithLibs): (builder: Builder) => void { + return ((builder: Builder) => { + builder.storeUint(0x458004e3, 32); + 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); }) } @@ -3990,7 +4259,7 @@ export function storeMessageRelaxed(messageRelaxed: MessageRelaxed, storeX } export function loadMessageAny(slice: Slice): MessageAny { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9c54aa4b))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x2ac89f2a))) { slice.loadUint(32); let anon0: Message = loadMessage(slice, ((slice: Slice) => { return slice @@ -4007,7 +4276,7 @@ export function loadMessageAny(slice: Slice): MessageAny { export function storeMessageAny(messageAny: MessageAny): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x9c54aa4b, 32); + builder.storeUint(0x2ac89f2a, 32); storeMessage(messageAny.anon0, ((arg: Slice) => { return ((builder: Builder) => { builder.storeSlice(arg); @@ -4364,7 +4633,7 @@ export function storeImportFees(importFees: ImportFees): (builder: Builder) => v } export function loadInMsgDescr(slice: Slice): InMsgDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8615b8fd))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x59519ebf))) { slice.loadUint(32); let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadInMsg, loadImportFees); return { @@ -4378,7 +4647,7 @@ export function loadInMsgDescr(slice: Slice): InMsgDescr { export function storeInMsgDescr(inMsgDescr: InMsgDescr): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x8615b8fd, 32); + builder.storeUint(0x59519ebf, 32); storeHashmapAugE(inMsgDescr.anon0, storeInMsg, storeImportFees)(builder); }) @@ -4604,7 +4873,7 @@ export function storeOutMsg(outMsg: OutMsg): (builder: Builder) => void { } export function loadEnqueuedMsg(slice: Slice): EnqueuedMsg { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98cd4c6e))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x1006a25f))) { slice.loadUint(32); let enqueued_lt: number = slice.loadUint(64); let slice1 = slice.loadRef().beginParse(); @@ -4621,7 +4890,7 @@ export function loadEnqueuedMsg(slice: Slice): EnqueuedMsg { export function storeEnqueuedMsg(enqueuedMsg: EnqueuedMsg): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x98cd4c6e, 32); + builder.storeUint(0x1006a25f, 32); builder.storeUint(enqueuedMsg.enqueued_lt, 64); let cell1 = beginCell(); storeMsgEnvelope(enqueuedMsg.out_msg)(cell1); @@ -4631,7 +4900,7 @@ export function storeEnqueuedMsg(enqueuedMsg: EnqueuedMsg): (builder: Builder) = } export function loadOutMsgDescr(slice: Slice): OutMsgDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xbcd61b19))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x67a8b3c9))) { slice.loadUint(32); let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadOutMsg, loadCurrencyCollection); return { @@ -4645,14 +4914,14 @@ export function loadOutMsgDescr(slice: Slice): OutMsgDescr { export function storeOutMsgDescr(outMsgDescr: OutMsgDescr): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xbcd61b19, 32); + builder.storeUint(0x67a8b3c9, 32); storeHashmapAugE(outMsgDescr.anon0, storeOutMsg, storeCurrencyCollection)(builder); }) } export function loadOutMsgQueue(slice: Slice): OutMsgQueue { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xcf5f0da2))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4ef24409))) { slice.loadUint(32); let anon0: HashmapAugE = loadHashmapAugE(slice, 352, loadEnqueuedMsg, ((slice: Slice) => { return slice.loadUint(64) @@ -4669,7 +4938,7 @@ export function loadOutMsgQueue(slice: Slice): OutMsgQueue { export function storeOutMsgQueue(outMsgQueue: OutMsgQueue): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xcf5f0da2, 32); + builder.storeUint(0x4ef24409, 32); storeHashmapAugE(outMsgQueue.anon0, storeEnqueuedMsg, ((arg: number) => { return ((builder: Builder) => { builder.storeUint(arg, 64); @@ -4700,7 +4969,7 @@ export function storeProcessedUpto(processedUpto: ProcessedUpto): (builder: Buil } export function loadProcessedInfo(slice: Slice): ProcessedInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x982f4fa3))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x155266c0))) { slice.loadUint(32); let anon0: HashmapE = loadHashmapE(slice, 96, loadProcessedUpto); return { @@ -4714,7 +4983,7 @@ export function loadProcessedInfo(slice: Slice): ProcessedInfo { export function storeProcessedInfo(processedInfo: ProcessedInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x982f4fa3, 32); + builder.storeUint(0x155266c0, 32); storeHashmapE(processedInfo.anon0, storeProcessedUpto)(builder); }) @@ -4737,7 +5006,7 @@ export function storeIhrPendingSince(ihrPendingSince: IhrPendingSince): (builder } export function loadIhrPendingInfo(slice: Slice): IhrPendingInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc31463df))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5a108747))) { slice.loadUint(32); let anon0: HashmapE = loadHashmapE(slice, 320, loadIhrPendingSince); return { @@ -4751,14 +5020,14 @@ export function loadIhrPendingInfo(slice: Slice): IhrPendingInfo { export function storeIhrPendingInfo(ihrPendingInfo: IhrPendingInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xc31463df, 32); + builder.storeUint(0x5a108747, 32); storeHashmapE(ihrPendingInfo.anon0, storeIhrPendingSince)(builder); }) } export function loadOutMsgQueueInfo(slice: Slice): OutMsgQueueInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x98bb9b21))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xae4d516))) { slice.loadUint(32); let out_queue: OutMsgQueue = loadOutMsgQueue(slice); let proc_info: ProcessedInfo = loadProcessedInfo(slice); @@ -4776,7 +5045,7 @@ export function loadOutMsgQueueInfo(slice: Slice): OutMsgQueueInfo { export function storeOutMsgQueueInfo(outMsgQueueInfo: OutMsgQueueInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x98bb9b21, 32); + builder.storeUint(0xae4d516, 32); storeOutMsgQueue(outMsgQueueInfo.out_queue)(builder); storeProcessedInfo(outMsgQueueInfo.proc_info)(builder); storeIhrPendingInfo(outMsgQueueInfo.ihr_pending)(builder); @@ -5070,7 +5339,7 @@ export function storeDepthBalanceInfo(depthBalanceInfo: DepthBalanceInfo): (buil } export function loadShardAccounts(slice: Slice): ShardAccounts { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xa59aef08))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x6aced5bb))) { slice.loadUint(32); let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadShardAccount, loadDepthBalanceInfo); return { @@ -5084,7 +5353,7 @@ export function loadShardAccounts(slice: Slice): ShardAccounts { export function storeShardAccounts(shardAccounts: ShardAccounts): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xa59aef08, 32); + builder.storeUint(0x6aced5bb, 32); storeHashmapAugE(shardAccounts.anon0, storeShardAccount, storeDepthBalanceInfo)(builder); }) @@ -5329,7 +5598,7 @@ export function storeAccountBlock(accountBlock: AccountBlock): (builder: Builder } export function loadShardAccountBlocks(slice: Slice): ShardAccountBlocks { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc67c889))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x31fb3c58))) { slice.loadUint(32); let anon0: HashmapAugE = loadHashmapAugE(slice, 256, loadAccountBlock, loadCurrencyCollection); return { @@ -5343,7 +5612,7 @@ export function loadShardAccountBlocks(slice: Slice): ShardAccountBlocks { export function storeShardAccountBlocks(shardAccountBlocks: ShardAccountBlocks): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xdc67c889, 32); + builder.storeUint(0x31fb3c58, 32); storeHashmapAugE(shardAccountBlocks.anon0, storeAccountBlock, storeCurrencyCollection)(builder); }) @@ -5553,6 +5822,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 +5851,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 +6280,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 +6294,7 @@ export function loadSmartContractInfo(slice: Slice): SmartContractInfo { rand_seed: rand_seed, balance_remaining: balance_remaining, myself: myself, + global_config: global_config, } } @@ -6025,6 +6312,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 +6403,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, @@ -6161,9 +6451,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,7 +6706,7 @@ export function storeShardStateUnsplit(shardStateUnsplit: ShardStateUnsplit): (b } export function loadShardState(slice: Slice): ShardState { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x81e52440))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x313f365c))) { slice.loadUint(32); let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice); return { @@ -6447,7 +6734,7 @@ export function loadShardState(slice: Slice): ShardState { export function storeShardState(shardState: ShardState): (builder: Builder) => void { if ((shardState.kind == 'ShardState__')) { return ((builder: Builder) => { - builder.storeUint(0x81e52440, 32); + builder.storeUint(0x313f365c, 32); storeShardStateUnsplit(shardState.anon0)(builder); }) @@ -6673,8 +6960,9 @@ 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 slice3 = slice.loadRef().beginParse(); + // let state_update: MERKLE_UPDATE = loadMERKLE_UPDATE(slice3, loadShardState); let slice4 = slice.loadRef().beginParse(); let extra: BlockExtra = loadBlockExtra(slice4); return { @@ -6682,7 +6970,7 @@ export function loadBlock(slice: Slice): Block { global_id: global_id, info: info, value_flow: value_flow, - state_update: state_update, + // state_update: state_update, extra: extra, } @@ -6701,7 +6989,7 @@ export function storeBlock(block: Block): (builder: Builder) => void { storeValueFlow(block.value_flow)(cell2); builder.storeRef(cell2); let cell3 = beginCell(); - storeMERKLE_UPDATE(block.state_update, storeShardState)(cell3); + // storeMERKLE_UPDATE(block.state_update, storeShardState)(cell3); builder.storeRef(cell3); let cell4 = beginCell(); storeBlockExtra(block.extra)(cell4); @@ -6711,7 +6999,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 +7030,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 +7056,7 @@ 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); @@ -6782,7 +7070,7 @@ export function loadValueFlow(slice: Slice): ValueFlow { let created: CurrencyCollection = loadCurrencyCollection(slice2); let minted: CurrencyCollection = loadCurrencyCollection(slice2); return { - kind: 'ValueFlow', + kind: 'ValueFlow_value_flow', from_prev_blk: from_prev_blk, to_next_blk: to_next_blk, imported: imported, @@ -6795,27 +7083,79 @@ export function loadValueFlow(slice: Slice): ValueFlow { } } - throw new Error(''); -} - -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 (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x3ebf98b7))) { + 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 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_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, + minted: minted, + } + + } + throw new Error(''); +} +export function storeValueFlow(valueFlow: ValueFlow): (builder: Builder) => void { + 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,7 +7430,7 @@ export function storeShardDescr(shardDescr: ShardDescr): (builder: Builder) => v } export function loadShardHashes(slice: Slice): ShardHashes { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd7c80ab1))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x7bea3589))) { slice.loadUint(32); let anon0: HashmapE> = loadHashmapE>(slice, 32, ((slice: Slice) => { let slice1 = slice.loadRef().beginParse(); @@ -7108,7 +7448,7 @@ export function loadShardHashes(slice: Slice): ShardHashes { export function storeShardHashes(shardHashes: ShardHashes): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xd7c80ab1, 32); + builder.storeUint(0x7bea3589, 32); storeHashmapE>(shardHashes.anon0, ((arg: BinTree) => { return ((builder: Builder) => { let cell1 = beginCell(); @@ -7178,7 +7518,7 @@ export function storeBinTreeAug(binTreeAug: BinTreeAug, storeX: (x: } export function loadShardFeeCreated(slice: Slice): ShardFeeCreated { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe537952e))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8269845))) { slice.loadUint(32); let fees: CurrencyCollection = loadCurrencyCollection(slice); let create: CurrencyCollection = loadCurrencyCollection(slice); @@ -7194,7 +7534,7 @@ export function loadShardFeeCreated(slice: Slice): ShardFeeCreated { export function storeShardFeeCreated(shardFeeCreated: ShardFeeCreated): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xe537952e, 32); + builder.storeUint(0x8269845, 32); storeCurrencyCollection(shardFeeCreated.fees)(builder); storeCurrencyCollection(shardFeeCreated.create)(builder); }) @@ -7202,7 +7542,7 @@ export function storeShardFeeCreated(shardFeeCreated: ShardFeeCreated): (builder } export function loadShardFees(slice: Slice): ShardFees { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xfea0d880))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x6136639f))) { slice.loadUint(32); let anon0: HashmapAugE = loadHashmapAugE(slice, 96, loadShardFeeCreated, loadShardFeeCreated); return { @@ -7216,14 +7556,14 @@ export function loadShardFees(slice: Slice): ShardFees { export function storeShardFees(shardFees: ShardFees): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xfea0d880, 32); + builder.storeUint(0x6136639f, 32); storeHashmapAugE(shardFees.anon0, storeShardFeeCreated, storeShardFeeCreated)(builder); }) } export function loadConfigParams(slice: Slice): ConfigParams { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x88116702))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x44d63bde))) { slice.loadUint(32); let config_addr: BitString = slice.loadBits(256); let slice1 = slice.loadRef().beginParse(); @@ -7244,7 +7584,7 @@ export function loadConfigParams(slice: Slice): ConfigParams { export function storeConfigParams(configParams: ConfigParams): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x88116702, 32); + builder.storeUint(0x44d63bde, 32); builder.storeBits(configParams.config_addr); let cell1 = beginCell(); storeHashmap(configParams.config, ((arg: Slice) => { @@ -7303,7 +7643,7 @@ export function storeValidatorBaseInfo(validatorBaseInfo: ValidatorBaseInfo): (b } export function loadKeyMaxLt(slice: Slice): KeyMaxLt { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x9a6d79a5))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5da0639c))) { slice.loadUint(32); let key: Bool = loadBool(slice); let max_end_lt: number = slice.loadUint(64); @@ -7319,7 +7659,7 @@ export function loadKeyMaxLt(slice: Slice): KeyMaxLt { export function storeKeyMaxLt(keyMaxLt: KeyMaxLt): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x9a6d79a5, 32); + builder.storeUint(0x5da0639c, 32); storeBool(keyMaxLt.key)(builder); builder.storeUint(keyMaxLt.max_end_lt, 64); }) @@ -7327,7 +7667,7 @@ export function storeKeyMaxLt(keyMaxLt: KeyMaxLt): (builder: Builder) => void { } export function loadKeyExtBlkRef(slice: Slice): KeyExtBlkRef { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafeab488))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xaa27f21))) { slice.loadUint(32); let key: Bool = loadBool(slice); let blk_ref: ExtBlkRef = loadExtBlkRef(slice); @@ -7343,7 +7683,7 @@ export function loadKeyExtBlkRef(slice: Slice): KeyExtBlkRef { export function storeKeyExtBlkRef(keyExtBlkRef: KeyExtBlkRef): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xafeab488, 32); + builder.storeUint(0xaa27f21, 32); storeBool(keyExtBlkRef.key)(builder); storeExtBlkRef(keyExtBlkRef.blk_ref)(builder); }) @@ -7351,7 +7691,7 @@ export function storeKeyExtBlkRef(keyExtBlkRef: KeyExtBlkRef): (builder: Builder } export function loadOldMcBlocksInfo(slice: Slice): OldMcBlocksInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xf385c1e3))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x725093d))) { slice.loadUint(32); let anon0: HashmapAugE = loadHashmapAugE(slice, 32, loadKeyExtBlkRef, loadKeyMaxLt); return { @@ -7365,7 +7705,7 @@ export function loadOldMcBlocksInfo(slice: Slice): OldMcBlocksInfo { export function storeOldMcBlocksInfo(oldMcBlocksInfo: OldMcBlocksInfo): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xf385c1e3, 32); + builder.storeUint(0x725093d, 32); storeHashmapAugE(oldMcBlocksInfo.anon0, storeKeyExtBlkRef, storeKeyMaxLt)(builder); }) @@ -7564,7 +7904,7 @@ export function storeCryptoSignatureSimple(cryptoSignatureSimple: CryptoSignatur } export function loadCryptoSignature(slice: Slice): CryptoSignature { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdaa99887))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x232dece3))) { slice.loadUint(32); let anon0: CryptoSignatureSimple = loadCryptoSignatureSimple(slice); return { @@ -7591,7 +7931,7 @@ export function loadCryptoSignature(slice: Slice): CryptoSignature { export function storeCryptoSignature(cryptoSignature: CryptoSignature): (builder: Builder) => void { if ((cryptoSignature.kind == 'CryptoSignature__')) { return ((builder: Builder) => { - builder.storeUint(0xdaa99887, 32); + builder.storeUint(0x232dece3, 32); storeCryptoSignatureSimple(cryptoSignature.anon0)(builder); }) @@ -7904,7 +8244,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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x73a8e939) && (arg0 == 0)))) { slice.loadUint(32); let config_addr: BitString = slice.loadBits(256); return { @@ -7913,7 +8253,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x84659d0d) && (arg0 == 1)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x54b6a30e) && (arg0 == 1)))) { slice.loadUint(32); let elector_addr: BitString = slice.loadBits(256); return { @@ -7922,7 +8262,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8648b2c4) && (arg0 == 2)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x140a60cd) && (arg0 == 2)))) { slice.loadUint(32); let minter_addr: BitString = slice.loadBits(256); return { @@ -7931,7 +8271,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8a752dc5) && (arg0 == 3)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x1f8e5906) && (arg0 == 3)))) { slice.loadUint(32); let fee_collector_addr: BitString = slice.loadBits(256); return { @@ -7940,7 +8280,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8ceae93f) && (arg0 == 4)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x539877d6) && (arg0 == 4)))) { slice.loadUint(32); let dns_root_addr: BitString = slice.loadBits(256); return { @@ -7949,97 +8289,106 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb2571db5) && (arg0 == 6)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x439fe43d) && (arg0 == 5)))) { + slice.loadUint(32); + let anon0: BurningConfig = loadBurningConfig(slice); + return { + kind: 'ConfigParam__5', + anon0: anon0, + } + + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x657ceda4) && (arg0 == 6)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x13b3e23b) && (arg0 == 7)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x7cc939b3) && (arg0 == 8)))) { slice.loadUint(32); let anon0: GlobalVersion = loadGlobalVersion(slice); return { - kind: 'ConfigParam__7', + kind: 'ConfigParam__8', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f3b81de) && (arg0 == 9)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x576c3788) && (arg0 == 9)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x54c7bee6) && (arg0 == 10)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x5e24c290) && (arg0 == 11)))) { slice.loadUint(32); let anon0: ConfigVotingSetup = loadConfigVotingSetup(slice); return { - kind: 'ConfigParam__10', + kind: 'ConfigParam__11', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x9059857d) && (arg0 == 12)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x3074376c) && (arg0 == 12)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x19c3905a) && (arg0 == 13)))) { slice.loadUint(32); let anon0: ComplaintPricing = loadComplaintPricing(slice); return { - kind: 'ConfigParam__12', + kind: 'ConfigParam__13', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf282db94) && (arg0 == 14)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xad661db) && (arg0 == 14)))) { slice.loadUint(32); let anon0: BlockCreateFees = loadBlockCreateFees(slice); return { - kind: 'ConfigParam__13', + kind: 'ConfigParam__14', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xed67ebd2) && (arg0 == 15)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x3487eadb) && (arg0 == 15)))) { slice.loadUint(32); 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,7 +8396,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xe8298d51) && (arg0 == 16)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x3993e4d6) && (arg0 == 16)))) { slice.loadUint(32); let max_validators: number = slice.loadUint(16); let max_main_validators: number = slice.loadUint(16); @@ -8062,21 +8411,21 @@ 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x11848225) && (arg0 == 17)))) { slice.loadUint(32); 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,137 +8433,191 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xeab9843a) && (arg0 == 18)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x6b4c6702) && (arg0 == 18)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb916605) && (arg0 == 19)))) { + slice.loadUint(32); + let global_id: number = slice.loadInt(32); + return { + kind: 'ConfigParam__19', + global_id: global_id, + } + + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x500e41c8) && (arg0 == 28)))) { slice.loadUint(32); let anon0: CatchainConfig = loadCatchainConfig(slice); return { - kind: 'ConfigParam__24', + kind: 'ConfigParam__26', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xf5b85ad3) && (arg0 == 29)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x5d933fdf) && (arg0 == 29)))) { slice.loadUint(32); let anon0: ConsensusConfig = loadConsensusConfig(slice); return { - kind: 'ConfigParam__25', + kind: 'ConfigParam__27', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x849fe3cc) && (arg0 == 31)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x6bbc2369) && (arg0 == 31)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x7d31022b) && (arg0 == 32)))) { slice.loadUint(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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x1e48f929) && (arg0 == 33)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x3b08e907) && (arg0 == 34)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x29a48da1) && (arg0 == 35)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x5f120fda) && (arg0 == 36)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x23b0f8c4) && (arg0 == 37)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x71e8478c) && (arg0 == 39)))) { slice.loadUint(32); 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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x7de3be4f) && (arg0 == 40)))) { slice.loadUint(32); let anon0: MisbehaviourPunishmentConfig = loadMisbehaviourPunishmentConfig(slice); return { - kind: 'ConfigParam__34', + kind: 'ConfigParam__36', + anon0: anon0, + } + + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x3f96c8b4) && (arg0 == 43)))) { + slice.loadUint(32); + let anon0: SizeLimitsConfig = loadSizeLimitsConfig(slice); + return { + kind: 'ConfigParam__37', + anon0: anon0, + } + + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x14939d74) && (arg0 == 44)))) { + slice.loadUint(32); + let anon0: SuspendedAddressList = loadSuspendedAddressList(slice); + return { + kind: 'ConfigParam__38', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xbd424af1) && (arg0 == 71)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x70d29ded) && (arg0 == 71)))) { slice.loadUint(32); let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); return { - kind: 'ConfigParam__35', + kind: 'ConfigParam__39', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x966f1932) && (arg0 == 72)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x69dbcc57) && (arg0 == 72)))) { slice.loadUint(32); let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); return { - kind: 'ConfigParam__36', + kind: 'ConfigParam__40', anon0: anon0, } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x8f742873) && (arg0 == 73)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x1edcfcc1) && (arg0 == 73)))) { slice.loadUint(32); let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); return { - kind: 'ConfigParam__37', + kind: 'ConfigParam__41', + anon0: anon0, + } + + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x1df4510f) && (arg0 == 79)))) { + slice.loadUint(32); + let anon0: JettonBridgeParams = loadJettonBridgeParams(slice); + return { + kind: 'ConfigParam__42', + anon0: anon0, + } + + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x14b7c5f2) && (arg0 == 81)))) { + slice.loadUint(32); + let anon0: JettonBridgeParams = loadJettonBridgeParams(slice); + return { + kind: 'ConfigParam__43', + anon0: anon0, + } + + } + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xdbe9448) && (arg0 == 82)))) { + slice.loadUint(32); + let anon0: JettonBridgeParams = loadJettonBridgeParams(slice); + return { + kind: 'ConfigParam__44', anon0: anon0, } @@ -8273,106 +8676,113 @@ 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.storeUint(0x73a8e939, 32); builder.storeBits(configParam.config_addr); }) } if ((configParam.kind == 'ConfigParam__1')) { return ((builder: Builder) => { - builder.storeUint(0x84659d0d, 32); + builder.storeUint(0x54b6a30e, 32); builder.storeBits(configParam.elector_addr); }) } if ((configParam.kind == 'ConfigParam__2')) { return ((builder: Builder) => { - builder.storeUint(0x8648b2c4, 32); + builder.storeUint(0x140a60cd, 32); builder.storeBits(configParam.minter_addr); }) } if ((configParam.kind == 'ConfigParam__3')) { return ((builder: Builder) => { - builder.storeUint(0x8a752dc5, 32); + builder.storeUint(0x1f8e5906, 32); builder.storeBits(configParam.fee_collector_addr); }) } if ((configParam.kind == 'ConfigParam__4')) { return ((builder: Builder) => { - builder.storeUint(0x8ceae93f, 32); + builder.storeUint(0x539877d6, 32); builder.storeBits(configParam.dns_root_addr); }) } if ((configParam.kind == 'ConfigParam__5')) { return ((builder: Builder) => { - builder.storeUint(0xb2571db5, 32); + builder.storeUint(0x439fe43d, 32); + storeBurningConfig(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam__6')) { + return ((builder: Builder) => { + builder.storeUint(0x657ceda4, 32); 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); + builder.storeUint(0x13b3e23b, 32); storeExtraCurrencyCollection(configParam.to_mint)(builder); }) } - if ((configParam.kind == 'ConfigParam__7')) { + if ((configParam.kind == 'ConfigParam__8')) { return ((builder: Builder) => { - builder.storeUint(0xb19d2da6, 32); + builder.storeUint(0x7cc939b3, 32); storeGlobalVersion(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__8')) { + if ((configParam.kind == 'ConfigParam__9')) { return ((builder: Builder) => { - builder.storeUint(0x8f3b81de, 32); + builder.storeUint(0x576c3788, 32); storeHashmap(configParam.mandatory_params, storeTrue)(builder); }) } - if ((configParam.kind == 'ConfigParam__9')) { + if ((configParam.kind == 'ConfigParam__10')) { return ((builder: Builder) => { - builder.storeUint(0xfbcb8998, 32); + builder.storeUint(0x54c7bee6, 32); storeHashmap(configParam.critical_params, storeTrue)(builder); }) } - if ((configParam.kind == 'ConfigParam__10')) { + if ((configParam.kind == 'ConfigParam__11')) { return ((builder: Builder) => { - builder.storeUint(0x9358b12f, 32); + builder.storeUint(0x5e24c290, 32); storeConfigVotingSetup(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__11')) { + if ((configParam.kind == 'ConfigParam__12')) { return ((builder: Builder) => { - builder.storeUint(0x9059857d, 32); + builder.storeUint(0x3074376c, 32); storeHashmapE(configParam.workchains, storeWorkchainDescr)(builder); }) } - if ((configParam.kind == 'ConfigParam__12')) { + if ((configParam.kind == 'ConfigParam__13')) { return ((builder: Builder) => { - builder.storeUint(0xe8ae7dd3, 32); + builder.storeUint(0x19c3905a, 32); storeComplaintPricing(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__13')) { + if ((configParam.kind == 'ConfigParam__14')) { return ((builder: Builder) => { - builder.storeUint(0xf282db94, 32); + builder.storeUint(0xad661db, 32); storeBlockCreateFees(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__14')) { + if ((configParam.kind == 'ConfigParam__15')) { return ((builder: Builder) => { - builder.storeUint(0xed67ebd2, 32); + builder.storeUint(0x3487eadb, 32); builder.storeUint(configParam.validators_elected_for, 32); builder.storeUint(configParam.elections_start_before, 32); builder.storeUint(configParam.elections_end_before, 32); @@ -8380,9 +8790,9 @@ 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(0x3993e4d6, 32); builder.storeUint(configParam.max_validators, 16); builder.storeUint(configParam.max_main_validators, 16); builder.storeUint(configParam.min_validators, 16); @@ -8398,9 +8808,9 @@ export function storeConfigParam(configParam: ConfigParam): (builder: Builder) = }) } - if ((configParam.kind == 'ConfigParam__16')) { + if ((configParam.kind == 'ConfigParam__17')) { return ((builder: Builder) => { - builder.storeUint(0xa81c566c, 32); + builder.storeUint(0x11848225, 32); storeGrams(configParam.min_stake)(builder); storeGrams(configParam.max_stake)(builder); storeGrams(configParam.min_total_stake)(builder); @@ -8408,110 +8818,152 @@ export function storeConfigParam(configParam: ConfigParam): (builder: Builder) = }) } - if ((configParam.kind == 'ConfigParam__17')) { + if ((configParam.kind == 'ConfigParam__18')) { return ((builder: Builder) => { - builder.storeUint(0xeab9843a, 32); + builder.storeUint(0x6b4c6702, 32); storeHashmap(configParam.anon0, storeStoragePrices)(builder); }) } - if ((configParam.kind == 'ConfigParam__24')) { + if ((configParam.kind == 'ConfigParam__19')) { + return ((builder: Builder) => { + builder.storeUint(0xb916605, 32); + builder.storeInt(configParam.global_id, 32); + }) + + } + if ((configParam.kind == 'ConfigParam__26')) { return ((builder: Builder) => { - builder.storeUint(0xf666426a, 32); + builder.storeUint(0x500e41c8, 32); storeCatchainConfig(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__25')) { + if ((configParam.kind == 'ConfigParam__27')) { return ((builder: Builder) => { - builder.storeUint(0xf5b85ad3, 32); + builder.storeUint(0x5d933fdf, 32); storeConsensusConfig(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__26')) { + if ((configParam.kind == 'ConfigParam__28')) { return ((builder: Builder) => { - builder.storeUint(0x849fe3cc, 32); + builder.storeUint(0x6bbc2369, 32); storeHashmapE(configParam.fundamental_smc_addr, storeTrue)(builder); }) } - if ((configParam.kind == 'ConfigParam__27')) { + if ((configParam.kind == 'ConfigParam__29')) { return ((builder: Builder) => { - builder.storeUint(0xcfc8ceeb, 32); + builder.storeUint(0x7d31022b, 32); storeValidatorSet(configParam.prev_validators)(builder); }) } - if ((configParam.kind == 'ConfigParam__28')) { + if ((configParam.kind == 'ConfigParam__30')) { return ((builder: Builder) => { - builder.storeUint(0xa1a5d63c, 32); + builder.storeUint(0x1e48f929, 32); storeValidatorSet(configParam.prev_temp_validators)(builder); }) } - if ((configParam.kind == 'ConfigParam__29')) { + if ((configParam.kind == 'ConfigParam__31')) { return ((builder: Builder) => { - builder.storeUint(0xfd569be3, 32); + builder.storeUint(0x3b08e907, 32); storeValidatorSet(configParam.cur_validators)(builder); }) } - if ((configParam.kind == 'ConfigParam__30')) { + if ((configParam.kind == 'ConfigParam__32')) { return ((builder: Builder) => { - builder.storeUint(0xc271315a, 32); + builder.storeUint(0x29a48da1, 32); storeValidatorSet(configParam.cur_temp_validators)(builder); }) } - if ((configParam.kind == 'ConfigParam__31')) { + if ((configParam.kind == 'ConfigParam__33')) { return ((builder: Builder) => { - builder.storeUint(0x85d02f6c, 32); + builder.storeUint(0x5f120fda, 32); storeValidatorSet(configParam.next_validators)(builder); }) } - if ((configParam.kind == 'ConfigParam__32')) { + if ((configParam.kind == 'ConfigParam__34')) { return ((builder: Builder) => { - builder.storeUint(0xffa3b0f8, 32); + builder.storeUint(0x23b0f8c4, 32); storeValidatorSet(configParam.next_temp_validators)(builder); }) } - if ((configParam.kind == 'ConfigParam__33')) { + if ((configParam.kind == 'ConfigParam__35')) { return ((builder: Builder) => { - builder.storeUint(0x86dfef76, 32); + builder.storeUint(0x71e8478c, 32); storeHashmapE(configParam.anon0, storeValidatorSignedTempKey)(builder); }) } - if ((configParam.kind == 'ConfigParam__34')) { + if ((configParam.kind == 'ConfigParam__36')) { return ((builder: Builder) => { - builder.storeUint(0x8517b916, 32); + builder.storeUint(0x7de3be4f, 32); storeMisbehaviourPunishmentConfig(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__35')) { + if ((configParam.kind == 'ConfigParam__37')) { return ((builder: Builder) => { - builder.storeUint(0xbd424af1, 32); + builder.storeUint(0x3f96c8b4, 32); + storeSizeLimitsConfig(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam__38')) { + return ((builder: Builder) => { + builder.storeUint(0x14939d74, 32); + storeSuspendedAddressList(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam__39')) { + return ((builder: Builder) => { + builder.storeUint(0x70d29ded, 32); storeOracleBridgeParams(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__36')) { + if ((configParam.kind == 'ConfigParam__40')) { return ((builder: Builder) => { - builder.storeUint(0x966f1932, 32); + builder.storeUint(0x69dbcc57, 32); storeOracleBridgeParams(configParam.anon0)(builder); }) } - if ((configParam.kind == 'ConfigParam__37')) { + if ((configParam.kind == 'ConfigParam__41')) { return ((builder: Builder) => { - builder.storeUint(0x8f742873, 32); + builder.storeUint(0x1edcfcc1, 32); storeOracleBridgeParams(configParam.anon0)(builder); }) + } + if ((configParam.kind == 'ConfigParam__42')) { + return ((builder: Builder) => { + builder.storeUint(0x1df4510f, 32); + storeJettonBridgeParams(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam__43')) { + return ((builder: Builder) => { + builder.storeUint(0x14b7c5f2, 32); + storeJettonBridgeParams(configParam.anon0)(builder); + }) + + } + if ((configParam.kind == 'ConfigParam__44')) { + return ((builder: Builder) => { + builder.storeUint(0xdbe9448, 32); + storeJettonBridgeParams(configParam.anon0)(builder); + }) + } if ((configParam.kind == 'ConfigParam_config_mc_gas_prices')) { return ((builder: Builder) => { @@ -8552,6 +9004,53 @@ export function storeConfigParam(configParam: ConfigParam): (builder: 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 +9324,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 +9376,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 +9392,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 +10171,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 +10307,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 +10685,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 +10697,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 +10716,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 +10726,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,7 +10973,7 @@ export function storeVmStackValue(vmStackValue: VmStackValue): (builder: Builder } export function loadVmCellSlice(slice: Slice): VmCellSlice { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd6a63245))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x65a00962))) { slice.loadUint(32); let slice1 = slice.loadRef().beginParse(); let _cell: Slice = slice1; @@ -10186,7 +11002,7 @@ export function loadVmCellSlice(slice: Slice): VmCellSlice { export function storeVmCellSlice(vmCellSlice: VmCellSlice): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xd6a63245, 32); + builder.storeUint(0x65a00962, 32); let cell1 = beginCell(); cell1.storeSlice(vmCellSlice._cell); builder.storeRef(cell1); @@ -10358,7 +11174,7 @@ export function storeVmStackList(vmStackList: VmStackList): (builder: Builder) = } export function loadVmSaveList(slice: Slice): VmSaveList { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xeed28f11))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x59072e9c))) { slice.loadUint(32); let cregs: HashmapE = loadHashmapE(slice, 4, loadVmStackValue); return { @@ -10372,7 +11188,7 @@ export function loadVmSaveList(slice: Slice): VmSaveList { export function storeVmSaveList(vmSaveList: VmSaveList): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xeed28f11, 32); + builder.storeUint(0x59072e9c, 32); storeHashmapE(vmSaveList.cregs, storeVmStackValue)(builder); }) @@ -10407,7 +11223,7 @@ export function storeVmGasLimits(vmGasLimits: VmGasLimits): (builder: Builder) = } export function loadVmLibraries(slice: Slice): VmLibraries { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe9be85ef))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x32869156))) { slice.loadUint(32); let libraries: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { let slice1 = slice.loadRef().beginParse(); @@ -10425,7 +11241,7 @@ export function loadVmLibraries(slice: Slice): VmLibraries { export function storeVmLibraries(vmLibraries: VmLibraries): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xe9be85ef, 32); + builder.storeUint(0x32869156, 32); storeHashmapE(vmLibraries.libraries, ((arg: Slice) => { return ((builder: Builder) => { let cell1 = beginCell(); @@ -10715,9 +11531,13 @@ export function storeVmCont(vmCont: VmCont): (builder: Builder) => void { } export function loadDNS_RecordSet(slice: Slice): DNS_RecordSet { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xafbffed3))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdf62588))) { slice.loadUint(32); - let anon0: HashmapE = loadHashmapE(slice, 256, loadDNSRecord); + let anon0: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { + let slice1 = slice.loadRef().beginParse(); + return loadDNSRecord(slice1) + + })); return { kind: 'DNS_RecordSet', anon0: anon0, @@ -10729,8 +11549,16 @@ export function loadDNS_RecordSet(slice: Slice): DNS_RecordSet { export function storeDNS_RecordSet(dNS_RecordSet: DNS_RecordSet): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xafbffed3, 32); - storeHashmapE(dNS_RecordSet.anon0, storeDNSRecord)(builder); + builder.storeUint(0xdf62588, 32); + storeHashmapE(dNS_RecordSet.anon0, ((arg: DNSRecord) => { + return ((builder: Builder) => { + let cell1 = beginCell(); + storeDNSRecord(arg)(cell1); + builder.storeRef(cell1); + + }) + + }))(builder); }) } @@ -10881,6 +11709,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 +11764,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..e5e87ba 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -1509,7 +1509,7 @@ export function storeMathExprAsCombArg(mathExprAsCombArg: MathExprAsCombArg): (b } export function loadEmptyTag(slice: Slice): EmptyTag { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xab787f76))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x26285f32))) { slice.loadUint(32); let a: number = slice.loadUint(32); return { @@ -1523,7 +1523,7 @@ export function loadEmptyTag(slice: Slice): EmptyTag { export function storeEmptyTag(emptyTag: EmptyTag): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xab787f76, 32); + builder.storeUint(0x26285f32, 32); builder.storeUint(emptyTag.a, 32); }) @@ -1846,7 +1846,7 @@ export function storeHashmapEUser(hashmapEUser: HashmapEUser): (builder: Builder } export function loadConditionalField(slice: Slice): ConditionalField { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdc165658))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x74a0d067))) { slice.loadUint(32); let a: number = slice.loadUint(1); let b: number | undefined = (a ? slice.loadUint(32) : undefined); @@ -1862,7 +1862,7 @@ export function loadConditionalField(slice: Slice): ConditionalField { export function storeConditionalField(conditionalField: ConditionalField): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xdc165658, 32); + builder.storeUint(0x74a0d067, 32); builder.storeUint(conditionalField.a, 1); if ((conditionalField.b != undefined)) { builder.storeUint(conditionalField.b, 32); @@ -1872,7 +1872,7 @@ export function storeConditionalField(conditionalField: ConditionalField): (buil } export function loadBitSelection(slice: Slice): BitSelection { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xe1a2049e))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x1528067f))) { slice.loadUint(32); let a: number = slice.loadUint(6); let b: number | undefined = ((a & (1 << 2)) ? slice.loadUint(32) : undefined); @@ -1888,7 +1888,7 @@ export function loadBitSelection(slice: Slice): BitSelection { export function storeBitSelection(bitSelection: BitSelection): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xe1a2049e, 32); + builder.storeUint(0x1528067f, 32); builder.storeUint(bitSelection.a, 6); if ((bitSelection.b != undefined)) { builder.storeUint(bitSelection.b, 32); @@ -1898,7 +1898,7 @@ export function storeBitSelection(bitSelection: BitSelection): (builder: Builder } export function loadImplicitCondition(slice: Slice): ImplicitCondition { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xd86a5028))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x353d8910))) { slice.loadUint(32); let flags: number = slice.loadUint(10); if ((!(flags <= 100))) { @@ -1915,7 +1915,7 @@ export function loadImplicitCondition(slice: Slice): ImplicitCondition { export function storeImplicitCondition(implicitCondition: ImplicitCondition): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0xd86a5028, 32); + builder.storeUint(0x353d8910, 32); builder.storeUint(implicitCondition.flags, 10); if ((!(implicitCondition.flags <= 100))) { throw new Error(''); @@ -1925,7 +1925,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)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x366f94f) && (arg0 == 0)))) { slice.loadUint(32); let a: number = slice.loadUint(32); return { @@ -1934,7 +1934,7 @@ export function loadMultipleEmptyConstructor(slice: Slice, arg0: number): Multip } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xc5d27bf1) && (arg0 == 1)))) { + if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x6e936965) && (arg0 == 1)))) { slice.loadUint(32); let b: number = slice.loadUint(5); return { @@ -1957,14 +1957,14 @@ 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(0x366f94f, 32); builder.storeUint(multipleEmptyConstructor.a, 32); }) } if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor__1')) { return ((builder: Builder) => { - builder.storeUint(0xc5d27bf1, 32); + builder.storeUint(0x6e936965, 32); builder.storeUint(multipleEmptyConstructor.b, 5); }) @@ -2164,7 +2164,7 @@ export function storeFalseAnonField(falseAnonField: FalseAnonField): (builder: B } export function loadConstructorOrder(slice: Slice): ConstructorOrder { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xc6cc03c3))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4fb00127))) { slice.loadUint(32); let anon0: Simple = loadSimple(slice); return { @@ -2188,7 +2188,7 @@ export function loadConstructorOrder(slice: Slice): ConstructorOrder { export function storeConstructorOrder(constructorOrder: ConstructorOrder): (builder: Builder) => void { if ((constructorOrder.kind == 'ConstructorOrder__')) { return ((builder: Builder) => { - builder.storeUint(0xc6cc03c3, 32); + builder.storeUint(0x4fb00127, 32); storeSimple(constructorOrder.anon0)(builder); }) @@ -2204,7 +2204,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 +2213,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 +2230,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); }) diff --git a/kek.txt b/kek.txt new file mode 100644 index 0000000..33fb80a --- /dev/null +++ b/kek.txt @@ -0,0 +1,327 @@ +x{11EF55AAFFFFFF11} + x{9BC7A98700000000840102089CA0000000010000000000000000000000000064295E0800002138362FFDC000002138362FFDC4649E8B380006717601B2C7C101B2C438C400000003000000000000002E} + x{000021383611794401B2C7C100AB2D3300CCFFE58FC58F57345754FF872EE40765249C6541DFEBBA306B551992F033D080FCEA503F4A317F1AB360F072DBBD734E3EF3236850A562DA7572A0} + x{000021383620BB8102089C9F93934E7EA4579CFA136D7A17BC35A7BCB023E5AC6DF9B897BF9F1FE3C7DED6DA44BB4242648D8A7B88F113355F5E0B24139DFA4F270D138805CAF95D3DF904CC} + x{B8E48DFB43C4F4F604_} + x{8259BB4F2B06EE74DC12CDDA7957DD30F6C00} + x{2_} + x{BE000003BC91627AEA9_} + x{BFFFFFFFBC8B96FC9C5_} + x{2_} + x{BE000003BC91627AEA9_} + x{BFFFFFFFBC8B96FC9C5_} + x{0010EE6B28000} + u{044505CDB6BB0B791407B92E4C15F7F69408C1B70CC1059A1A412FF57EB410C8FE05776DF6C487D5F58DA84FA19A4C5E90BA4F04E87B6A0102229C24231680CCE302190219} + x{9023AFE2FFFFFF110000000000000000000000000002089C9F0000000164295E05000021383620BB8101B2C7BF2_} + p{01013B1714D078D245D415BFC8F3FF645D98D3D789D1C9AC45CA4C487BEF2A726CA00002} + x{820966ED3CAC1BB9D37_} + x{0104B3769E560DDCE9B} + x{0103228FC3811B0789D} + p{01013DF0A2180FBF8310E3EBF3EE0337E3DB4F3C5607B2A95948CB9EBC39B7B781010215} + x{01014070C1CC7BE4DBD} + p{0101335FA553EA4BCA6BDDB4E487595CB1F5127CD062DE48C641510A5F7C2FC6A81D0061} + x{0100500A6EFEE201B29} + x{00FD67093028550BD} + x{00FC517E975F6162F} + x{00E3929D9C8C7EFC8} + x{00E2AB2314DEA6A24} + x{00E2981DD9981B270} + x{00E1DD0C507F2BB90} + p{0101382B16F00C5310BAED87D5AD7F1D067E70B3C0E871C3BFE7A6071658FD0F89C0001C} + x{00C6051B0DBB064} + p{01015B52DBBFDE38BC2D6155B14B477CCE467DE02546347147685BCEE999F95032540019} + x{00C51DF7B0B1370} + x{00C472FA627A36A} + p{0101AA58BFD93E60FDC0E0B56EEB49D336E409C5B835B3B89825E03192C6A607AAE50017} + x{00C42EA4740B996} + p{0101C0BC26E547B2EA220627D3E27DB49753C70793B1CBE233DE65B09159EB8FBC720015} + x{00C428B80EA823C} + x{00C420AB37315A6} + p{0101E717A923ABE0AD67F2FF9AE27916C2CFEA60885164EA1E47E8BD03F22EFD9CFE0014} + x{00C4206976EFBC0} + p{0101CAC41590635CBF68EBE29DBC8C5C118A136358F0CEC5C0830E6A31A7DFF0D21C0010} + x{00C41EF2D28ADB6} + x{00C41EEA3DE89D8} + p{01011E0AC340288F71D6341EB0FB314EB3284CD5B06DA8EE1FAE4BDA56B3CC1B9C9F000C} + x{00C41EE948E3D28} + x{5031068631CA7612_} + x{BA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C03106861E13C993C7C9FE9481C241BD8A281B788EAED1421C3A9B639E0471ABC77EBD52D2E8B634000084E016334706_} + x{C00606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C2188219C3214A98F8000084E01633470D883430F09E4C934_} + p{01019494D1CC8EDF12F05671A1A9BA09921096EB50811E1924EC65C3C629FBB808120004} + p{010134934EFEB320C3614BA963232A3D97A0F0D9343A41113EA96D852BE1E3DE214A0001} + p{01010CFBF895A4279219543BBFB4B028EA8C2EC00FEDE4BA119A3A75403FA5F50F100008} + p{010175964F16FF7B25221B550E09C898280EE4E49BCDE70BA8C460355CC06C683632000B} + p{0101466D1F8C839BE0F4C073E7E5871EF4111F0DB32869A8E507551DD6637F3AD956000D} + p{0101A21C0CCFC1FC0E46C069D3693D595DDC8C568451D490DFAB117A5D634424CD240014} + p{0101341DCE03478E7C34F1FE412B12E7DC7A487A004F3FB367A678612C559947386F0018} + p{010133AF19EA836262A204FF10952173423B90C7801087D2FE83F28D089562D26EDF0026} + p{01014F4DA78B7B4B5B95205258C40DB2DD9D1F1F7CC9947FF42623986733FE7882BD0025} + p{0101902404EFA41FB7E1B55FE73DD5E5FD8857F4DD71E1B65F812AE99B2D5E207FC20024} + p{0101C5D2BAFC40ED77F48AB8D61A99284AC25BC00226B8A3608335447A498EAB53F20038} + p{0101D7ACBB602338C86D610F35CFB362FD76FC18B1812476B6FCA99A0678E665FCF50000} + p{0101C6241C72471DA7C63E4B68F139D5B4190AF49F7E40F33210AC30ABDA0E7070AE005F} + p{0101D7ACBB602338C86D610F35CFB362FD76FC18B1812476B6FCA99A0678E665FCF50000} + p{01012B53E9EAF845A41878D7BFF2B41581A33E0B911CEA033158A2D004CFECDCE3FD003A} + p{0101ED7E26BD36EFA6D5D9B4F6AAAB9813AF0742A84244977F74FD4074C9C98908BE0000} + p{0101ED7E26BD36EFA6D5D9B4F6AAAB9813AF0742A84244977F74FD4074C9C98908BE0000} + p{01016F315F25B4A39AC12C85FEA4ECFE7A83E5E59D1F059783FA0C3EF279730880610000} + x{010190E6DAD4F2D55FF} + x{010101D7C0DED45E81D} + p{0101E2BECF418BA09257A8799C82252615A6FE7061371B4E6423314BD5F1AFC7EEF20067} + x{010095666D27D819F37} + p{0101BA011F0CFD2FD4076DF35E604C9BCD1B8F011558562DECDD01FE089C4498EBD70065} + x{0100576CB100C213754} + x{00ED333FDD8FA65EA} + x{00E7DC8F8C05F9938} + x{00E02AF92CDEC2544} + x{00CD609D35A27FC} + p{01011C4CF0A3559E0A8E1E8F55686F9FEF129FE263D8AC6964225233CA2D749AD85D0027} + x{00C58EE0516C6AC} + p{0101E8E05A988813F0D3E51CCEF0FDE7CBCA183C41DB945AB9525C56917016E50414001D} + x{00C38498E8435DC} + x{00C2676676B41BE} + x{00C0B325678E7E8} + p{0101FBA19B98305B76E7F47FAC36231A7E981DE55C1412F40BEA708590AAB7F6D46D0018} + x{00C0450982B5E66} + p{01018C4122CFAD51D07E9D37FDF5A8FFA374D6CCA70D8B3984404459C7816A9258D40016} + x{00C020D56AFB542} + x{00BF74E9E366C} + x{00BD73C5D3AD4} + p{010153162242031C5E3B057D9AE3A06508410049B4F9A2757F53FF38C5E489C9ABDB0012} + x{00A0413361AAE} + x{00A03FB2F39C4} + x{00A0229D2AE98} + p{01018C28B0BC8E47355432DE9739D965001B2A2F78F10A2D00DCEDCE9FA46B0E16ED0008} + x{00A0224E556CC} + x{00A021CE556CC} + p{01013C6A67F597E285D4CD28D1C19EE094F94242A9DDB3B849C5F1C0A789C48BCE250008} + x{009D3F6CFD2} + p{0101481DB5435F23A0CDB869D3E0BC57B347A723FDD90E6FE8E061E8292183967E3E0009} + x{BA6ADE71DFCF5C7375AB6805BCBFDBBFB473604B4D17A084B9FEB08816EB404E6A4508536716E29930468E1F9818AA2E720DD13DE7043086E7AD975FBB1D0F6B1D9C8AC80001094408285E0C_} + x{C00B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A22C858E43212E0B80000084A204142F0D39A91421534_} + p{0101FEB5FF6820E2FF0D9483E7E0D62C817D846789FB4AE580C878866D959DABD5C00007} + x{0000000729A9A3177E14E8A2B7C6D5587C92805C37EFABDEA4EA0B9F26D9B8A82A8E0D6BDCEA62504_} + p{01017C4D05EDDB6C75FBF5C8D53EF726F1CBD92AD3C4190A8B3FD233AD191B21F8D60009} + p{010142BB3144A3AD75955EE6416142A51D42ABAE84065FEC9F5A1B4D873EE537C9FA000B} + p{0101E975BCCADE13E7C125532BAEC89E7874C1AD154D027B1554C9C2152376BC7366000D} + p{0101457DA401CF28E66FFCB7FB77B0410C986AAAE7F5BB77BFC5F4521DB8DE9DB8D9000F} + p{0101703704776AD2237497F6FDE9686E1EC3B81EF99E2FD2B9FB850B1C56381CDD870014} + p{0101CC1DAA155C33989D1133C6998B18A50693D3946C741AD0948B9EC503E8B3BEB0001B} + p{0101C35FE470AF7DFF3C7183867EAE2130BB19438AE998DDE9E531128C865E1D87DD001A} + p{0101C817780520281267914DE4240BB2A5C41DD78A8DD97655393BDA6928F4A90AE6001E} + p{0101CBB45B0E87EBB7CBE82E0FEDE2D31C2917900081CCFC358BF740FC09F0667E5C002C} + p{0101DE9217E0224DFAA82F60C0D93FE25A49C09265AD9FBA9A09B4C4D13020CBA1C4002A} + p{0101A0831A37E357E0BE440ACB7B676F614ECA66E284FAA0C7C5D76B5BB0BA4FF176005E} + p{01013E8566F5F5F2B901F000BB83A3E2BC2241CAA776D7CF39A9F96941FB8081799C0000} + p{0101EC90A44EEE02BED840C10E88351163EE9E3613EB9DBE8DA760783DA449714E280001} + p{01015D730BC79B61A2DEFCD1E502BA3336692765E8C46EACF5C53903E35E71A636650067} + p{0101BB06F3506745C5F6A6239D132A70B38439CB60FF95F62E45261BA12E844E889B0001} + p{0101B3E9649D10CCB379368E81A3A7E8E49C8EB53F6ACC69B0BA2FFA80082F70EE390001} + p{0101B3E9649D10CCB379368E81A3A7E8E49C8EB53F6ACC69B0BA2FFA80082F70EE390001} + p{0101A515AAFB83B6EFAF10E9880D3464239A3D286BCCCCE55320C05174FA25AA52A90002} + x{9023AFE2FFFFFF110000000000000000000000000002089CA00000000164295E0800002138362FFDC401B2C7C12_} + x{00000000000000005_} + x{B0400000000000000000D963E08000109C1B17FEE16DBFE285E48E43E249A93F61BD3A57B85BB3EB580A3CDFA802CFF52C478F3C4A4_} + x{820966ED3CABEE987B7_} + x{0104B3769E55F74C3DB} + x{0103228FC2CC136E07B} + p{01013DF0A2180FBF8310E3EBF3EE0337E3DB4F3C5607B2A95948CB9EBC39B7B781010215} + x{01014070C117744B59B} + p{0101335FA553EA4BCA6BDDB4E487595CB1F5127CD062DE48C641510A5F7C2FC6A81D0061} + x{0100500A6E49DA68307} + x{00FD67087B20BB89B} + x{00FC517DE257C7E0D} + x{00E3929CE784E57A6} + x{00E2AB225FD70D202} + x{00E2981D249081A4E} + x{00E1DD0B9B779236E} + p{0101382B16F00C5310BAED87D5AD7F1D067E70B3C0E871C3BFE7A6071658FD0F89C0001C} + x{00C604660621842} + p{01015B52DBBFDE38BC2D6155B14B477CCE467DE02546347147685BCEE999F95032540019} + x{00C51D42A917B4E} + x{00C472455AE0B48} + p{0101AA58BFD93E60FDC0E0B56EEB49D336E409C5B835B3B89825E03192C6A607AAE50017} + x{00C42DEF6C72174} + p{0101C0BC26E547B2EA220627D3E27DB49753C70793B1CBE233DE65B09159EB8FBC720015} + x{00C42803070EA1A} + x{00C41FF62F97D84} + p{0101E717A923ABE0AD67F2FF9AE27916C2CFEA60885164EA1E47E8BD03F22EFD9CFE0014} + x{00C41FB46F5639E} + p{0101CAC41590635CBF68EBE29DBC8C5C118A136358F0CEC5C0830E6A31A7DFF0D21C0010} + x{00C41E3DCAF1594} + x{00C41E35364F1B6} + p{01011E0AC340288F71D6341EB0FB314EB3284CD5B06DA8EE1FAE4BDA56B3CC1B9C9F000C} + x{00C41E34414A506} + x{50310658EFE4158A_} + x{BA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C0310658DC2D69095CC51E39D6E690880CC91ED84A3474116C8F49C33AED0A1C3CC09EC56897BF5C000084E0D8BFF706_} + x{C00606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C2188219C3214AF040000084E0D8BFF70D8832C6E16B48534_} + p{01019494D1CC8EDF12F05671A1A9BA09921096EB50811E1924EC65C3C629FBB808120004} + x{00000001642953590F1E20FA05A095B841DFC5AD719E71E49027E63A970787F78F2B781992B68ABA73BDC400C_} + x{A03214AF210FD95F2DC_} + p{01010CFBF895A4279219543BBFB4B028EA8C2EC00FEDE4BA119A3A75403FA5F50F100008} + p{010175964F16FF7B25221B550E09C898280EE4E49BCDE70BA8C460355CC06C683632000B} + p{0101466D1F8C839BE0F4C073E7E5871EF4111F0DB32869A8E507551DD6637F3AD956000D} + p{0101A21C0CCFC1FC0E46C069D3693D595DDC8C568451D490DFAB117A5D634424CD240014} + p{0101341DCE03478E7C34F1FE412B12E7DC7A487A004F3FB367A678612C559947386F0018} + p{010133AF19EA836262A204FF10952173423B90C7801087D2FE83F28D089562D26EDF0026} + p{01014F4DA78B7B4B5B95205258C40DB2DD9D1F1F7CC9947FF42623986733FE7882BD0025} + p{0101902404EFA41FB7E1B55FE73DD5E5FD8857F4DD71E1B65F812AE99B2D5E207FC20024} + p{0101C5D2BAFC40ED77F48AB8D61A99284AC25BC00226B8A3608335447A498EAB53F20038} + x{A0000000EF18A7C924_} + p{0101C6241C72471DA7C63E4B68F139D5B4190AF49F7E40F33210AC30ABDA0E7070AE005F} + x{A0000000EF18A7C924_} + p{01012B53E9EAF845A41878D7BFF2B41581A33E0B911CEA033158A2D004CFECDCE3FD003A} + x{A0000000EF1911C4CC_} + x{A0000000EF1911C4CC_} + x{A0000000EF1B3B3824_} + x{010190E6DB89E3DE361} + x{010101D7C193C56757F} + p{0101E2BECF418BA09257A8799C82252615A6FE7061371B4E6423314BD5F1AFC7EEF20067} + x{010095666DDCC922C99} + p{0101BA011F0CFD2FD4076DF35E604C9BCD1B8F011558562DECDD01FE089C4498EBD70065} + x{0100576CB1B5B31C4B6} + x{00ED33409280AF34C} + x{00E7DC9040F70269A} + x{00E02AF9E1CFCB2A6} + x{00CD615226AB55E} + p{01011C4CF0A3559E0A8E1E8F55686F9FEF129FE263D8AC6964225233CA2D749AD85D0027} + x{00C58F95427540E} + p{0101E8E05A988813F0D3E51CCEF0FDE7CBCA183C41DB945AB9525C56917016E50414001D} + x{00C3854DD94C33E} + x{00C2681B67BCF20} + x{00C0B3DA589754A} + p{0101FBA19B98305B76E7F47FAC36231A7E981DE55C1412F40BEA708590AAB7F6D46D0018} + x{00C045BE73BEBC8} + p{01018C4122CFAD51D07E9D37FDF5A8FFA374D6CCA70D8B3984404459C7816A9258D40016} + x{00C0218A5C042A4} + x{00C02029DAEC3CE} + x{00BE28B6DC836} + p{010153162242031C5E3B057D9AE3A06508410049B4F9A2757F53FF38C5E489C9ABDB0012} + x{00A0F6246A810} + x{00A0F4A3FC726} + x{00A0D78E33BFA} + p{01018C28B0BC8E47355432DE9739D965001B2A2F78F10A2D00DCEDCE9FA46B0E16ED0008} + x{00A0D73F5E42E} + x{00A0D6BF5E42E} + p{01013C6A67F597E285D4CD28D1C19EE094F94242A9DDB3B849C5F1C0A789C48BCE250008} + x{00A0D23075D34} + p{0101481DB5435F23A0CDB869D3E0BC57B347A723FDD90E6FE8E061E8292183967E3E0009} + x{BA6ADE71DFCF5C7375AB6805BCBFDBBFB473604B4D17A084B9FEB08816EB405068E2C97363B1664ADD57954D7A335D658A1CC2E94CE8A96C8C0A6EB4E2ED111159E9257FA0000109C1B17FEE1C_} + x{C00B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A22C859043214AF040000084E0D8BFF71141A38B25CD934_} + p{0101FEB5FF6820E2FF0D9483E7E0D62C817D846789FB4AE580C878866D959DABD5C00007} + x{0000000729A9A3177E14E8A2B7C6D5587C92805C37EFABDEA4EA0B9F26D9B8A82A8E0D6BDCEA62504_} + p{01017C4D05EDDB6C75FBF5C8D53EF726F1CBD92AD3C4190A8B3FD233AD191B21F8D60009} + p{010142BB3144A3AD75955EE6416142A51D42ABAE84065FEC9F5A1B4D873EE537C9FA000B} + p{0101E975BCCADE13E7C125532BAEC89E7874C1AD154D027B1554C9C2152376BC7366000D} + p{0101457DA401CF28E66FFCB7FB77B0410C986AAAE7F5BB77BFC5F4521DB8DE9DB8D9000F} + p{0101703704776AD2237497F6FDE9686E1EC3B81EF99E2FD2B9FB850B1C56381CDD870014} + p{0101CC1DAA155C33989D1133C6998B18A50693D3946C741AD0948B9EC503E8B3BEB0001B} + p{0101C35FE470AF7DFF3C7183867EAE2130BB19438AE998DDE9E531128C865E1D87DD001A} + p{0101C817780520281267914DE4240BB2A5C41DD78A8DD97655393BDA6928F4A90AE6001E} + p{0101CBB45B0E87EBB7CBE82E0FEDE2D31C2917900081CCFC358BF740FC09F0667E5C002C} + p{0101DE9217E0224DFAA82F60C0D93FE25A49C09265AD9FBA9A09B4C4D13020CBA1C4002A} + p{0101A0831A37E357E0BE440ACB7B676F614ECA66E284FAA0C7C5D76B5BB0BA4FF176005E} + x{A0000000EF184C5AE4_} + x{2_} + x{BE000003BC84F8C240D_} + x{BFFFFFFFBC85CB7E4E3_} + p{01015D730BC79B61A2DEFCD1E502BA3336692765E8C46EACF5C53903E35E71A636650067} + x{2_} + x{BE000003BC91558E0A1_} + x{BFFFFFFFBC8B96FC9C5_} + x{2_} + x{BE000003BC91627AEA9_} + x{BFFFFFFFBC8B96FC9C5_} + x{2_} + x{BE000003BC91627AEA9_} + x{BFFFFFFFBC8B96FC9C5_} + x{0000000000000000FFFFFFFFFFFFFFFF8259BB4F2AFBA61EDBBDCA2588BC7A859000021383611794401B2C7C100AB2D3300CCFFE58FC58F57345754FF872EE40765249C6541DFEBBA306B551992F033D080FCEA503F4A317F1AB360F072DBBD734E3EF3236850A562DA7572A0} + x{2_} + x{BE000003BC91627AEA9_} + x{BFFFFFFFBC8B96FC9C5_} + x{4A33F6FD000000003218ED7B400367D51EE096AC7A440DDAAC406E4729B0F9E6DF16FE41DC9C0512CAA7A3B83FBCB9CEE542950EB55B8950D8807B4559E5450DD97FB9ED4_} + x{98738F902_} + x{0C39C7C81_} + x{BFFB5D18557F2CB862C8FD55A72B335069C1DBCFCF2DBDBCDD21ECB32944D4BCBE8004_} + x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} + x{D003} + x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} + x{E_} + x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} + x{D003} + x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{DF_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} + x{0C8057061B8732C44_} + x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} + x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} + x{BFEDBFE285E48E43E249A93F61BD3A57B85BB3EB580A3CDFA802CFF52C478F3C4A18738F90198738F94_} + x{4606030E71F2} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} + x{A_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} + x{0CBADD094169E6144F5861E3E311_} + x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} + x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} + x{82_} + x{A01B6FF8A1792390F8926A4FD86F4E95EE16ECFAD6028F37EA00B3FD4B11E3CF12805_} + x{4606030E71F2} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} + x{E_} + x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} + x{D003} + x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{DF_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} + x{0C8057061B8732C44_} + x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} + x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} + x{661CE3E5_} + x{4606030E71F2} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} + x{A_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} + x{0CBADD094169E6144F5861E3E311_} + x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} + x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} + x{9D309B72_} + x{0E984DB9_} + x{BFF036D41B2F52198152B3FD3DC263022215EB42AE8A0AB5B5AC342D3026707D8E1CB04711581B6A0D97A90CC0A959FE9EE13181110AF5A15745055ADAD61A169813383EC7280000042706C5FFB8272C11C4} + x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} + x{E_} + x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} + x{D003} + x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{DF_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} + x{0C8057061B8732C44_} + x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} + x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} + x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} + x{BFD8664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD188054616C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD6A80000042706C5FFB866201518} + x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} + x{A_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} + x{0CBADD094169E6144F5861E3E311_} + x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} + x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} + x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} \ No newline at end of file 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/tests/fixtures/tlb/block.tlb b/tests/fixtures/tlb/block.tlb index b67a1a5..5e6c602 100644 --- a/tests/fixtures/tlb/block.tlb +++ b/tests/fixtures/tlb/block.tlb @@ -276,11 +276,11 @@ transaction$0111 account_addr:bits256 lt:uint64 total_fees:CurrencyCollection state_update:^(HASH_UPDATE Account) description:^TransactionDescr = Transaction; -!merkle_update#02 {X:Type} old_hash:bits256 new_hash:bits256 +merkle_update#02 {X:Type} old_hash:bits256 new_hash:bits256 old:^X new:^X = MERKLE_UPDATE X; update_hashes#72 {X:Type} old_hash:bits256 new_hash:bits256 = HASH_UPDATE X; -!merkle_proof#03 {X:Type} virtual_hash:bits256 depth:uint16 virtual_root:^X = MERKLE_PROOF X; +merkle_proof#03 {X:Type} virtual_hash:bits256 depth:uint16 virtual_root:^X = MERKLE_PROOF X; acc_trans#5 account_addr:bits256 transactions:(HashmapAug 64 ^Transaction CurrencyCollection) diff --git a/tests/my.spec.ts b/tests/my.spec.ts index 1357a5a..fec0556 100644 --- a/tests/my.spec.ts +++ b/tests/my.spec.ts @@ -7,60 +7,43 @@ 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'; const fixturesDir = path.resolve(__dirname, 'fixtures') +function calculateRequestOpcode(scheme: string): string { + 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); +} 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) - }) -}) - -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) - - fs.writeFile('generated_my.ts', generate(tree), () => { }); - - - expect(tree).toBeInstanceOf(Program) + let x = +`block_extra in_msg_descr:^InMsgDescr + out_msg_descr:^OutMsgDescr + account_blocks:^ShardAccountBlocks + rand_seed:bits256 + created_by:bits256 + custom:(Maybe ^McBlockExtra) = BlockExtra;` + console.log(calculateRequestOpcode(x)); }) }) - /* storeY(y)(builder) */ \ No newline at end of file diff --git a/tests/tlbgen.spec.ts b/tests/tlbgen.spec.ts index 624411f..4b17510 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 { beginCell } from 'ton' +import { loadBlock } from '../generated_block' const fixturesDir = path.resolve(__dirname, 'fixtures') @@ -104,6 +105,25 @@ function callf(x: TLFunction) { x.encode(5, 6, 7); } +function logCell(cs: Slice) { + let res = '' + while(cs.remainingBits >= 4) { + res += cs.loadUint(4).toString(16); + } + if (cs.remainingBits) { + res += cs.loadUint(cs.remainingBits).toString(16); + } + while(cs.remainingRefs) { + if (!cs.loadRef().isExotic) { + res += '\n\t' + logCell(cs.loadRef().beginParse()) + } else { + cs.loadRef(); + res += '\n\texotic' + } + } + return res; +} + describe('Generating tlb code', () => { test('Basic types', () => { let tlf: TLFunction = {decode: null, encode:theEncode} @@ -111,6 +131,14 @@ describe('Generating tlb code', () => { expect.hasAssertions() + const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQAAAAAAAAAAAAAAAAACCJygAAAAAWQpXggAACE4Ni/9xAGyx8EgCgQDAdkAAAAAAAAAAP//////////glm7Tyr7ph7bvcoliLx6hZAAAhODYReUQBssfBAKstMwDM/+WPxY9XNFdU/4cu5AdlJJxlQd/rujBrVRmS8DPQgPzqUD9KMX8as2Dwctu9c04+8yNoUKVi2nVyoIECITgglm7Tyr7ph7cAUQIxMBBLN2nlX3TD24GAYQIxMBAZDm24nj3jYYBywVIxMBAQHXwZPFZ1f4SRIIAgEgoQkAE7////+8hct+TjABEQAAAAAAAAAAUKICEbjkjftDxPT2BA0MAA0AEO5rKAAIAiWCWbtPKwbudNwSzdp5V90w9sAIEBACoJvHqYcAAAAAhAECCJygAAAAAQAAAAAAAAAAAAAAAABkKV4IAAAhODYv/cAAACE4Ni/9xGSeizgABnF2AbLHwQGyxDjEAAAAAwAAAAAAAAAuRg8AmAAAITg2ILuBAgicn5OTTn6kV5z6E216F7w1p7ywI+Wsbfm4l7+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jJvyINAKAiTlVsyMHAKEgBAXxNBe3bbHX79cjVPvcm8cvZKtPEGQqLP9IzrRkbIfjWAAkiDQCgIc5VbMjIwiILAJ0/bP0ox8Mhl7pq3nHfz1xzdatoBby/27+0c2BLTReghLn+sIgW60BOakUIU2cW4pkwRo4fmBiqLnIN0T3nBDCG562XX7sdD2sdnIrIAAEJRAgoXgzEIm/ACwzJdW847+euObrVtALeX+3f2jmwJaaL0EJc/1hEC3WiLIWOQyEuC4AAAISiBBQvDTmpFCFTQMbFAFEAAAAHKamjF34U6KK3xtVYfJKAXDfvq96k6gufJtm4qCqODWvc6mJQQChIAQH+tf9oIOL/DZSD5+DWLIF9hGeJ+0rlgMh4hm2VnavVwAAHKEgBAUgdtUNfI6DNuGnT4LxXs0enI/3ZDm/o4GHoKSGDln4+AAkoSAEBPGpn9ZfihdTNKNHBnuCU+UJCqd2zuEnF8cCnicSLziUACChIAQGMKLC8jkc1VDLelznZZQAbKi948QotANztzp+kaw4W7QAIKEgBAVMWIkIDHF47BX2a46BlCEEASbT5onV/U/84xeSJyavbABIoSAEBjEEiz61R0H6dN/31qP+jdNbMpw2LOYRARFnHgWqSWNQAFihIAQH7oZuYMFt25/R/rDYjGn6YHeVcFBL0C+pwhZCqt/bUbQAYKEgBAejgWpiIE/DT5RzO8P3ny8oYPEHblFq5UlxWkXAW5QQUAB0oSAEBHEzwo1WeCo4ej1Vob5/vEp/iY9isaWQiUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; + const cs = Cell.fromBase64(state).beginParse() + // console.log(logCell(cs)) + // fs.writeFile('kek' + '.txt', Cell.fromBase64(state).toString(), () => { }); + + let blk = loadBlock(cs); + console.log(blk) + let simple: Simple = { kind: 'Simple', a: 827, b: 387 } checkSameOnStoreLoad(simple, loadSimple, storeSimple); let tcFalse: TwoConstructors = { 'kind': 'TwoConstructors_bool_false', a: 1000, b: 10, c: 1000 } From fc2008798ddaa81eee34455f5164713e1038ed3f Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Tue, 12 Dec 2023 21:57:37 -0500 Subject: [PATCH 03/14] tmp --- generated_block.ts | 1025 +++++++++++++++++-------------------------- generated_test.ts | 122 ++--- src/codegen/util.ts | 17 +- 3 files changed, 466 insertions(+), 698 deletions(-) diff --git a/generated_block.ts b/generated_block.ts index 46fc466..4596bcc 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -1075,12 +1075,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'; @@ -1088,6 +1083,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; @@ -1380,12 +1380,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'; @@ -1393,6 +1388,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; @@ -1464,7 +1464,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__18 | ConfigParam__19 | 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 | 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__'; @@ -1575,6 +1575,36 @@ export interface ConfigParam__19 { readonly global_id: number; } +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 anon0: CatchainConfig; @@ -1670,36 +1700,6 @@ export interface ConfigParam__44 { readonly anon0: JettonBridgeParams; } -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 BurningConfig { readonly kind: 'BurningConfig'; readonly blackhole_addr: Maybe; @@ -3051,22 +3051,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) == 0x13b7747e))) { - 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(0x13b7747e, 32); storeHashmap(bitstringSet._, storeTrue)(builder); }) @@ -3634,8 +3629,7 @@ export function storeMsgAddressInt(msgAddressInt: MsgAddressInt): (builder: Buil } export function loadMsgAddress(slice: Slice): MsgAddress { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x606aa05e))) { - slice.loadUint(32); + if (true) { let _: MsgAddressInt = loadMsgAddressInt(slice); return { kind: 'MsgAddress__', @@ -3643,8 +3637,7 @@ export function loadMsgAddress(slice: Slice): MsgAddress { } } - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x21d0382b))) { - slice.loadUint(32); + if (true) { let _: MsgAddressExt = loadMsgAddressExt(slice); return { kind: 'MsgAddress__1', @@ -3658,14 +3651,12 @@ export function loadMsgAddress(slice: Slice): MsgAddress { export function storeMsgAddress(msgAddress: MsgAddress): (builder: Builder) => void { if ((msgAddress.kind == 'MsgAddress__')) { return ((builder: Builder) => { - builder.storeUint(0x606aa05e, 32); storeMsgAddressInt(msgAddress._)(builder); }) } if ((msgAddress.kind == 'MsgAddress__1')) { return ((builder: Builder) => { - builder.storeUint(0x21d0382b, 32); storeMsgAddressExt(msgAddress._)(builder); }) @@ -3730,21 +3721,16 @@ export function storeGrams(grams: Grams): (builder: Builder) => void { } export function loadCoins(slice: Slice): Coins { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x258097e8))) { - slice.loadUint(32); - let grams: Grams = loadGrams(slice); - return { - kind: 'Coins', - grams: grams, - } - + let grams: Grams = loadGrams(slice); + return { + kind: 'Coins', + grams: grams, } - throw new Error(''); + } export function storeCoins(coins: Coins): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x258097e8, 32); storeGrams(coins.grams)(builder); }) @@ -3987,44 +3973,39 @@ export function storeTickTock(tickTock: TickTock): (builder: Builder) => void { } export function loadStateInit(slice: Slice): StateInit { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x6fb8b949))) { - 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 data: 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 library: 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 - })); - 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(0x6fb8b949, 32); storeMaybe(stateInit.split_depth, ((arg: number) => { return ((builder: Builder) => { builder.storeUint(arg, 5); @@ -4064,40 +4045,35 @@ export function storeStateInit(stateInit: StateInit): (builder: Builder) => void } export function loadStateInitWithLibs(slice: Slice): StateInitWithLibs { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x458004e3))) { - slice.loadUint(32); - 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 split_depth: Maybe = loadMaybe(slice, ((slice: Slice) => { + return slice.loadUint(5) - })); - let data: 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 library: HashmapE = loadHashmapE(slice, 256, loadSimpleLib); - return { - kind: 'StateInitWithLibs', - split_depth: split_depth, - special: special, - code: code, - data: data, - library: library, - } + })); + 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, } - throw new Error(''); + } export function storeStateInitWithLibs(stateInitWithLibs: StateInitWithLibs): (builder: Builder) => void { return ((builder: Builder) => { - builder.storeUint(0x458004e3, 32); storeMaybe(stateInitWithLibs.split_depth, ((arg: number) => { return ((builder: Builder) => { builder.storeUint(arg, 5); @@ -4259,24 +4235,19 @@ export function storeMessageRelaxed(messageRelaxed: MessageRelaxed, storeX } export function loadMessageAny(slice: Slice): MessageAny { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x2ac89f2a))) { - 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(0x2ac89f2a, 32); storeMessage(messageAny.anon0, ((arg: Slice) => { return ((builder: Builder) => { builder.storeSlice(arg); @@ -4633,21 +4604,16 @@ export function storeImportFees(importFees: ImportFees): (builder: Builder) => v } export function loadInMsgDescr(slice: Slice): InMsgDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x59519ebf))) { - 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(0x59519ebf, 32); storeHashmapAugE(inMsgDescr.anon0, storeInMsg, storeImportFees)(builder); }) @@ -4873,24 +4839,19 @@ export function storeOutMsg(outMsg: OutMsg): (builder: Builder) => void { } export function loadEnqueuedMsg(slice: Slice): EnqueuedMsg { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x1006a25f))) { - 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(0x1006a25f, 32); builder.storeUint(enqueuedMsg.enqueued_lt, 64); let cell1 = beginCell(); storeMsgEnvelope(enqueuedMsg.out_msg)(cell1); @@ -4900,45 +4861,35 @@ export function storeEnqueuedMsg(enqueuedMsg: EnqueuedMsg): (builder: Builder) = } export function loadOutMsgDescr(slice: Slice): OutMsgDescr { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x67a8b3c9))) { - 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(0x67a8b3c9, 32); storeHashmapAugE(outMsgDescr.anon0, storeOutMsg, storeCurrencyCollection)(builder); }) } export function loadOutMsgQueue(slice: Slice): OutMsgQueue { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4ef24409))) { - 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(0x4ef24409, 32); storeHashmapAugE(outMsgQueue.anon0, storeEnqueuedMsg, ((arg: number) => { return ((builder: Builder) => { builder.storeUint(arg, 64); @@ -4969,21 +4920,16 @@ export function storeProcessedUpto(processedUpto: ProcessedUpto): (builder: Buil } export function loadProcessedInfo(slice: Slice): ProcessedInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x155266c0))) { - 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(0x155266c0, 32); storeHashmapE(processedInfo.anon0, storeProcessedUpto)(builder); }) @@ -5006,46 +4952,36 @@ export function storeIhrPendingSince(ihrPendingSince: IhrPendingSince): (builder } export function loadIhrPendingInfo(slice: Slice): IhrPendingInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5a108747))) { - 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(0x5a108747, 32); storeHashmapE(ihrPendingInfo.anon0, storeIhrPendingSince)(builder); }) } export function loadOutMsgQueueInfo(slice: Slice): OutMsgQueueInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xae4d516))) { - 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(0xae4d516, 32); storeOutMsgQueue(outMsgQueueInfo.out_queue)(builder); storeProcessedInfo(outMsgQueueInfo.proc_info)(builder); storeIhrPendingInfo(outMsgQueueInfo.ihr_pending)(builder); @@ -5339,21 +5275,16 @@ export function storeDepthBalanceInfo(depthBalanceInfo: DepthBalanceInfo): (buil } export function loadShardAccounts(slice: Slice): ShardAccounts { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x6aced5bb))) { - 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(0x6aced5bb, 32); storeHashmapAugE(shardAccounts.anon0, storeShardAccount, storeDepthBalanceInfo)(builder); }) @@ -5598,21 +5529,16 @@ export function storeAccountBlock(accountBlock: AccountBlock): (builder: Builder } export function loadShardAccountBlocks(slice: Slice): ShardAccountBlocks { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x31fb3c58))) { - 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(0x31fb3c58, 32); storeHashmapAugE(shardAccountBlocks.anon0, storeAccountBlock, storeCurrencyCollection)(builder); }) @@ -6706,25 +6632,24 @@ export function storeShardStateUnsplit(shardStateUnsplit: ShardStateUnsplit): (b } export function loadShardState(slice: Slice): ShardState { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x313f365c))) { + if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5f327da5))) { slice.loadUint(32); - let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice); + let slice1 = slice.loadRef().beginParse(); + let left: ShardStateUnsplit = loadShardStateUnsplit(slice1); + let slice2 = slice.loadRef().beginParse(); + let right: ShardStateUnsplit = loadShardStateUnsplit(slice2); return { - kind: 'ShardState__', - anon0: anon0, + kind: 'ShardState_split_state', + left: left, + right: right, } } - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5f327da5))) { - slice.loadUint(32); - let slice1 = slice.loadRef().beginParse(); - let left: ShardStateUnsplit = loadShardStateUnsplit(slice1); - let slice2 = slice.loadRef().beginParse(); - let right: ShardStateUnsplit = loadShardStateUnsplit(slice2); + if (true) { + let anon0: ShardStateUnsplit = loadShardStateUnsplit(slice); return { - kind: 'ShardState_split_state', - left: left, - right: right, + kind: 'ShardState__', + anon0: anon0, } } @@ -6732,13 +6657,6 @@ export function loadShardState(slice: Slice): ShardState { } export function storeShardState(shardState: ShardState): (builder: Builder) => void { - if ((shardState.kind == 'ShardState__')) { - return ((builder: Builder) => { - builder.storeUint(0x313f365c, 32); - storeShardStateUnsplit(shardState.anon0)(builder); - }) - - } if ((shardState.kind == 'ShardState_split_state')) { return ((builder: Builder) => { builder.storeUint(0x5f327da5, 32); @@ -6750,6 +6668,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(''); } @@ -7430,25 +7354,20 @@ export function storeShardDescr(shardDescr: ShardDescr): (builder: Builder) => v } export function loadShardHashes(slice: Slice): ShardHashes { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x7bea3589))) { - 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(0x7bea3589, 32); storeHashmapE>(shardHashes.anon0, ((arg: BinTree) => { return ((builder: Builder) => { let cell1 = beginCell(); @@ -7518,23 +7437,18 @@ export function storeBinTreeAug(binTreeAug: BinTreeAug, storeX: (x: } export function loadShardFeeCreated(slice: Slice): ShardFeeCreated { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x8269845))) { - 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(0x8269845, 32); storeCurrencyCollection(shardFeeCreated.fees)(builder); storeCurrencyCollection(shardFeeCreated.create)(builder); }) @@ -7542,49 +7456,39 @@ export function storeShardFeeCreated(shardFeeCreated: ShardFeeCreated): (builder } export function loadShardFees(slice: Slice): ShardFees { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x6136639f))) { - 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(0x6136639f, 32); storeHashmapAugE(shardFees.anon0, storeShardFeeCreated, storeShardFeeCreated)(builder); }) } export function loadConfigParams(slice: Slice): ConfigParams { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x44d63bde))) { - 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(0x44d63bde, 32); builder.storeBits(configParams.config_addr); let cell1 = beginCell(); storeHashmap(configParams.config, ((arg: Slice) => { @@ -7643,23 +7547,18 @@ export function storeValidatorBaseInfo(validatorBaseInfo: ValidatorBaseInfo): (b } export function loadKeyMaxLt(slice: Slice): KeyMaxLt { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x5da0639c))) { - 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(0x5da0639c, 32); storeBool(keyMaxLt.key)(builder); builder.storeUint(keyMaxLt.max_end_lt, 64); }) @@ -7667,23 +7566,18 @@ export function storeKeyMaxLt(keyMaxLt: KeyMaxLt): (builder: Builder) => void { } export function loadKeyExtBlkRef(slice: Slice): KeyExtBlkRef { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xaa27f21))) { - 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(0xaa27f21, 32); storeBool(keyExtBlkRef.key)(builder); storeExtBlkRef(keyExtBlkRef.blk_ref)(builder); }) @@ -7691,21 +7585,16 @@ export function storeKeyExtBlkRef(keyExtBlkRef: KeyExtBlkRef): (builder: Builder } export function loadOldMcBlocksInfo(slice: Slice): OldMcBlocksInfo { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x725093d))) { - 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(0x725093d, 32); storeHashmapAugE(oldMcBlocksInfo.anon0, storeKeyExtBlkRef, storeKeyMaxLt)(builder); }) @@ -7904,15 +7793,6 @@ export function storeCryptoSignatureSimple(cryptoSignatureSimple: CryptoSignatur } export function loadCryptoSignature(slice: Slice): CryptoSignature { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x232dece3))) { - 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(); @@ -7924,18 +7804,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(0x232dece3, 32); - storeCryptoSignatureSimple(cryptoSignature.anon0)(builder); - }) - - } if ((cryptoSignature.kind == 'CryptoSignature_chained_signature')) { return ((builder: Builder) => { builder.storeUint(0xf, 4); @@ -7945,6 +7826,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(''); } @@ -8244,8 +8131,7 @@ export function storeValidatorSet(validatorSet: ValidatorSet): (builder: Builder } export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x73a8e939) && (arg0 == 0)))) { - slice.loadUint(32); + if ((arg0 == 0)) { let config_addr: BitString = slice.loadBits(256); return { kind: 'ConfigParam__', @@ -8253,8 +8139,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x54b6a30e) && (arg0 == 1)))) { - slice.loadUint(32); + if ((arg0 == 1)) { let elector_addr: BitString = slice.loadBits(256); return { kind: 'ConfigParam__1', @@ -8262,8 +8147,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x140a60cd) && (arg0 == 2)))) { - slice.loadUint(32); + if ((arg0 == 2)) { let minter_addr: BitString = slice.loadBits(256); return { kind: 'ConfigParam__2', @@ -8271,8 +8155,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x1f8e5906) && (arg0 == 3)))) { - slice.loadUint(32); + if ((arg0 == 3)) { let fee_collector_addr: BitString = slice.loadBits(256); return { kind: 'ConfigParam__3', @@ -8280,8 +8163,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x539877d6) && (arg0 == 4)))) { - slice.loadUint(32); + if ((arg0 == 4)) { let dns_root_addr: BitString = slice.loadBits(256); return { kind: 'ConfigParam__4', @@ -8289,8 +8171,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x439fe43d) && (arg0 == 5)))) { - slice.loadUint(32); + if ((arg0 == 5)) { let anon0: BurningConfig = loadBurningConfig(slice); return { kind: 'ConfigParam__5', @@ -8298,8 +8179,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x657ceda4) && (arg0 == 6)))) { - slice.loadUint(32); + if ((arg0 == 6)) { let mint_new_price: Grams = loadGrams(slice); let mint_add_price: Grams = loadGrams(slice); return { @@ -8309,8 +8189,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x13b3e23b) && (arg0 == 7)))) { - slice.loadUint(32); + if ((arg0 == 7)) { let to_mint: ExtraCurrencyCollection = loadExtraCurrencyCollection(slice); return { kind: 'ConfigParam__7', @@ -8318,8 +8197,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x7cc939b3) && (arg0 == 8)))) { - slice.loadUint(32); + if ((arg0 == 8)) { let anon0: GlobalVersion = loadGlobalVersion(slice); return { kind: 'ConfigParam__8', @@ -8327,8 +8205,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x576c3788) && (arg0 == 9)))) { - slice.loadUint(32); + if ((arg0 == 9)) { let mandatory_params: Hashmap = loadHashmap(slice, 32, loadTrue); return { kind: 'ConfigParam__9', @@ -8336,8 +8213,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x54c7bee6) && (arg0 == 10)))) { - slice.loadUint(32); + if ((arg0 == 10)) { let critical_params: Hashmap = loadHashmap(slice, 32, loadTrue); return { kind: 'ConfigParam__10', @@ -8345,8 +8221,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x5e24c290) && (arg0 == 11)))) { - slice.loadUint(32); + if ((arg0 == 11)) { let anon0: ConfigVotingSetup = loadConfigVotingSetup(slice); return { kind: 'ConfigParam__11', @@ -8354,8 +8229,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x3074376c) && (arg0 == 12)))) { - slice.loadUint(32); + if ((arg0 == 12)) { let workchains: HashmapE = loadHashmapE(slice, 32, loadWorkchainDescr); return { kind: 'ConfigParam__12', @@ -8363,8 +8237,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x19c3905a) && (arg0 == 13)))) { - slice.loadUint(32); + if ((arg0 == 13)) { let anon0: ComplaintPricing = loadComplaintPricing(slice); return { kind: 'ConfigParam__13', @@ -8372,8 +8245,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xad661db) && (arg0 == 14)))) { - slice.loadUint(32); + if ((arg0 == 14)) { let anon0: BlockCreateFees = loadBlockCreateFees(slice); return { kind: 'ConfigParam__14', @@ -8381,8 +8253,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x3487eadb) && (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); @@ -8396,8 +8267,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x3993e4d6) && (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); @@ -8418,8 +8288,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x11848225) && (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); @@ -8433,8 +8302,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x6b4c6702) && (arg0 == 18)))) { - slice.loadUint(32); + if ((arg0 == 18)) { let anon0: Hashmap = loadHashmap(slice, 32, loadStoragePrices); return { kind: 'ConfigParam__18', @@ -8442,8 +8310,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xb916605) && (arg0 == 19)))) { - slice.loadUint(32); + if ((arg0 == 19)) { let global_id: number = slice.loadInt(32); return { kind: 'ConfigParam__19', @@ -8451,8 +8318,55 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x500e41c8) && (arg0 == 28)))) { - slice.loadUint(32); + 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__26', @@ -8460,8 +8374,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x5d933fdf) && (arg0 == 29)))) { - slice.loadUint(32); + if ((arg0 == 29)) { let anon0: ConsensusConfig = loadConsensusConfig(slice); return { kind: 'ConfigParam__27', @@ -8469,8 +8382,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x6bbc2369) && (arg0 == 31)))) { - slice.loadUint(32); + if ((arg0 == 31)) { let fundamental_smc_addr: HashmapE = loadHashmapE(slice, 256, loadTrue); return { kind: 'ConfigParam__28', @@ -8478,8 +8390,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x7d31022b) && (arg0 == 32)))) { - slice.loadUint(32); + if ((arg0 == 32)) { let prev_validators: ValidatorSet = loadValidatorSet(slice); return { kind: 'ConfigParam__29', @@ -8487,8 +8398,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x1e48f929) && (arg0 == 33)))) { - slice.loadUint(32); + if ((arg0 == 33)) { let prev_temp_validators: ValidatorSet = loadValidatorSet(slice); return { kind: 'ConfigParam__30', @@ -8496,8 +8406,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x3b08e907) && (arg0 == 34)))) { - slice.loadUint(32); + if ((arg0 == 34)) { let cur_validators: ValidatorSet = loadValidatorSet(slice); return { kind: 'ConfigParam__31', @@ -8505,8 +8414,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x29a48da1) && (arg0 == 35)))) { - slice.loadUint(32); + if ((arg0 == 35)) { let cur_temp_validators: ValidatorSet = loadValidatorSet(slice); return { kind: 'ConfigParam__32', @@ -8514,8 +8422,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x5f120fda) && (arg0 == 36)))) { - slice.loadUint(32); + if ((arg0 == 36)) { let next_validators: ValidatorSet = loadValidatorSet(slice); return { kind: 'ConfigParam__33', @@ -8523,8 +8430,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x23b0f8c4) && (arg0 == 37)))) { - slice.loadUint(32); + if ((arg0 == 37)) { let next_temp_validators: ValidatorSet = loadValidatorSet(slice); return { kind: 'ConfigParam__34', @@ -8532,8 +8438,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x71e8478c) && (arg0 == 39)))) { - slice.loadUint(32); + if ((arg0 == 39)) { let anon0: HashmapE = loadHashmapE(slice, 256, loadValidatorSignedTempKey); return { kind: 'ConfigParam__35', @@ -8541,8 +8446,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x7de3be4f) && (arg0 == 40)))) { - slice.loadUint(32); + if ((arg0 == 40)) { let anon0: MisbehaviourPunishmentConfig = loadMisbehaviourPunishmentConfig(slice); return { kind: 'ConfigParam__36', @@ -8550,8 +8454,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x3f96c8b4) && (arg0 == 43)))) { - slice.loadUint(32); + if ((arg0 == 43)) { let anon0: SizeLimitsConfig = loadSizeLimitsConfig(slice); return { kind: 'ConfigParam__37', @@ -8559,8 +8462,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x14939d74) && (arg0 == 44)))) { - slice.loadUint(32); + if ((arg0 == 44)) { let anon0: SuspendedAddressList = loadSuspendedAddressList(slice); return { kind: 'ConfigParam__38', @@ -8568,8 +8470,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x70d29ded) && (arg0 == 71)))) { - slice.loadUint(32); + if ((arg0 == 71)) { let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); return { kind: 'ConfigParam__39', @@ -8577,8 +8478,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x69dbcc57) && (arg0 == 72)))) { - slice.loadUint(32); + if ((arg0 == 72)) { let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); return { kind: 'ConfigParam__40', @@ -8586,8 +8486,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x1edcfcc1) && (arg0 == 73)))) { - slice.loadUint(32); + if ((arg0 == 73)) { let anon0: OracleBridgeParams = loadOracleBridgeParams(slice); return { kind: 'ConfigParam__41', @@ -8595,8 +8494,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x1df4510f) && (arg0 == 79)))) { - slice.loadUint(32); + if ((arg0 == 79)) { let anon0: JettonBridgeParams = loadJettonBridgeParams(slice); return { kind: 'ConfigParam__42', @@ -8604,8 +8502,7 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x14b7c5f2) && (arg0 == 81)))) { - slice.loadUint(32); + if ((arg0 == 81)) { let anon0: JettonBridgeParams = loadJettonBridgeParams(slice); return { kind: 'ConfigParam__43', @@ -8613,62 +8510,13 @@ export function loadConfigParam(slice: Slice, arg0: number): ConfigParam { } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0xdbe9448) && (arg0 == 82)))) { - slice.loadUint(32); + if ((arg0 == 82)) { let anon0: JettonBridgeParams = loadJettonBridgeParams(slice); return { kind: 'ConfigParam__44', anon0: anon0, } - } - 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, - } - } throw new Error(''); } @@ -8676,49 +8524,42 @@ 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(0x73a8e939, 32); builder.storeBits(configParam.config_addr); }) } if ((configParam.kind == 'ConfigParam__1')) { return ((builder: Builder) => { - builder.storeUint(0x54b6a30e, 32); builder.storeBits(configParam.elector_addr); }) } if ((configParam.kind == 'ConfigParam__2')) { return ((builder: Builder) => { - builder.storeUint(0x140a60cd, 32); builder.storeBits(configParam.minter_addr); }) } if ((configParam.kind == 'ConfigParam__3')) { return ((builder: Builder) => { - builder.storeUint(0x1f8e5906, 32); builder.storeBits(configParam.fee_collector_addr); }) } if ((configParam.kind == 'ConfigParam__4')) { return ((builder: Builder) => { - builder.storeUint(0x539877d6, 32); builder.storeBits(configParam.dns_root_addr); }) } if ((configParam.kind == 'ConfigParam__5')) { return ((builder: Builder) => { - builder.storeUint(0x439fe43d, 32); storeBurningConfig(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__6')) { return ((builder: Builder) => { - builder.storeUint(0x657ceda4, 32); storeGrams(configParam.mint_new_price)(builder); storeGrams(configParam.mint_add_price)(builder); }) @@ -8726,63 +8567,54 @@ export function storeConfigParam(configParam: ConfigParam): (builder: Builder) = } if ((configParam.kind == 'ConfigParam__7')) { return ((builder: Builder) => { - builder.storeUint(0x13b3e23b, 32); storeExtraCurrencyCollection(configParam.to_mint)(builder); }) } if ((configParam.kind == 'ConfigParam__8')) { return ((builder: Builder) => { - builder.storeUint(0x7cc939b3, 32); storeGlobalVersion(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__9')) { return ((builder: Builder) => { - builder.storeUint(0x576c3788, 32); storeHashmap(configParam.mandatory_params, storeTrue)(builder); }) } if ((configParam.kind == 'ConfigParam__10')) { return ((builder: Builder) => { - builder.storeUint(0x54c7bee6, 32); storeHashmap(configParam.critical_params, storeTrue)(builder); }) } if ((configParam.kind == 'ConfigParam__11')) { return ((builder: Builder) => { - builder.storeUint(0x5e24c290, 32); storeConfigVotingSetup(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__12')) { return ((builder: Builder) => { - builder.storeUint(0x3074376c, 32); storeHashmapE(configParam.workchains, storeWorkchainDescr)(builder); }) } if ((configParam.kind == 'ConfigParam__13')) { return ((builder: Builder) => { - builder.storeUint(0x19c3905a, 32); storeComplaintPricing(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__14')) { return ((builder: Builder) => { - builder.storeUint(0xad661db, 32); storeBlockCreateFees(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__15')) { return ((builder: Builder) => { - builder.storeUint(0x3487eadb, 32); builder.storeUint(configParam.validators_elected_for, 32); builder.storeUint(configParam.elections_start_before, 32); builder.storeUint(configParam.elections_end_before, 32); @@ -8792,7 +8624,6 @@ export function storeConfigParam(configParam: ConfigParam): (builder: Builder) = } if ((configParam.kind == 'ConfigParam__16')) { return ((builder: Builder) => { - builder.storeUint(0x3993e4d6, 32); builder.storeUint(configParam.max_validators, 16); builder.storeUint(configParam.max_main_validators, 16); builder.storeUint(configParam.min_validators, 16); @@ -8810,7 +8641,6 @@ export function storeConfigParam(configParam: ConfigParam): (builder: Builder) = } if ((configParam.kind == 'ConfigParam__17')) { return ((builder: Builder) => { - builder.storeUint(0x11848225, 32); storeGrams(configParam.min_stake)(builder); storeGrams(configParam.max_stake)(builder); storeGrams(configParam.min_total_stake)(builder); @@ -8820,186 +8650,165 @@ export function storeConfigParam(configParam: ConfigParam): (builder: Builder) = } if ((configParam.kind == 'ConfigParam__18')) { return ((builder: Builder) => { - builder.storeUint(0x6b4c6702, 32); storeHashmap(configParam.anon0, storeStoragePrices)(builder); }) } if ((configParam.kind == 'ConfigParam__19')) { return ((builder: Builder) => { - builder.storeUint(0xb916605, 32); builder.storeInt(configParam.global_id, 32); }) + } + if ((configParam.kind == 'ConfigParam_config_mc_gas_prices')) { + return ((builder: 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(0x500e41c8, 32); storeCatchainConfig(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__27')) { return ((builder: Builder) => { - builder.storeUint(0x5d933fdf, 32); storeConsensusConfig(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__28')) { return ((builder: Builder) => { - builder.storeUint(0x6bbc2369, 32); storeHashmapE(configParam.fundamental_smc_addr, storeTrue)(builder); }) } if ((configParam.kind == 'ConfigParam__29')) { return ((builder: Builder) => { - builder.storeUint(0x7d31022b, 32); storeValidatorSet(configParam.prev_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__30')) { return ((builder: Builder) => { - builder.storeUint(0x1e48f929, 32); storeValidatorSet(configParam.prev_temp_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__31')) { return ((builder: Builder) => { - builder.storeUint(0x3b08e907, 32); storeValidatorSet(configParam.cur_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__32')) { return ((builder: Builder) => { - builder.storeUint(0x29a48da1, 32); storeValidatorSet(configParam.cur_temp_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__33')) { return ((builder: Builder) => { - builder.storeUint(0x5f120fda, 32); storeValidatorSet(configParam.next_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__34')) { return ((builder: Builder) => { - builder.storeUint(0x23b0f8c4, 32); storeValidatorSet(configParam.next_temp_validators)(builder); }) } if ((configParam.kind == 'ConfigParam__35')) { return ((builder: Builder) => { - builder.storeUint(0x71e8478c, 32); storeHashmapE(configParam.anon0, storeValidatorSignedTempKey)(builder); }) } if ((configParam.kind == 'ConfigParam__36')) { return ((builder: Builder) => { - builder.storeUint(0x7de3be4f, 32); storeMisbehaviourPunishmentConfig(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__37')) { return ((builder: Builder) => { - builder.storeUint(0x3f96c8b4, 32); storeSizeLimitsConfig(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__38')) { return ((builder: Builder) => { - builder.storeUint(0x14939d74, 32); storeSuspendedAddressList(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__39')) { return ((builder: Builder) => { - builder.storeUint(0x70d29ded, 32); storeOracleBridgeParams(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__40')) { return ((builder: Builder) => { - builder.storeUint(0x69dbcc57, 32); storeOracleBridgeParams(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__41')) { return ((builder: Builder) => { - builder.storeUint(0x1edcfcc1, 32); storeOracleBridgeParams(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__42')) { return ((builder: Builder) => { - builder.storeUint(0x1df4510f, 32); storeJettonBridgeParams(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__43')) { return ((builder: Builder) => { - builder.storeUint(0x14b7c5f2, 32); storeJettonBridgeParams(configParam.anon0)(builder); }) } if ((configParam.kind == 'ConfigParam__44')) { return ((builder: Builder) => { - builder.storeUint(0xdbe9448, 32); storeJettonBridgeParams(configParam.anon0)(builder); }) - } - if ((configParam.kind == 'ConfigParam_config_mc_gas_prices')) { - return ((builder: 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); - }) - } throw new Error(''); } @@ -10973,36 +10782,31 @@ export function storeVmStackValue(vmStackValue: VmStackValue): (builder: Builder } export function loadVmCellSlice(slice: Slice): VmCellSlice { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x65a00962))) { - 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(0x65a00962, 32); let cell1 = beginCell(); cell1.storeSlice(vmCellSlice._cell); builder.storeRef(cell1); @@ -11174,21 +10978,16 @@ export function storeVmStackList(vmStackList: VmStackList): (builder: Builder) = } export function loadVmSaveList(slice: Slice): VmSaveList { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x59072e9c))) { - 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(0x59072e9c, 32); storeHashmapE(vmSaveList.cregs, storeVmStackValue)(builder); }) @@ -11223,25 +11022,20 @@ export function storeVmGasLimits(vmGasLimits: VmGasLimits): (builder: Builder) = } export function loadVmLibraries(slice: Slice): VmLibraries { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x32869156))) { - 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(0x32869156, 32); storeHashmapE(vmLibraries.libraries, ((arg: Slice) => { return ((builder: Builder) => { let cell1 = beginCell(); @@ -11531,25 +11325,20 @@ export function storeVmCont(vmCont: VmCont): (builder: Builder) => void { } export function loadDNS_RecordSet(slice: Slice): DNS_RecordSet { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0xdf62588))) { - slice.loadUint(32); - let anon0: HashmapE = loadHashmapE(slice, 256, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadDNSRecord(slice1) - - })); - 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(0xdf62588, 32); storeHashmapE(dNS_RecordSet.anon0, ((arg: DNSRecord) => { return ((builder: Builder) => { let cell1 = beginCell(); diff --git a/generated_test.ts b/generated_test.ts index e5e87ba..f108977 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -436,18 +436,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 { @@ -1509,21 +1509,16 @@ export function storeMathExprAsCombArg(mathExprAsCombArg: MathExprAsCombArg): (b } export function loadEmptyTag(slice: Slice): EmptyTag { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x26285f32))) { - 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(0x26285f32, 32); builder.storeUint(emptyTag.a, 32); }) @@ -1846,23 +1841,18 @@ export function storeHashmapEUser(hashmapEUser: HashmapEUser): (builder: Builder } export function loadConditionalField(slice: Slice): ConditionalField { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x74a0d067))) { - 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(0x74a0d067, 32); builder.storeUint(conditionalField.a, 1); if ((conditionalField.b != undefined)) { builder.storeUint(conditionalField.b, 32); @@ -1872,23 +1862,18 @@ export function storeConditionalField(conditionalField: ConditionalField): (buil } export function loadBitSelection(slice: Slice): BitSelection { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x1528067f))) { - 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(0x1528067f, 32); builder.storeUint(bitSelection.a, 6); if ((bitSelection.b != undefined)) { builder.storeUint(bitSelection.b, 32); @@ -1898,24 +1883,19 @@ export function storeBitSelection(bitSelection: BitSelection): (builder: Builder } export function loadImplicitCondition(slice: Slice): ImplicitCondition { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x353d8910))) { - 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(0x353d8910, 32); builder.storeUint(implicitCondition.flags, 10); if ((!(implicitCondition.flags <= 100))) { throw new Error(''); @@ -1925,8 +1905,7 @@ export function storeImplicitCondition(implicitCondition: ImplicitCondition): (b } export function loadMultipleEmptyConstructor(slice: Slice, arg0: number): MultipleEmptyConstructor { - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x366f94f) && (arg0 == 0)))) { - slice.loadUint(32); + if ((arg0 == 0)) { let a: number = slice.loadUint(32); return { kind: 'MultipleEmptyConstructor__', @@ -1934,8 +1913,7 @@ export function loadMultipleEmptyConstructor(slice: Slice, arg0: number): Multip } } - if (((slice.remainingBits >= 32) && ((slice.preloadUint(32) == 0x6e936965) && (arg0 == 1)))) { - slice.loadUint(32); + if ((arg0 == 1)) { let b: number = slice.loadUint(5); return { kind: 'MultipleEmptyConstructor__1', @@ -1957,14 +1935,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(0x366f94f, 32); builder.storeUint(multipleEmptyConstructor.a, 32); }) } if ((multipleEmptyConstructor.kind == 'MultipleEmptyConstructor__1')) { return ((builder: Builder) => { - builder.storeUint(0x6e936965, 32); builder.storeUint(multipleEmptyConstructor.b, 5); }) @@ -2164,15 +2140,6 @@ export function storeFalseAnonField(falseAnonField: FalseAnonField): (builder: B } export function loadConstructorOrder(slice: Slice): ConstructorOrder { - if (((slice.remainingBits >= 32) && (slice.preloadUint(32) == 0x4fb00127))) { - 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 +2148,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(0x4fb00127, 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); }) } diff --git a/src/codegen/util.ts b/src/codegen/util.ts index 07fae15..7bdc52b 100644 --- a/src/codegen/util.ts +++ b/src/codegen/util.ts @@ -364,6 +364,17 @@ export function calculateVariables(constructor: TLBConstructor) { export function getConstructorTag(declaration: Declaration, input: string[]): TLBConstructorTag { let tag = declaration.constructorDef.tag; + if (declaration.combinator.name == 'InMsgDescr') { + console.log(tag) + console.log(declaration.constructorDef) + + } + 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 +382,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, From ad8833a488230add14ebc4db17fc12066c91ca15 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Tue, 12 Dec 2023 22:22:46 -0500 Subject: [PATCH 04/14] add test for opcode --- tests/tlbgen.spec.ts | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/tests/tlbgen.spec.ts b/tests/tlbgen.spec.ts index 4b17510..722e718 100644 --- a/tests/tlbgen.spec.ts +++ b/tests/tlbgen.spec.ts @@ -97,38 +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); -} - -function logCell(cs: Slice) { - let res = '' - while(cs.remainingBits >= 4) { - res += cs.loadUint(4).toString(16); - } - if (cs.remainingBits) { - res += cs.loadUint(cs.remainingBits).toString(16); - } - while(cs.remainingRefs) { - if (!cs.loadRef().isExotic) { - res += '\n\t' + logCell(cs.loadRef().beginParse()) - } else { - cs.loadRef(); - res += '\n\texotic' - } - } - return res; -} - describe('Generating tlb code', () => { test('Basic types', () => { - let tlf: TLFunction = {decode: null, encode:theEncode} - callf(tlf); - expect.hasAssertions() const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQAAAAAAAAAAAAAAAAACCJygAAAAAWQpXggAACE4Ni/9xAGyx8EgCgQDAdkAAAAAAAAAAP//////////glm7Tyr7ph7bvcoliLx6hZAAAhODYReUQBssfBAKstMwDM/+WPxY9XNFdU/4cu5AdlJJxlQd/rujBrVRmS8DPQgPzqUD9KMX8as2Dwctu9c04+8yNoUKVi2nVyoIECITgglm7Tyr7ph7cAUQIxMBBLN2nlX3TD24GAYQIxMBAZDm24nj3jYYBywVIxMBAQHXwZPFZ1f4SRIIAgEgoQkAE7////+8hct+TjABEQAAAAAAAAAAUKICEbjkjftDxPT2BA0MAA0AEO5rKAAIAiWCWbtPKwbudNwSzdp5V90w9sAIEBACoJvHqYcAAAAAhAECCJygAAAAAQAAAAAAAAAAAAAAAABkKV4IAAAhODYv/cAAACE4Ni/9xGSeizgABnF2AbLHwQGyxDjEAAAAAwAAAAAAAAAuRg8AmAAAITg2ILuBAgicn5OTTn6kV5z6E216F7w1p7ywI+Wsbfm4l7+fH+PH3tbaRLtCQmSNinuI8RM1X14LJBOd+k8nDROIBcr5XT35BMwCASARFgATvgAAA7yRYnrqkCMTAQCVZm3cySLJmM8TJCITAQBXbLG1sxxLaBSmIhEA7TNAkoCvNMhLqAIBIBcWABO/////vIuW/JxQABO+AAADvJFVjgoQIxMBAyKPwswTbge4RG8ZABGgAAAA7xs7OCQDiUoz9v0AAAAAMhjte0ADZ9Ue4JasekQN2qxAbkcpsPnm3xb+QdycBRLKp6O4P7y5zuVClQ61W4lQ2I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bFAFEAAAAHKamjF34U6KK3xtVYfJKAXDfvq96k6gufJtm4qCqODWvc6mJQQChIAQH+tf9oIOL/DZSD5+DWLIF9hGeJ+0rlgMh4hm2VnavVwAAHKEgBAUgdtUNfI6DNuGnT4LxXs0enI/3ZDm/o4GHoKSGDln4+AAkoSAEBPGpn9ZfihdTNKNHBnuCU+UJCqd2zuEnF8cCnicSLziUACChIAQGMKLC8jkc1VDLelznZZQAbKi948QotANztzp+kaw4W7QAIKEgBAVMWIkIDHF47BX2a46BlCEEASbT5onV/U/84xeSJyavbABIoSAEBjEEiz61R0H6dN/31qP+jdNbMpw2LOYRARFnHgWqSWNQAFihIAQH7oZuYMFt25/R/rDYjGn6YHeVcFBL0C+pwhZCqt/bUbQAYKEgBAejgWpiIE/DT5RzO8P3ny8oYPEHblFq5UlxWkXAW5QQUAB0oSAEBHEzwo1WeCo4ej1Vob5/vEp/iY9isaWQiUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; @@ -137,7 +107,7 @@ describe('Generating tlb code', () => { // fs.writeFile('kek' + '.txt', Cell.fromBase64(state).toString(), () => { }); let blk = loadBlock(cs); - console.log(blk) + // console.log(blk) let simple: Simple = { kind: 'Simple', a: 827, b: 387 } checkSameOnStoreLoad(simple, loadSimple, storeSimple); @@ -249,7 +219,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} @@ -360,7 +330,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); @@ -386,6 +356,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', () => { From 16e22c75352a9de6f9c5cf87eac8a3368a4745bc Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Wed, 13 Dec 2023 00:50:03 -0500 Subject: [PATCH 05/14] tmp --- generated_block.ts | 29 ++-- lol.txt | 327 +++++++++++++++++++++++++++++++++++++++++++ tests/my.spec.ts | 46 +++--- tests/tlbgen.spec.ts | 25 ++-- 4 files changed, 375 insertions(+), 52 deletions(-) create mode 100644 lol.txt diff --git a/generated_block.ts b/generated_block.ts index 4596bcc..8a13983 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -1,4 +1,4 @@ -import { Builder } from 'ton' +import { Builder, Cell } from 'ton' import { Slice } from 'ton' import { beginCell } from 'ton' import { BitString } from 'ton' @@ -314,7 +314,7 @@ export interface VarUInteger { readonly kind: 'VarUInteger'; readonly n: number; readonly len: number; - readonly value: number; + readonly value: bigint; } export interface VarInteger { @@ -1141,7 +1141,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; } @@ -3666,7 +3666,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, @@ -3679,7 +3679,9 @@ export function loadVarUInteger(slice: Slice, n: number): VarUInteger { export function storeVarUInteger(varUInteger: VarUInteger): (builder: Builder) => void { return ((builder: Builder) => { builder.storeUint(varUInteger.len, bitLen((varUInteger.n - 1))); - builder.storeUint(varUInteger.value, (varUInteger.len * 8)); + if (varUInteger.len > 0) { + builder.storeUint(varUInteger.value, (varUInteger.len * 8)); + } }) } @@ -4352,7 +4354,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); @@ -5361,7 +5363,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); @@ -5375,7 +5377,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); @@ -6347,7 +6349,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); @@ -6885,8 +6887,7 @@ export function loadBlock(slice: Slice): Block { let slice2 = slice.loadRef().beginParse(); let value_flow: ValueFlow = loadValueFlow(slice2); let cell3 = slice.loadRef(); - // let slice3 = slice.loadRef().beginParse(); - // let state_update: MERKLE_UPDATE = loadMERKLE_UPDATE(slice3, loadShardState); + let state_update: Cell = cell3; let slice4 = slice.loadRef().beginParse(); let extra: BlockExtra = loadBlockExtra(slice4); return { @@ -6894,7 +6895,7 @@ export function loadBlock(slice: Slice): Block { global_id: global_id, info: info, value_flow: value_flow, - // state_update: state_update, + state_update: state_update, extra: extra, } @@ -6912,9 +6913,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); diff --git a/lol.txt b/lol.txt new file mode 100644 index 0000000..33fb80a --- /dev/null +++ b/lol.txt @@ -0,0 +1,327 @@ +x{11EF55AAFFFFFF11} + x{9BC7A98700000000840102089CA0000000010000000000000000000000000064295E0800002138362FFDC000002138362FFDC4649E8B380006717601B2C7C101B2C438C400000003000000000000002E} + x{000021383611794401B2C7C100AB2D3300CCFFE58FC58F57345754FF872EE40765249C6541DFEBBA306B551992F033D080FCEA503F4A317F1AB360F072DBBD734E3EF3236850A562DA7572A0} + x{000021383620BB8102089C9F93934E7EA4579CFA136D7A17BC35A7BCB023E5AC6DF9B897BF9F1FE3C7DED6DA44BB4242648D8A7B88F113355F5E0B24139DFA4F270D138805CAF95D3DF904CC} + x{B8E48DFB43C4F4F604_} + x{8259BB4F2B06EE74DC12CDDA7957DD30F6C00} + x{2_} + x{BE000003BC91627AEA9_} + x{BFFFFFFFBC8B96FC9C5_} + x{2_} + x{BE000003BC91627AEA9_} + x{BFFFFFFFBC8B96FC9C5_} + x{0010EE6B28000} + u{044505CDB6BB0B791407B92E4C15F7F69408C1B70CC1059A1A412FF57EB410C8FE05776DF6C487D5F58DA84FA19A4C5E90BA4F04E87B6A0102229C24231680CCE302190219} + x{9023AFE2FFFFFF110000000000000000000000000002089C9F0000000164295E05000021383620BB8101B2C7BF2_} + p{01013B1714D078D245D415BFC8F3FF645D98D3D789D1C9AC45CA4C487BEF2A726CA00002} + x{820966ED3CAC1BB9D37_} + x{0104B3769E560DDCE9B} + x{0103228FC3811B0789D} + p{01013DF0A2180FBF8310E3EBF3EE0337E3DB4F3C5607B2A95948CB9EBC39B7B781010215} + x{01014070C1CC7BE4DBD} + p{0101335FA553EA4BCA6BDDB4E487595CB1F5127CD062DE48C641510A5F7C2FC6A81D0061} + x{0100500A6EFEE201B29} + x{00FD67093028550BD} + x{00FC517E975F6162F} + x{00E3929D9C8C7EFC8} + x{00E2AB2314DEA6A24} + x{00E2981DD9981B270} + x{00E1DD0C507F2BB90} + p{0101382B16F00C5310BAED87D5AD7F1D067E70B3C0E871C3BFE7A6071658FD0F89C0001C} + x{00C6051B0DBB064} + p{01015B52DBBFDE38BC2D6155B14B477CCE467DE02546347147685BCEE999F95032540019} + x{00C51DF7B0B1370} + x{00C472FA627A36A} + p{0101AA58BFD93E60FDC0E0B56EEB49D336E409C5B835B3B89825E03192C6A607AAE50017} + x{00C42EA4740B996} + p{0101C0BC26E547B2EA220627D3E27DB49753C70793B1CBE233DE65B09159EB8FBC720015} + x{00C428B80EA823C} + x{00C420AB37315A6} + p{0101E717A923ABE0AD67F2FF9AE27916C2CFEA60885164EA1E47E8BD03F22EFD9CFE0014} + x{00C4206976EFBC0} + p{0101CAC41590635CBF68EBE29DBC8C5C118A136358F0CEC5C0830E6A31A7DFF0D21C0010} + x{00C41EF2D28ADB6} + x{00C41EEA3DE89D8} + p{01011E0AC340288F71D6341EB0FB314EB3284CD5B06DA8EE1FAE4BDA56B3CC1B9C9F000C} + x{00C41EE948E3D28} + x{5031068631CA7612_} + x{BA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C03106861E13C993C7C9FE9481C241BD8A281B788EAED1421C3A9B639E0471ABC77EBD52D2E8B634000084E016334706_} + x{C00606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C2188219C3214A98F8000084E01633470D883430F09E4C934_} + p{01019494D1CC8EDF12F05671A1A9BA09921096EB50811E1924EC65C3C629FBB808120004} + p{010134934EFEB320C3614BA963232A3D97A0F0D9343A41113EA96D852BE1E3DE214A0001} + p{01010CFBF895A4279219543BBFB4B028EA8C2EC00FEDE4BA119A3A75403FA5F50F100008} + p{010175964F16FF7B25221B550E09C898280EE4E49BCDE70BA8C460355CC06C683632000B} + p{0101466D1F8C839BE0F4C073E7E5871EF4111F0DB32869A8E507551DD6637F3AD956000D} + p{0101A21C0CCFC1FC0E46C069D3693D595DDC8C568451D490DFAB117A5D634424CD240014} + p{0101341DCE03478E7C34F1FE412B12E7DC7A487A004F3FB367A678612C559947386F0018} + p{010133AF19EA836262A204FF10952173423B90C7801087D2FE83F28D089562D26EDF0026} + p{01014F4DA78B7B4B5B95205258C40DB2DD9D1F1F7CC9947FF42623986733FE7882BD0025} + p{0101902404EFA41FB7E1B55FE73DD5E5FD8857F4DD71E1B65F812AE99B2D5E207FC20024} + p{0101C5D2BAFC40ED77F48AB8D61A99284AC25BC00226B8A3608335447A498EAB53F20038} + p{0101D7ACBB602338C86D610F35CFB362FD76FC18B1812476B6FCA99A0678E665FCF50000} + p{0101C6241C72471DA7C63E4B68F139D5B4190AF49F7E40F33210AC30ABDA0E7070AE005F} + p{0101D7ACBB602338C86D610F35CFB362FD76FC18B1812476B6FCA99A0678E665FCF50000} + p{01012B53E9EAF845A41878D7BFF2B41581A33E0B911CEA033158A2D004CFECDCE3FD003A} + p{0101ED7E26BD36EFA6D5D9B4F6AAAB9813AF0742A84244977F74FD4074C9C98908BE0000} + p{0101ED7E26BD36EFA6D5D9B4F6AAAB9813AF0742A84244977F74FD4074C9C98908BE0000} + p{01016F315F25B4A39AC12C85FEA4ECFE7A83E5E59D1F059783FA0C3EF279730880610000} + x{010190E6DAD4F2D55FF} + x{010101D7C0DED45E81D} + p{0101E2BECF418BA09257A8799C82252615A6FE7061371B4E6423314BD5F1AFC7EEF20067} + x{010095666D27D819F37} + p{0101BA011F0CFD2FD4076DF35E604C9BCD1B8F011558562DECDD01FE089C4498EBD70065} + x{0100576CB100C213754} + x{00ED333FDD8FA65EA} + x{00E7DC8F8C05F9938} + x{00E02AF92CDEC2544} + x{00CD609D35A27FC} + p{01011C4CF0A3559E0A8E1E8F55686F9FEF129FE263D8AC6964225233CA2D749AD85D0027} + x{00C58EE0516C6AC} + p{0101E8E05A988813F0D3E51CCEF0FDE7CBCA183C41DB945AB9525C56917016E50414001D} + x{00C38498E8435DC} + x{00C2676676B41BE} + x{00C0B325678E7E8} + p{0101FBA19B98305B76E7F47FAC36231A7E981DE55C1412F40BEA708590AAB7F6D46D0018} + x{00C0450982B5E66} + p{01018C4122CFAD51D07E9D37FDF5A8FFA374D6CCA70D8B3984404459C7816A9258D40016} + x{00C020D56AFB542} + x{00BF74E9E366C} + x{00BD73C5D3AD4} + p{010153162242031C5E3B057D9AE3A06508410049B4F9A2757F53FF38C5E489C9ABDB0012} + x{00A0413361AAE} + x{00A03FB2F39C4} + x{00A0229D2AE98} + p{01018C28B0BC8E47355432DE9739D965001B2A2F78F10A2D00DCEDCE9FA46B0E16ED0008} + x{00A0224E556CC} + x{00A021CE556CC} + p{01013C6A67F597E285D4CD28D1C19EE094F94242A9DDB3B849C5F1C0A789C48BCE250008} + x{009D3F6CFD2} + p{0101481DB5435F23A0CDB869D3E0BC57B347A723FDD90E6FE8E061E8292183967E3E0009} + x{BA6ADE71DFCF5C7375AB6805BCBFDBBFB473604B4D17A084B9FEB08816EB404E6A4508536716E29930468E1F9818AA2E720DD13DE7043086E7AD975FBB1D0F6B1D9C8AC80001094408285E0C_} + x{C00B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A22C858E43212E0B80000084A204142F0D39A91421534_} + p{0101FEB5FF6820E2FF0D9483E7E0D62C817D846789FB4AE580C878866D959DABD5C00007} + x{0000000729A9A3177E14E8A2B7C6D5587C92805C37EFABDEA4EA0B9F26D9B8A82A8E0D6BDCEA62504_} + p{01017C4D05EDDB6C75FBF5C8D53EF726F1CBD92AD3C4190A8B3FD233AD191B21F8D60009} + p{010142BB3144A3AD75955EE6416142A51D42ABAE84065FEC9F5A1B4D873EE537C9FA000B} + p{0101E975BCCADE13E7C125532BAEC89E7874C1AD154D027B1554C9C2152376BC7366000D} + p{0101457DA401CF28E66FFCB7FB77B0410C986AAAE7F5BB77BFC5F4521DB8DE9DB8D9000F} + p{0101703704776AD2237497F6FDE9686E1EC3B81EF99E2FD2B9FB850B1C56381CDD870014} + p{0101CC1DAA155C33989D1133C6998B18A50693D3946C741AD0948B9EC503E8B3BEB0001B} + p{0101C35FE470AF7DFF3C7183867EAE2130BB19438AE998DDE9E531128C865E1D87DD001A} + p{0101C817780520281267914DE4240BB2A5C41DD78A8DD97655393BDA6928F4A90AE6001E} + p{0101CBB45B0E87EBB7CBE82E0FEDE2D31C2917900081CCFC358BF740FC09F0667E5C002C} + p{0101DE9217E0224DFAA82F60C0D93FE25A49C09265AD9FBA9A09B4C4D13020CBA1C4002A} + p{0101A0831A37E357E0BE440ACB7B676F614ECA66E284FAA0C7C5D76B5BB0BA4FF176005E} + p{01013E8566F5F5F2B901F000BB83A3E2BC2241CAA776D7CF39A9F96941FB8081799C0000} + p{0101EC90A44EEE02BED840C10E88351163EE9E3613EB9DBE8DA760783DA449714E280001} + p{01015D730BC79B61A2DEFCD1E502BA3336692765E8C46EACF5C53903E35E71A636650067} + p{0101BB06F3506745C5F6A6239D132A70B38439CB60FF95F62E45261BA12E844E889B0001} + p{0101B3E9649D10CCB379368E81A3A7E8E49C8EB53F6ACC69B0BA2FFA80082F70EE390001} + p{0101B3E9649D10CCB379368E81A3A7E8E49C8EB53F6ACC69B0BA2FFA80082F70EE390001} + p{0101A515AAFB83B6EFAF10E9880D3464239A3D286BCCCCE55320C05174FA25AA52A90002} + x{9023AFE2FFFFFF110000000000000000000000000002089CA00000000164295E0800002138362FFDC401B2C7C12_} + x{00000000000000005_} + x{B0400000000000000000D963E08000109C1B17FEE16DBFE285E48E43E249A93F61BD3A57B85BB3EB580A3CDFA802CFF52C478F3C4A4_} + x{820966ED3CABEE987B7_} + x{0104B3769E55F74C3DB} + x{0103228FC2CC136E07B} + p{01013DF0A2180FBF8310E3EBF3EE0337E3DB4F3C5607B2A95948CB9EBC39B7B781010215} + x{01014070C117744B59B} + p{0101335FA553EA4BCA6BDDB4E487595CB1F5127CD062DE48C641510A5F7C2FC6A81D0061} + x{0100500A6E49DA68307} + x{00FD67087B20BB89B} + x{00FC517DE257C7E0D} + x{00E3929CE784E57A6} + x{00E2AB225FD70D202} + x{00E2981D249081A4E} + x{00E1DD0B9B779236E} + p{0101382B16F00C5310BAED87D5AD7F1D067E70B3C0E871C3BFE7A6071658FD0F89C0001C} + x{00C604660621842} + p{01015B52DBBFDE38BC2D6155B14B477CCE467DE02546347147685BCEE999F95032540019} + x{00C51D42A917B4E} + x{00C472455AE0B48} + p{0101AA58BFD93E60FDC0E0B56EEB49D336E409C5B835B3B89825E03192C6A607AAE50017} + x{00C42DEF6C72174} + p{0101C0BC26E547B2EA220627D3E27DB49753C70793B1CBE233DE65B09159EB8FBC720015} + x{00C42803070EA1A} + x{00C41FF62F97D84} + p{0101E717A923ABE0AD67F2FF9AE27916C2CFEA60885164EA1E47E8BD03F22EFD9CFE0014} + x{00C41FB46F5639E} + p{0101CAC41590635CBF68EBE29DBC8C5C118A136358F0CEC5C0830E6A31A7DFF0D21C0010} + x{00C41E3DCAF1594} + x{00C41E35364F1B6} + p{01011E0AC340288F71D6341EB0FB314EB3284CD5B06DA8EE1FAE4BDA56B3CC1B9C9F000C} + x{00C41E34414A506} + x{50310658EFE4158A_} + x{BA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C0310658DC2D69095CC51E39D6E690880CC91ED84A3474116C8F49C33AED0A1C3CC09EC56897BF5C000084E0D8BFF706_} + x{C00606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C2188219C3214AF040000084E0D8BFF70D8832C6E16B48534_} + p{01019494D1CC8EDF12F05671A1A9BA09921096EB50811E1924EC65C3C629FBB808120004} + x{00000001642953590F1E20FA05A095B841DFC5AD719E71E49027E63A970787F78F2B781992B68ABA73BDC400C_} + x{A03214AF210FD95F2DC_} + p{01010CFBF895A4279219543BBFB4B028EA8C2EC00FEDE4BA119A3A75403FA5F50F100008} + p{010175964F16FF7B25221B550E09C898280EE4E49BCDE70BA8C460355CC06C683632000B} + p{0101466D1F8C839BE0F4C073E7E5871EF4111F0DB32869A8E507551DD6637F3AD956000D} + p{0101A21C0CCFC1FC0E46C069D3693D595DDC8C568451D490DFAB117A5D634424CD240014} + p{0101341DCE03478E7C34F1FE412B12E7DC7A487A004F3FB367A678612C559947386F0018} + p{010133AF19EA836262A204FF10952173423B90C7801087D2FE83F28D089562D26EDF0026} + p{01014F4DA78B7B4B5B95205258C40DB2DD9D1F1F7CC9947FF42623986733FE7882BD0025} + p{0101902404EFA41FB7E1B55FE73DD5E5FD8857F4DD71E1B65F812AE99B2D5E207FC20024} + p{0101C5D2BAFC40ED77F48AB8D61A99284AC25BC00226B8A3608335447A498EAB53F20038} + x{A0000000EF18A7C924_} + p{0101C6241C72471DA7C63E4B68F139D5B4190AF49F7E40F33210AC30ABDA0E7070AE005F} + x{A0000000EF18A7C924_} + p{01012B53E9EAF845A41878D7BFF2B41581A33E0B911CEA033158A2D004CFECDCE3FD003A} + x{A0000000EF1911C4CC_} + x{A0000000EF1911C4CC_} + x{A0000000EF1B3B3824_} + x{010190E6DB89E3DE361} + x{010101D7C193C56757F} + p{0101E2BECF418BA09257A8799C82252615A6FE7061371B4E6423314BD5F1AFC7EEF20067} + x{010095666DDCC922C99} + p{0101BA011F0CFD2FD4076DF35E604C9BCD1B8F011558562DECDD01FE089C4498EBD70065} + x{0100576CB1B5B31C4B6} + x{00ED33409280AF34C} + x{00E7DC9040F70269A} + x{00E02AF9E1CFCB2A6} + x{00CD615226AB55E} + p{01011C4CF0A3559E0A8E1E8F55686F9FEF129FE263D8AC6964225233CA2D749AD85D0027} + x{00C58F95427540E} + p{0101E8E05A988813F0D3E51CCEF0FDE7CBCA183C41DB945AB9525C56917016E50414001D} + x{00C3854DD94C33E} + x{00C2681B67BCF20} + x{00C0B3DA589754A} + p{0101FBA19B98305B76E7F47FAC36231A7E981DE55C1412F40BEA708590AAB7F6D46D0018} + x{00C045BE73BEBC8} + p{01018C4122CFAD51D07E9D37FDF5A8FFA374D6CCA70D8B3984404459C7816A9258D40016} + x{00C0218A5C042A4} + x{00C02029DAEC3CE} + x{00BE28B6DC836} + p{010153162242031C5E3B057D9AE3A06508410049B4F9A2757F53FF38C5E489C9ABDB0012} + x{00A0F6246A810} + x{00A0F4A3FC726} + x{00A0D78E33BFA} + p{01018C28B0BC8E47355432DE9739D965001B2A2F78F10A2D00DCEDCE9FA46B0E16ED0008} + x{00A0D73F5E42E} + x{00A0D6BF5E42E} + p{01013C6A67F597E285D4CD28D1C19EE094F94242A9DDB3B849C5F1C0A789C48BCE250008} + x{00A0D23075D34} + p{0101481DB5435F23A0CDB869D3E0BC57B347A723FDD90E6FE8E061E8292183967E3E0009} + x{BA6ADE71DFCF5C7375AB6805BCBFDBBFB473604B4D17A084B9FEB08816EB405068E2C97363B1664ADD57954D7A335D658A1CC2E94CE8A96C8C0A6EB4E2ED111159E9257FA0000109C1B17FEE1C_} + x{C00B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A22C859043214AF040000084E0D8BFF71141A38B25CD934_} + p{0101FEB5FF6820E2FF0D9483E7E0D62C817D846789FB4AE580C878866D959DABD5C00007} + x{0000000729A9A3177E14E8A2B7C6D5587C92805C37EFABDEA4EA0B9F26D9B8A82A8E0D6BDCEA62504_} + p{01017C4D05EDDB6C75FBF5C8D53EF726F1CBD92AD3C4190A8B3FD233AD191B21F8D60009} + p{010142BB3144A3AD75955EE6416142A51D42ABAE84065FEC9F5A1B4D873EE537C9FA000B} + p{0101E975BCCADE13E7C125532BAEC89E7874C1AD154D027B1554C9C2152376BC7366000D} + p{0101457DA401CF28E66FFCB7FB77B0410C986AAAE7F5BB77BFC5F4521DB8DE9DB8D9000F} + p{0101703704776AD2237497F6FDE9686E1EC3B81EF99E2FD2B9FB850B1C56381CDD870014} + p{0101CC1DAA155C33989D1133C6998B18A50693D3946C741AD0948B9EC503E8B3BEB0001B} + p{0101C35FE470AF7DFF3C7183867EAE2130BB19438AE998DDE9E531128C865E1D87DD001A} + p{0101C817780520281267914DE4240BB2A5C41DD78A8DD97655393BDA6928F4A90AE6001E} + p{0101CBB45B0E87EBB7CBE82E0FEDE2D31C2917900081CCFC358BF740FC09F0667E5C002C} + p{0101DE9217E0224DFAA82F60C0D93FE25A49C09265AD9FBA9A09B4C4D13020CBA1C4002A} + p{0101A0831A37E357E0BE440ACB7B676F614ECA66E284FAA0C7C5D76B5BB0BA4FF176005E} + x{A0000000EF184C5AE4_} + x{2_} + x{BE000003BC84F8C240D_} + x{BFFFFFFFBC85CB7E4E3_} + p{01015D730BC79B61A2DEFCD1E502BA3336692765E8C46EACF5C53903E35E71A636650067} + x{2_} + x{BE000003BC91558E0A1_} + x{BFFFFFFFBC8B96FC9C5_} + x{2_} + x{BE000003BC91627AEA9_} + x{BFFFFFFFBC8B96FC9C5_} + x{2_} + x{BE000003BC91627AEA9_} + x{BFFFFFFFBC8B96FC9C5_} + x{0000000000000000FFFFFFFFFFFFFFFF8259BB4F2AFBA61EDBBDCA2588BC7A859000021383611794401B2C7C100AB2D3300CCFFE58FC58F57345754FF872EE40765249C6541DFEBBA306B551992F033D080FCEA503F4A317F1AB360F072DBBD734E3EF3236850A562DA7572A0} + x{2_} + x{BE000003BC91627AEA9_} + x{BFFFFFFFBC8B96FC9C5_} + x{4A33F6FD000000003218ED7B400367D51EE096AC7A440DDAAC406E4729B0F9E6DF16FE41DC9C0512CAA7A3B83FBCB9CEE542950EB55B8950D8807B4559E5450DD97FB9ED4_} + x{98738F902_} + x{0C39C7C81_} + x{BFFB5D18557F2CB862C8FD55A72B335069C1DBCFCF2DBDBCDD21ECB32944D4BCBE8004_} + x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} + x{D003} + x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} + x{E_} + x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} + x{D003} + x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{DF_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} + x{0C8057061B8732C44_} + x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} + x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} + x{BFEDBFE285E48E43E249A93F61BD3A57B85BB3EB580A3CDFA802CFF52C478F3C4A18738F90198738F94_} + x{4606030E71F2} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} + x{A_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} + x{0CBADD094169E6144F5861E3E311_} + x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} + x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} + x{82_} + x{A01B6FF8A1792390F8926A4FD86F4E95EE16ECFAD6028F37EA00B3FD4B11E3CF12805_} + x{4606030E71F2} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} + x{E_} + x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} + x{D003} + x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{DF_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} + x{0C8057061B8732C44_} + x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} + x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} + x{661CE3E5_} + x{4606030E71F2} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} + x{A_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} + x{0CBADD094169E6144F5861E3E311_} + x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} + x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} + x{9D309B72_} + x{0E984DB9_} + x{BFF036D41B2F52198152B3FD3DC263022215EB42AE8A0AB5B5AC342D3026707D8E1CB04711581B6A0D97A90CC0A959FE9EE13181110AF5A15745055ADAD61A169813383EC7280000042706C5FFB8272C11C4} + x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} + x{E_} + x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} + x{D003} + x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{DF_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} + x{0C8057061B8732C44_} + x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} + x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} + x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} + x{BFD8664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD188054616C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD6A80000042706C5FFB866201518} + x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} + x{A_} + x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} + x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} + x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} + x{0CBADD094169E6144F5861E3E311_} + x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} + x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} + x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} \ No newline at end of file diff --git a/tests/my.spec.ts b/tests/my.spec.ts index fec0556..29150b4 100644 --- a/tests/my.spec.ts +++ b/tests/my.spec.ts @@ -8,42 +8,32 @@ import { generate } from '../src/codegen/main' import { Program } from '../src/ast/nodes' import * as crc32 from 'crc-32'; +import { loadBlock, storeBlock } from '../generated_block' +import { Cell, beginCell } from 'ton' const fixturesDir = path.resolve(__dirname, 'fixtures') -function calculateRequestOpcode(scheme: string): string { - 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); -} - describe('parsing into intermediate representation using grammar', () => { test('test.tlb can be parsed', () => { + const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQAAAAAAAAAAAAAAAAACCJygAAAAAWQpXggAACE4Ni/9xAGyx8EgCgQDAdkAAAAAAAAAAP//////////glm7Tyr7ph7bvcoliLx6hZAAAhODYReUQBssfBAKstMwDM/+WPxY9XNFdU/4cu5AdlJJxlQd/rujBrVRmS8DPQg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3ny8oYPEHblFq5UlxWkXAW5QQUAB0oSAEBHEzwo1WeCo4ej1Vob5/vEp/iY9isaWQiUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; + const cs = Cell.fromBase64(state); + console.log(cs.hash()) + fs.writeFile('kek.txt', cs.toString(), () => { }); + + let blk = loadBlock(cs.beginParse()); + // console.log(util.inspect(blk.value_flow, false, null, true /* enable colors */)) - // console.log(util.inspect(babelTestAst.program.body[2], false, null, true /* enable colors */)) - let x = -`block_extra in_msg_descr:^InMsgDescr - out_msg_descr:^OutMsgDescr - account_blocks:^ShardAccountBlocks - rand_seed:bits256 - created_by:bits256 - custom:(Maybe ^McBlockExtra) = BlockExtra;` - console.log(calculateRequestOpcode(x)); + let builder = beginCell(); + storeBlock(blk)(builder); + console.log(builder.endCell().hash()) + fs.writeFile('lol.txt', builder.endCell().toString(), () => { }); + + expect(cs.hash() == builder.endCell().hash()).toBeTruthy() }) }) /* 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 722e718..03e73ea 100644 --- a/tests/tlbgen.spec.ts +++ b/tests/tlbgen.spec.ts @@ -10,7 +10,7 @@ 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 { beginCell } from 'ton' -import { loadBlock } from '../generated_block' +import { loadBlock, storeBlock } from '../generated_block' const fixturesDir = path.resolve(__dirname, 'fixtures') @@ -101,14 +101,6 @@ describe('Generating tlb code', () => { test('Basic types', () => { expect.hasAssertions() - const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQAAAAAAAAAAAAAAAAACCJygAAAAAWQpXggAACE4Ni/9xAGyx8EgCgQDAdkAAAAAAAAAAP//////////glm7Tyr7ph7bvcoliLx6hZAAAhODYReUQBssfBAKstMwDM/+WPxY9XNFdU/4cu5AdlJJxlQd/rujBrVRmS8DPQgPzqUD9KMX8as2Dwctu9c04+8yNoUKVi2nVyoIECITgglm7Tyr7ph7cAUQIxMBBLN2nlX3TD24GAYQIxMBAZDm24nj3jYYBywVIxMBAQHXwZPFZ1f4SRIIAgEgoQkAE7////+8hct+TjABEQAAAAAAAAAAUKICEbjkjftDxPT2BA0MAA0AEO5rKAAIAiWCWbtPKwbudNwSzdp5V90w9sAIEBACoJvHqYcAAAAAhAECCJygAAAAAQAAAAAAAAAAAAAAAABkKV4IAAAhODYv/cAAACE4Ni/9xGSeizgABnF2AbLHwQGyxDjEAAAAAwAAAAAAAAAuRg8AmAAAITg2ILuBAgicn5OTTn6kV5z6E216F7w1p7ywI+Wsbfm4l7+fH+PH3tbaRLtCQmSNinuI8RM1X14LJBOd+k8nDROIBcr5XT35BMwCASARFgATvgAAA7yRYnrqkCMTAQCVZm3cySLJmM8TJCITAQBXbLG1sxxLaBSmIhEA7TNAkoCvNMhLqAIBIBcWABO/////vIuW/JxQABO+AAADvJFVjgoQIxMBAyKPwswTbge4RG8ZABGgAAAA7xs7OCQDiUoz9v0AAAAAMhjte0ADZ9Ue4JasekQN2qxAbkcpsPnm3xb+QdycBRLKp6O4P7y5z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BQvDTmpFCFTQMbFAFEAAAAHKamjF34U6KK3xtVYfJKAXDfvq96k6gufJtm4qCqODWvc6mJQQChIAQH+tf9oIOL/DZSD5+DWLIF9hGeJ+0rlgMh4hm2VnavVwAAHKEgBAUgdtUNfI6DNuGnT4LxXs0enI/3ZDm/o4GHoKSGDln4+AAkoSAEBPGpn9ZfihdTNKNHBnuCU+UJCqd2zuEnF8cCnicSLziUACChIAQGMKLC8jkc1VDLelznZZQAbKi948QotANztzp+kaw4W7QAIKEgBAVMWIkIDHF47BX2a46BlCEEASbT5onV/U/84xeSJyavbABIoSAEBjEEiz61R0H6dN/31qP+jdNbMpw2LOYRARFnHgWqSWNQAFihIAQH7oZuYMFt25/R/rDYjGn6YHeVcFBL0C+pwhZCqt/bUbQAYKEgBAejgWpiIE/DT5RzO8P3ny8oYPEHblFq5UlxWkXAW5QQUAB0oSAEBHEzwo1WeCo4ej1Vob5/vEp/iY9isaWQiUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; - const cs = Cell.fromBase64(state).beginParse() - // console.log(logCell(cs)) - // fs.writeFile('kek' + '.txt', Cell.fromBase64(state).toString(), () => { }); - - let blk = loadBlock(cs); - // console.log(blk) - let simple: Simple = { kind: 'Simple', a: 827, b: 387 } checkSameOnStoreLoad(simple, loadSimple, storeSimple); let tcFalse: TwoConstructors = { 'kind': 'TwoConstructors_bool_false', a: 1000, b: 10, c: 1000 } @@ -484,4 +476,19 @@ describe('Generating tlb code', () => { } checkSameOnStoreLoad(refCombinatorAny, loadRefCombinatorAny, storeRefCombinatorAny); }) + + test('block tlb tests', () => { + const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMz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aw4W7QAIKEgBAVMWIkIDHF47BX2a46BlCEEASbT5onV/U/84xeSJyavbABIoSAEBjEEiz61R0H6dN/31qP+jdNbMpw2LOYRARFnHgWqSWNQAFihIAQH7oZuYMFt25/R/rDYjGn6YHeVcFBL0C+pwhZCqt/bUbQAYKEgBAejgWpiIE/DT5RzO8P3ny8oYPEHblFq5UlxWkXAW5QQUAB0oSAEBHEzwo1WeCo4ej1Vob5/vEp/iY9isaWQiUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; + const cs = Cell.fromBase64(state); + console.log(cs.hash()) + fs.writeFile('kek.txt', cs.toString(), () => { }); + + let blk = loadBlock(cs.beginParse()); + let builder = beginCell(); + storeBlock(blk)(builder); + console.log(builder.endCell().hash()) + fs.writeFile('lol.txt', builder.endCell().toString(), () => { }); + + expect(deepEqual(cs.hash(), builder.endCell().hash())).toBeTruthy() + }) }) From e159415e2183c2bc937cf14fb57e7ef68a8a8a08 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Wed, 13 Dec 2023 22:42:28 -0500 Subject: [PATCH 06/14] tmp --- generated_block.ts | 28 +-- generated_test.ts | 69 ++++++++ lol.txt | 327 ------------------------------------ src/codegen/combinator.ts | 9 + tests/fixtures/tlb/test.tlb | 5 +- tests/my.spec.ts | 2 +- tests/tlbgen.spec.ts | 41 ++--- 7 files changed, 119 insertions(+), 362 deletions(-) delete mode 100644 lol.txt diff --git a/generated_block.ts b/generated_block.ts index 8a13983..b1467a5 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -1,4 +1,4 @@ -import { Builder, Cell } from 'ton' +import { Builder } from 'ton' import { Slice } from 'ton' import { beginCell } from 'ton' import { BitString } from 'ton' @@ -314,7 +314,7 @@ export interface VarUInteger { readonly kind: 'VarUInteger'; readonly n: number; readonly len: number; - readonly value: bigint; + readonly value: number; } export interface VarInteger { @@ -1141,7 +1141,7 @@ export interface Block { readonly global_id: number; readonly info: BlockInfo; readonly value_flow: ValueFlow; - readonly state_update: Cell; + readonly state_update: MERKLE_UPDATE; readonly extra: BlockExtra; } @@ -3666,7 +3666,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: bigint = slice.loadUintBig((len * 8)); + let value: number = slice.loadUint((len * 8)); return { kind: 'VarUInteger', n: n, @@ -3679,9 +3679,7 @@ export function loadVarUInteger(slice: Slice, n: number): VarUInteger { export function storeVarUInteger(varUInteger: VarUInteger): (builder: Builder) => void { return ((builder: Builder) => { builder.storeUint(varUInteger.len, bitLen((varUInteger.n - 1))); - if (varUInteger.len > 0) { - builder.storeUint(varUInteger.value, (varUInteger.len * 8)); - } + builder.storeUint(varUInteger.value, (varUInteger.len * 8)); }) } @@ -4354,7 +4352,7 @@ export function storeMsgEnvelope(msgEnvelope: MsgEnvelope): (builder: Builder) = let cell1 = beginCell(); storeMessage(msgEnvelope.msg, ((arg: Slice) => { return ((builder: Builder) => { - builder.storeSlice(arg); + cell1.storeSlice(arg); }) }))(cell1); @@ -5363,7 +5361,7 @@ export function storeTransaction(transaction: Transaction): (builder: Builder) = let cell1 = beginCell(); storeMessage(arg, ((arg: Slice) => { return ((builder: Builder) => { - builder.storeSlice(arg); + cell1.storeSlice(arg); }) }))(cell1); @@ -5377,7 +5375,7 @@ export function storeTransaction(transaction: Transaction): (builder: Builder) = let cell1 = beginCell(); storeMessage(arg, ((arg: Slice) => { return ((builder: Builder) => { - builder.storeSlice(arg); + cell1.storeSlice(arg); }) }))(cell1); @@ -6349,7 +6347,7 @@ export function storeOutAction(outAction: OutAction): (builder: Builder) => void let cell1 = beginCell(); storeMessageRelaxed(outAction.out_msg, ((arg: Slice) => { return ((builder: Builder) => { - builder.storeSlice(arg); + cell1.storeSlice(arg); }) }))(cell1); @@ -6886,8 +6884,8 @@ export function loadBlock(slice: Slice): Block { let info: BlockInfo = loadBlockInfo(slice1); let slice2 = slice.loadRef().beginParse(); let value_flow: ValueFlow = loadValueFlow(slice2); - let cell3 = slice.loadRef(); - let state_update: Cell = cell3; + let slice3 = slice.loadRef().beginParse(); + let state_update: MERKLE_UPDATE = loadMERKLE_UPDATE(slice3, loadShardState); let slice4 = slice.loadRef().beginParse(); let extra: BlockExtra = loadBlockExtra(slice4); return { @@ -6913,7 +6911,9 @@ export function storeBlock(block: Block): (builder: Builder) => void { let cell2 = beginCell(); storeValueFlow(block.value_flow)(cell2); builder.storeRef(cell2); - builder.storeRef(block.state_update); + let cell3 = beginCell(); + storeMERKLE_UPDATE(block.state_update, storeShardState)(cell3); + builder.storeRef(cell3); let cell4 = beginCell(); storeBlockExtra(block.extra)(cell4); builder.storeRef(cell4); diff --git a/generated_test.ts b/generated_test.ts index f108977..4dc1f48 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -466,6 +466,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;; } @@ -2236,3 +2247,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) => { + cell1.storeSlice(arg); + }) + + }))(cell1); + builder.storeRef(cell1); + }) + +} + diff --git a/lol.txt b/lol.txt deleted file mode 100644 index 33fb80a..0000000 --- a/lol.txt +++ /dev/null @@ -1,327 +0,0 @@ -x{11EF55AAFFFFFF11} - x{9BC7A98700000000840102089CA0000000010000000000000000000000000064295E0800002138362FFDC000002138362FFDC4649E8B380006717601B2C7C101B2C438C400000003000000000000002E} - x{000021383611794401B2C7C100AB2D3300CCFFE58FC58F57345754FF872EE40765249C6541DFEBBA306B551992F033D080FCEA503F4A317F1AB360F072DBBD734E3EF3236850A562DA7572A0} - x{000021383620BB8102089C9F93934E7EA4579CFA136D7A17BC35A7BCB023E5AC6DF9B897BF9F1FE3C7DED6DA44BB4242648D8A7B88F113355F5E0B24139DFA4F270D138805CAF95D3DF904CC} - x{B8E48DFB43C4F4F604_} - x{8259BB4F2B06EE74DC12CDDA7957DD30F6C00} - x{2_} - x{BE000003BC91627AEA9_} - x{BFFFFFFFBC8B96FC9C5_} - x{2_} - x{BE000003BC91627AEA9_} - x{BFFFFFFFBC8B96FC9C5_} - x{0010EE6B28000} - u{044505CDB6BB0B791407B92E4C15F7F69408C1B70CC1059A1A412FF57EB410C8FE05776DF6C487D5F58DA84FA19A4C5E90BA4F04E87B6A0102229C24231680CCE302190219} - x{9023AFE2FFFFFF110000000000000000000000000002089C9F0000000164295E05000021383620BB8101B2C7BF2_} - p{01013B1714D078D245D415BFC8F3FF645D98D3D789D1C9AC45CA4C487BEF2A726CA00002} - x{820966ED3CAC1BB9D37_} - x{0104B3769E560DDCE9B} - x{0103228FC3811B0789D} - p{01013DF0A2180FBF8310E3EBF3EE0337E3DB4F3C5607B2A95948CB9EBC39B7B781010215} - x{01014070C1CC7BE4DBD} - p{0101335FA553EA4BCA6BDDB4E487595CB1F5127CD062DE48C641510A5F7C2FC6A81D0061} - x{0100500A6EFEE201B29} - x{00FD67093028550BD} - x{00FC517E975F6162F} - x{00E3929D9C8C7EFC8} - x{00E2AB2314DEA6A24} - x{00E2981DD9981B270} - x{00E1DD0C507F2BB90} - p{0101382B16F00C5310BAED87D5AD7F1D067E70B3C0E871C3BFE7A6071658FD0F89C0001C} - x{00C6051B0DBB064} - p{01015B52DBBFDE38BC2D6155B14B477CCE467DE02546347147685BCEE999F95032540019} - x{00C51DF7B0B1370} - x{00C472FA627A36A} - p{0101AA58BFD93E60FDC0E0B56EEB49D336E409C5B835B3B89825E03192C6A607AAE50017} - x{00C42EA4740B996} - p{0101C0BC26E547B2EA220627D3E27DB49753C70793B1CBE233DE65B09159EB8FBC720015} - x{00C428B80EA823C} - x{00C420AB37315A6} - p{0101E717A923ABE0AD67F2FF9AE27916C2CFEA60885164EA1E47E8BD03F22EFD9CFE0014} - x{00C4206976EFBC0} - p{0101CAC41590635CBF68EBE29DBC8C5C118A136358F0CEC5C0830E6A31A7DFF0D21C0010} - x{00C41EF2D28ADB6} - x{00C41EEA3DE89D8} - p{01011E0AC340288F71D6341EB0FB314EB3284CD5B06DA8EE1FAE4BDA56B3CC1B9C9F000C} - x{00C41EE948E3D28} - x{5031068631CA7612_} - x{BA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C03106861E13C993C7C9FE9481C241BD8A281B788EAED1421C3A9B639E0471ABC77EBD52D2E8B634000084E016334706_} - x{C00606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C2188219C3214A98F8000084E01633470D883430F09E4C934_} - p{01019494D1CC8EDF12F05671A1A9BA09921096EB50811E1924EC65C3C629FBB808120004} - p{010134934EFEB320C3614BA963232A3D97A0F0D9343A41113EA96D852BE1E3DE214A0001} - p{01010CFBF895A4279219543BBFB4B028EA8C2EC00FEDE4BA119A3A75403FA5F50F100008} - p{010175964F16FF7B25221B550E09C898280EE4E49BCDE70BA8C460355CC06C683632000B} - p{0101466D1F8C839BE0F4C073E7E5871EF4111F0DB32869A8E507551DD6637F3AD956000D} - p{0101A21C0CCFC1FC0E46C069D3693D595DDC8C568451D490DFAB117A5D634424CD240014} - p{0101341DCE03478E7C34F1FE412B12E7DC7A487A004F3FB367A678612C559947386F0018} - p{010133AF19EA836262A204FF10952173423B90C7801087D2FE83F28D089562D26EDF0026} - p{01014F4DA78B7B4B5B95205258C40DB2DD9D1F1F7CC9947FF42623986733FE7882BD0025} - p{0101902404EFA41FB7E1B55FE73DD5E5FD8857F4DD71E1B65F812AE99B2D5E207FC20024} - p{0101C5D2BAFC40ED77F48AB8D61A99284AC25BC00226B8A3608335447A498EAB53F20038} - p{0101D7ACBB602338C86D610F35CFB362FD76FC18B1812476B6FCA99A0678E665FCF50000} - p{0101C6241C72471DA7C63E4B68F139D5B4190AF49F7E40F33210AC30ABDA0E7070AE005F} - p{0101D7ACBB602338C86D610F35CFB362FD76FC18B1812476B6FCA99A0678E665FCF50000} - p{01012B53E9EAF845A41878D7BFF2B41581A33E0B911CEA033158A2D004CFECDCE3FD003A} - p{0101ED7E26BD36EFA6D5D9B4F6AAAB9813AF0742A84244977F74FD4074C9C98908BE0000} - p{0101ED7E26BD36EFA6D5D9B4F6AAAB9813AF0742A84244977F74FD4074C9C98908BE0000} - p{01016F315F25B4A39AC12C85FEA4ECFE7A83E5E59D1F059783FA0C3EF279730880610000} - x{010190E6DAD4F2D55FF} - x{010101D7C0DED45E81D} - p{0101E2BECF418BA09257A8799C82252615A6FE7061371B4E6423314BD5F1AFC7EEF20067} - x{010095666D27D819F37} - p{0101BA011F0CFD2FD4076DF35E604C9BCD1B8F011558562DECDD01FE089C4498EBD70065} - x{0100576CB100C213754} - x{00ED333FDD8FA65EA} - x{00E7DC8F8C05F9938} - x{00E02AF92CDEC2544} - x{00CD609D35A27FC} - p{01011C4CF0A3559E0A8E1E8F55686F9FEF129FE263D8AC6964225233CA2D749AD85D0027} - x{00C58EE0516C6AC} - p{0101E8E05A988813F0D3E51CCEF0FDE7CBCA183C41DB945AB9525C56917016E50414001D} - x{00C38498E8435DC} - x{00C2676676B41BE} - x{00C0B325678E7E8} - p{0101FBA19B98305B76E7F47FAC36231A7E981DE55C1412F40BEA708590AAB7F6D46D0018} - x{00C0450982B5E66} - p{01018C4122CFAD51D07E9D37FDF5A8FFA374D6CCA70D8B3984404459C7816A9258D40016} - x{00C020D56AFB542} - x{00BF74E9E366C} - x{00BD73C5D3AD4} - p{010153162242031C5E3B057D9AE3A06508410049B4F9A2757F53FF38C5E489C9ABDB0012} - x{00A0413361AAE} - x{00A03FB2F39C4} - x{00A0229D2AE98} - p{01018C28B0BC8E47355432DE9739D965001B2A2F78F10A2D00DCEDCE9FA46B0E16ED0008} - x{00A0224E556CC} - x{00A021CE556CC} - p{01013C6A67F597E285D4CD28D1C19EE094F94242A9DDB3B849C5F1C0A789C48BCE250008} - x{009D3F6CFD2} - p{0101481DB5435F23A0CDB869D3E0BC57B347A723FDD90E6FE8E061E8292183967E3E0009} - x{BA6ADE71DFCF5C7375AB6805BCBFDBBFB473604B4D17A084B9FEB08816EB404E6A4508536716E29930468E1F9818AA2E720DD13DE7043086E7AD975FBB1D0F6B1D9C8AC80001094408285E0C_} - x{C00B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A22C858E43212E0B80000084A204142F0D39A91421534_} - p{0101FEB5FF6820E2FF0D9483E7E0D62C817D846789FB4AE580C878866D959DABD5C00007} - x{0000000729A9A3177E14E8A2B7C6D5587C92805C37EFABDEA4EA0B9F26D9B8A82A8E0D6BDCEA62504_} - p{01017C4D05EDDB6C75FBF5C8D53EF726F1CBD92AD3C4190A8B3FD233AD191B21F8D60009} - p{010142BB3144A3AD75955EE6416142A51D42ABAE84065FEC9F5A1B4D873EE537C9FA000B} - p{0101E975BCCADE13E7C125532BAEC89E7874C1AD154D027B1554C9C2152376BC7366000D} - p{0101457DA401CF28E66FFCB7FB77B0410C986AAAE7F5BB77BFC5F4521DB8DE9DB8D9000F} - p{0101703704776AD2237497F6FDE9686E1EC3B81EF99E2FD2B9FB850B1C56381CDD870014} - p{0101CC1DAA155C33989D1133C6998B18A50693D3946C741AD0948B9EC503E8B3BEB0001B} - p{0101C35FE470AF7DFF3C7183867EAE2130BB19438AE998DDE9E531128C865E1D87DD001A} - p{0101C817780520281267914DE4240BB2A5C41DD78A8DD97655393BDA6928F4A90AE6001E} - p{0101CBB45B0E87EBB7CBE82E0FEDE2D31C2917900081CCFC358BF740FC09F0667E5C002C} - p{0101DE9217E0224DFAA82F60C0D93FE25A49C09265AD9FBA9A09B4C4D13020CBA1C4002A} - p{0101A0831A37E357E0BE440ACB7B676F614ECA66E284FAA0C7C5D76B5BB0BA4FF176005E} - p{01013E8566F5F5F2B901F000BB83A3E2BC2241CAA776D7CF39A9F96941FB8081799C0000} - p{0101EC90A44EEE02BED840C10E88351163EE9E3613EB9DBE8DA760783DA449714E280001} - p{01015D730BC79B61A2DEFCD1E502BA3336692765E8C46EACF5C53903E35E71A636650067} - p{0101BB06F3506745C5F6A6239D132A70B38439CB60FF95F62E45261BA12E844E889B0001} - p{0101B3E9649D10CCB379368E81A3A7E8E49C8EB53F6ACC69B0BA2FFA80082F70EE390001} - p{0101B3E9649D10CCB379368E81A3A7E8E49C8EB53F6ACC69B0BA2FFA80082F70EE390001} - p{0101A515AAFB83B6EFAF10E9880D3464239A3D286BCCCCE55320C05174FA25AA52A90002} - x{9023AFE2FFFFFF110000000000000000000000000002089CA00000000164295E0800002138362FFDC401B2C7C12_} - x{00000000000000005_} - x{B0400000000000000000D963E08000109C1B17FEE16DBFE285E48E43E249A93F61BD3A57B85BB3EB580A3CDFA802CFF52C478F3C4A4_} - x{820966ED3CABEE987B7_} - x{0104B3769E55F74C3DB} - x{0103228FC2CC136E07B} - p{01013DF0A2180FBF8310E3EBF3EE0337E3DB4F3C5607B2A95948CB9EBC39B7B781010215} - x{01014070C117744B59B} - p{0101335FA553EA4BCA6BDDB4E487595CB1F5127CD062DE48C641510A5F7C2FC6A81D0061} - x{0100500A6E49DA68307} - x{00FD67087B20BB89B} - x{00FC517DE257C7E0D} - x{00E3929CE784E57A6} - x{00E2AB225FD70D202} - x{00E2981D249081A4E} - x{00E1DD0B9B779236E} - p{0101382B16F00C5310BAED87D5AD7F1D067E70B3C0E871C3BFE7A6071658FD0F89C0001C} - x{00C604660621842} - p{01015B52DBBFDE38BC2D6155B14B477CCE467DE02546347147685BCEE999F95032540019} - x{00C51D42A917B4E} - x{00C472455AE0B48} - p{0101AA58BFD93E60FDC0E0B56EEB49D336E409C5B835B3B89825E03192C6A607AAE50017} - x{00C42DEF6C72174} - p{0101C0BC26E547B2EA220627D3E27DB49753C70793B1CBE233DE65B09159EB8FBC720015} - x{00C42803070EA1A} - x{00C41FF62F97D84} - p{0101E717A923ABE0AD67F2FF9AE27916C2CFEA60885164EA1E47E8BD03F22EFD9CFE0014} - x{00C41FB46F5639E} - p{0101CAC41590635CBF68EBE29DBC8C5C118A136358F0CEC5C0830E6A31A7DFF0D21C0010} - x{00C41E3DCAF1594} - x{00C41E35364F1B6} - p{01011E0AC340288F71D6341EB0FB314EB3284CD5B06DA8EE1FAE4BDA56B3CC1B9C9F000C} - x{00C41E34414A506} - x{50310658EFE4158A_} - x{BA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C0310658DC2D69095CC51E39D6E690880CC91ED84A3474116C8F49C33AED0A1C3CC09EC56897BF5C000084E0D8BFF706_} - x{C00606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C2188219C3214AF040000084E0D8BFF70D8832C6E16B48534_} - p{01019494D1CC8EDF12F05671A1A9BA09921096EB50811E1924EC65C3C629FBB808120004} - x{00000001642953590F1E20FA05A095B841DFC5AD719E71E49027E63A970787F78F2B781992B68ABA73BDC400C_} - x{A03214AF210FD95F2DC_} - p{01010CFBF895A4279219543BBFB4B028EA8C2EC00FEDE4BA119A3A75403FA5F50F100008} - p{010175964F16FF7B25221B550E09C898280EE4E49BCDE70BA8C460355CC06C683632000B} - p{0101466D1F8C839BE0F4C073E7E5871EF4111F0DB32869A8E507551DD6637F3AD956000D} - p{0101A21C0CCFC1FC0E46C069D3693D595DDC8C568451D490DFAB117A5D634424CD240014} - p{0101341DCE03478E7C34F1FE412B12E7DC7A487A004F3FB367A678612C559947386F0018} - p{010133AF19EA836262A204FF10952173423B90C7801087D2FE83F28D089562D26EDF0026} - p{01014F4DA78B7B4B5B95205258C40DB2DD9D1F1F7CC9947FF42623986733FE7882BD0025} - p{0101902404EFA41FB7E1B55FE73DD5E5FD8857F4DD71E1B65F812AE99B2D5E207FC20024} - p{0101C5D2BAFC40ED77F48AB8D61A99284AC25BC00226B8A3608335447A498EAB53F20038} - x{A0000000EF18A7C924_} - p{0101C6241C72471DA7C63E4B68F139D5B4190AF49F7E40F33210AC30ABDA0E7070AE005F} - x{A0000000EF18A7C924_} - p{01012B53E9EAF845A41878D7BFF2B41581A33E0B911CEA033158A2D004CFECDCE3FD003A} - x{A0000000EF1911C4CC_} - x{A0000000EF1911C4CC_} - x{A0000000EF1B3B3824_} - x{010190E6DB89E3DE361} - x{010101D7C193C56757F} - p{0101E2BECF418BA09257A8799C82252615A6FE7061371B4E6423314BD5F1AFC7EEF20067} - x{010095666DDCC922C99} - p{0101BA011F0CFD2FD4076DF35E604C9BCD1B8F011558562DECDD01FE089C4498EBD70065} - x{0100576CB1B5B31C4B6} - x{00ED33409280AF34C} - x{00E7DC9040F70269A} - x{00E02AF9E1CFCB2A6} - x{00CD615226AB55E} - p{01011C4CF0A3559E0A8E1E8F55686F9FEF129FE263D8AC6964225233CA2D749AD85D0027} - x{00C58F95427540E} - p{0101E8E05A988813F0D3E51CCEF0FDE7CBCA183C41DB945AB9525C56917016E50414001D} - x{00C3854DD94C33E} - x{00C2681B67BCF20} - x{00C0B3DA589754A} - p{0101FBA19B98305B76E7F47FAC36231A7E981DE55C1412F40BEA708590AAB7F6D46D0018} - x{00C045BE73BEBC8} - p{01018C4122CFAD51D07E9D37FDF5A8FFA374D6CCA70D8B3984404459C7816A9258D40016} - x{00C0218A5C042A4} - x{00C02029DAEC3CE} - x{00BE28B6DC836} - p{010153162242031C5E3B057D9AE3A06508410049B4F9A2757F53FF38C5E489C9ABDB0012} - x{00A0F6246A810} - x{00A0F4A3FC726} - x{00A0D78E33BFA} - p{01018C28B0BC8E47355432DE9739D965001B2A2F78F10A2D00DCEDCE9FA46B0E16ED0008} - x{00A0D73F5E42E} - x{00A0D6BF5E42E} - p{01013C6A67F597E285D4CD28D1C19EE094F94242A9DDB3B849C5F1C0A789C48BCE250008} - x{00A0D23075D34} - p{0101481DB5435F23A0CDB869D3E0BC57B347A723FDD90E6FE8E061E8292183967E3E0009} - x{BA6ADE71DFCF5C7375AB6805BCBFDBBFB473604B4D17A084B9FEB08816EB405068E2C97363B1664ADD57954D7A335D658A1CC2E94CE8A96C8C0A6EB4E2ED111159E9257FA0000109C1B17FEE1C_} - x{C00B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A22C859043214AF040000084E0D8BFF71141A38B25CD934_} - p{0101FEB5FF6820E2FF0D9483E7E0D62C817D846789FB4AE580C878866D959DABD5C00007} - x{0000000729A9A3177E14E8A2B7C6D5587C92805C37EFABDEA4EA0B9F26D9B8A82A8E0D6BDCEA62504_} - p{01017C4D05EDDB6C75FBF5C8D53EF726F1CBD92AD3C4190A8B3FD233AD191B21F8D60009} - p{010142BB3144A3AD75955EE6416142A51D42ABAE84065FEC9F5A1B4D873EE537C9FA000B} - p{0101E975BCCADE13E7C125532BAEC89E7874C1AD154D027B1554C9C2152376BC7366000D} - p{0101457DA401CF28E66FFCB7FB77B0410C986AAAE7F5BB77BFC5F4521DB8DE9DB8D9000F} - p{0101703704776AD2237497F6FDE9686E1EC3B81EF99E2FD2B9FB850B1C56381CDD870014} - p{0101CC1DAA155C33989D1133C6998B18A50693D3946C741AD0948B9EC503E8B3BEB0001B} - p{0101C35FE470AF7DFF3C7183867EAE2130BB19438AE998DDE9E531128C865E1D87DD001A} - p{0101C817780520281267914DE4240BB2A5C41DD78A8DD97655393BDA6928F4A90AE6001E} - p{0101CBB45B0E87EBB7CBE82E0FEDE2D31C2917900081CCFC358BF740FC09F0667E5C002C} - p{0101DE9217E0224DFAA82F60C0D93FE25A49C09265AD9FBA9A09B4C4D13020CBA1C4002A} - p{0101A0831A37E357E0BE440ACB7B676F614ECA66E284FAA0C7C5D76B5BB0BA4FF176005E} - x{A0000000EF184C5AE4_} - x{2_} - x{BE000003BC84F8C240D_} - x{BFFFFFFFBC85CB7E4E3_} - p{01015D730BC79B61A2DEFCD1E502BA3336692765E8C46EACF5C53903E35E71A636650067} - x{2_} - x{BE000003BC91558E0A1_} - x{BFFFFFFFBC8B96FC9C5_} - x{2_} - x{BE000003BC91627AEA9_} - x{BFFFFFFFBC8B96FC9C5_} - x{2_} - x{BE000003BC91627AEA9_} - x{BFFFFFFFBC8B96FC9C5_} - x{0000000000000000FFFFFFFFFFFFFFFF8259BB4F2AFBA61EDBBDCA2588BC7A859000021383611794401B2C7C100AB2D3300CCFFE58FC58F57345754FF872EE40765249C6541DFEBBA306B551992F033D080FCEA503F4A317F1AB360F072DBBD734E3EF3236850A562DA7572A0} - x{2_} - x{BE000003BC91627AEA9_} - x{BFFFFFFFBC8B96FC9C5_} - x{4A33F6FD000000003218ED7B400367D51EE096AC7A440DDAAC406E4729B0F9E6DF16FE41DC9C0512CAA7A3B83FBCB9CEE542950EB55B8950D8807B4559E5450DD97FB9ED4_} - x{98738F902_} - x{0C39C7C81_} - x{BFFB5D18557F2CB862C8FD55A72B335069C1DBCFCF2DBDBCDD21ECB32944D4BCBE8004_} - x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} - x{D003} - x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} - x{E_} - x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} - x{D003} - x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{DF_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} - x{0C8057061B8732C44_} - x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} - x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} - x{BFEDBFE285E48E43E249A93F61BD3A57B85BB3EB580A3CDFA802CFF52C478F3C4A18738F90198738F94_} - x{4606030E71F2} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} - x{A_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} - x{0CBADD094169E6144F5861E3E311_} - x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} - x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} - x{82_} - x{A01B6FF8A1792390F8926A4FD86F4E95EE16ECFAD6028F37EA00B3FD4B11E3CF12805_} - x{4606030E71F2} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} - x{E_} - x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} - x{D003} - x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{DF_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} - x{0C8057061B8732C44_} - x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} - x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} - x{661CE3E5_} - x{4606030E71F2} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} - x{A_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} - x{0CBADD094169E6144F5861E3E311_} - x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} - x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} - x{9D309B72_} - x{0E984DB9_} - x{BFF036D41B2F52198152B3FD3DC263022215EB42AE8A0AB5B5AC342D3026707D8E1CB04711581B6A0D97A90CC0A959FE9EE13181110AF5A15745055ADAD61A169813383EC7280000042706C5FFB8272C11C4} - x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} - x{E_} - x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} - x{D003} - x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{DF_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} - x{0C8057061B8732C44_} - x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} - x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} - x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} - x{BFD8664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD188054616C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD6A80000042706C5FFB866201518} - x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} - x{A_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} - x{0CBADD094169E6144F5861E3E311_} - x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} - x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} - x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} \ No newline at end of file diff --git a/src/codegen/combinator.ts b/src/codegen/combinator.ts index 7586760..b608cb5 100644 --- a/src/codegen/combinator.ts +++ b/src/codegen/combinator.ts @@ -298,5 +298,14 @@ export function handleCombinator(expr: ParserExpression, fieldName: string, isFi result.storeExpr2 = storeExpr2 + if (constructor.declaration.combinator.name == 'RefCombinatorInRef') { + if (result.storeExpr && result.storeExpr2 && result.storeFunctionExpr) { + console.log(fieldName) + // console.log(expr) + console.log(toCode(result.storeExpr).code) + console.log(toCode(result.storeExpr2).code) + console.log(toCode(result.storeFunctionExpr).code) + } + } return result; } 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 29150b4..33b71da 100644 --- a/tests/my.spec.ts +++ b/tests/my.spec.ts @@ -28,7 +28,7 @@ describe('parsing into intermediate representation using grammar', () => { console.log(builder.endCell().hash()) fs.writeFile('lol.txt', builder.endCell().toString(), () => { }); - expect(cs.hash() == builder.endCell().hash()).toBeTruthy() + expect(cs.hash()builder.endCell().hash()).toBeTruthy() }) }) diff --git a/tests/tlbgen.spec.ts b/tests/tlbgen.spec.ts index 03e73ea..8d45490 100644 --- a/tests/tlbgen.spec.ts +++ b/tests/tlbgen.spec.ts @@ -8,7 +8,7 @@ import { generate } from '../src/codegen/main' import { Program } from '../src/ast/nodes' 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 { loadBlock, storeBlock } from '../generated_block' @@ -153,6 +153,15 @@ describe('Generating tlb code', () => { checkSameOnStoreLoad(combArgCellRefUser, loadCombArgCellRefUser, storeCombArgCellRefUser); let mathExprAsCombArg: MathExprAsCombArg = {kind: 'MathExprAsCombArg', n: 8, ref: {kind: 'BitLenArg', x: 10, value: 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', () => { @@ -469,26 +478,20 @@ 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 = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQAAAAAAAAAAAAAAAAACCJygAAAAAWQpXggAACE4Ni/9xAGyx8EgCgQDAdkAAAAAAAAAAP//////////glm7Tyr7ph7bvcoliLx6hZAAAhODYReUQBssfBAKstMwDM/+WPxY9XNFdU/4cu5AdlJJxlQd/rujBrVRmS8DPQgPzqUD9KMX8as2Dwctu9c04+8yNoUKVi2nVyoIECITgglm7Tyr7ph7cAUQIxMBBLN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aWQiUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; - const cs = Cell.fromBase64(state); - console.log(cs.hash()) - fs.writeFile('kek.txt', cs.toString(), () => { }); - - let blk = loadBlock(cs.beginParse()); - let builder = beginCell(); - storeBlock(blk)(builder); - console.log(builder.endCell().hash()) - fs.writeFile('lol.txt', builder.endCell().toString(), () => { }); - - expect(deepEqual(cs.hash(), builder.endCell().hash())).toBeTruthy() + // const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQAAAAAAAAAAAAAAAAACCJygAAAAAWQpXggAACE4Ni/9xAGyx8EgCgQDAdkAAAAAAAAAAP//////////glm7Tyr7ph7bvcoliLx6hZAAAhODYReUQBssfBAKstMwDM/+WPxY9XNFdU/4cu5AdlJJxlQd/rujBrVRmS8DPQgPzqUD9KMX8as2Dwctu9c04+8yNoUKVi2nVyoIECITgglm7Tyr7ph7cAUQIxMBBLN2nlX3TD24GAYQIxMBAZDm24nj3jYYBywVIxMBAQHXwZPFZ1f4SRIIAgEgoQkAE7////+8hct+TjABEQAAAAAAAAAAUKICEbjkjftDxPT2BA0MAA0AEO5rKAAIAiWCWbtPKwbudNwSzdp5V90w9sAIEBACoJvHqYcAAAAAhAECCJygAAAAAQAAAAAAAAAAAAAAAABkKV4IAAAhODYv/cAAACE4Ni/9xGSeizgABnF2AbLHwQGyxDjEAAAAAwAAAAAAAAAuRg8AmAAAITg2ILuBAgicn5OTTn6kV5z6E216F7w1p7ywI+Wsbfm4l7+fH+PH3tbaRLtCQmSNinuI8RM1X14LJBOd+k8nDROIBcr5XT35BMwCASARFgATvgAAA7yRYnrqkCMTAQ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Ic5VbMjIwiILAJ0/bP0ox8Mhl7pq3nHfz1xzdatoBby/27+0c2BLTReghLn+sIgW60BOakUIU2cW4pkwRo4fmBiqLnIN0T3nBDCG562XX7sdD2sdnIrIAAEJRAgoXgzEIm/ACwzJdW847+euObrVtALeX+3f2jmwJaaL0EJc/1hEC3WiLIWOQyEuC4AAAISiBBQvDTmpFCFTQMbFAFEAAAAHKamjF34U6KK3xtVYfJKAXDfvq96k6gufJtm4qCqODWvc6mJQQChIAQH+tf9oIOL/DZSD5+DWLIF9hGeJ+0rlgMh4hm2VnavVwAAHKEgBAUgdtUNfI6DNuGnT4LxXs0enI/3ZDm/o4GHoKSGDln4+AAkoSAEBPGpn9ZfihdTNKNHBnuCU+UJCqd2zuEnF8cCnicSLziUACChIAQGMKLC8jkc1VDLelznZZQAbKi948QotANztzp+kaw4W7QAIKEgBAVMWIkIDHF47BX2a46BlCEEASbT5onV/U/84xeSJyavbABIoSAEBjEEiz61R0H6dN/31qP+jdNbMpw2LOYRARFnHgWqSWNQAFihIAQH7oZuYMFt25/R/rDYjGn6YHeVcFBL0C+pwhZCqt/bUbQAYKEgBAejgWpiIE/DT5RzO8P3ny8oYPEHblFq5UlxWkXAW5QQUAB0oSAEBHEzwo1WeCo4ej1Vob5/vEp/iY9isaWQiUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; + // const cs = Cell.fromBase64(state); + // console.log(cs.hash()) + // fs.writeFile('kek.txt', cs.toString(), () => { }); + + // let blk = loadBlock(cs.beginParse()); + // let builder = beginCell(); + // storeBlock(blk)(builder); + // console.log(builder.endCell().hash()) + // fs.writeFile('lol.txt', builder.endCell().toString(), () => { }); + + // expect(deepEqual(cs.hash(), builder.endCell().hash())).toBeTruthy() }) }) From 517cb5f3e3028739822592f35a5faa9844f78c85 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Wed, 13 Dec 2023 22:48:32 -0500 Subject: [PATCH 07/14] tmp --- generated_block.ts | 16 ++++++++-------- generated_test.ts | 4 ++-- src/codegen/combinator.ts | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/generated_block.ts b/generated_block.ts index b1467a5..9930c8b 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -4352,7 +4352,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); @@ -4485,7 +4485,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); @@ -4502,7 +4502,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); @@ -4741,7 +4741,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); @@ -5361,7 +5361,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); @@ -5375,7 +5375,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); @@ -5713,7 +5713,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); @@ -6347,7 +6347,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); diff --git a/generated_test.ts b/generated_test.ts index 4dc1f48..b14b6a3 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -2032,7 +2032,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); @@ -2296,7 +2296,7 @@ export function storeRefCombinatorInRef(refCombinatorInRef: RefCombinatorInRef): let cell1 = beginCell(); storeRefCombinatorInRefHelper(refCombinatorInRef.msg, ((arg: Slice) => { return ((builder: Builder) => { - cell1.storeSlice(arg); + builder.storeSlice(arg); }) }))(cell1); diff --git a/src/codegen/combinator.ts b/src/codegen/combinator.ts index b608cb5..d20e7cf 100644 --- a/src/codegen/combinator.ts +++ b/src/codegen/combinator.ts @@ -270,8 +270,8 @@ export function handleCombinator(expr: ParserExpression, fieldName: string, isFi 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) { From 7a4823f8e8899962172f27b9e46b2bf5ac6ed1ee Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Wed, 13 Dec 2023 22:50:12 -0500 Subject: [PATCH 08/14] refcombinatorinref --- src/codegen/combinator.ts | 10 ---------- src/codegen/util.ts | 5 ----- tests/tlbgen.spec.ts | 2 +- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/codegen/combinator.ts b/src/codegen/combinator.ts index d20e7cf..729cfbc 100644 --- a/src/codegen/combinator.ts +++ b/src/codegen/combinator.ts @@ -297,15 +297,5 @@ export function handleCombinator(expr: ParserExpression, fieldName: string, isFi } result.storeExpr2 = storeExpr2 - - if (constructor.declaration.combinator.name == 'RefCombinatorInRef') { - if (result.storeExpr && result.storeExpr2 && result.storeFunctionExpr) { - console.log(fieldName) - // console.log(expr) - console.log(toCode(result.storeExpr).code) - console.log(toCode(result.storeExpr2).code) - console.log(toCode(result.storeFunctionExpr).code) - } - } return result; } diff --git a/src/codegen/util.ts b/src/codegen/util.ts index 7bdc52b..e724557 100644 --- a/src/codegen/util.ts +++ b/src/codegen/util.ts @@ -364,11 +364,6 @@ export function calculateVariables(constructor: TLBConstructor) { export function getConstructorTag(declaration: Declaration, input: string[]): TLBConstructorTag { let tag = declaration.constructorDef.tag; - if (declaration.combinator.name == 'InMsgDescr') { - console.log(tag) - console.log(declaration.constructorDef) - - } if (tag == null && declaration.constructorDef.name == '_' || tag && tag.length > 1 && tag[1] == '_') { return { bitLen: 0, diff --git a/tests/tlbgen.spec.ts b/tests/tlbgen.spec.ts index 8d45490..60ad279 100644 --- a/tests/tlbgen.spec.ts +++ b/tests/tlbgen.spec.ts @@ -161,7 +161,7 @@ describe('Generating tlb code', () => { 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); + checkSameOnStoreLoad(msgEnvelope, loadRefCombinatorInRef, storeRefCombinatorInRef); }); test('Naming', () => { From 4c99cbe227d44582027b4d76f06466b01de36615 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Thu, 14 Dec 2023 00:13:22 -0500 Subject: [PATCH 09/14] tmp --- generated_test.ts | 8 +- kek.txt | 327 -------------------------------------- src/codegen/combinator.ts | 9 +- tests/my.spec.ts | 18 +-- tests/tlbgen.spec.ts | 37 +++-- 5 files changed, 38 insertions(+), 361 deletions(-) delete mode 100644 kek.txt diff --git a/generated_test.ts b/generated_test.ts index b14b6a3..9e674d3 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -70,7 +70,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 +81,7 @@ export interface BitLenArgUser { export interface ExprArg { readonly kind: 'ExprArg'; readonly x: number; - readonly value: number; + readonly value: bigint; } export interface ExprArgUser { @@ -694,7 +694,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.loadUint(x); return { kind: 'BitLenArg', x: x, @@ -727,7 +727,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.loadUint((arg0 - 2)); return { kind: 'ExprArg', x: (arg0 - 2), diff --git a/kek.txt b/kek.txt deleted file mode 100644 index 33fb80a..0000000 --- a/kek.txt +++ /dev/null @@ -1,327 +0,0 @@ -x{11EF55AAFFFFFF11} - x{9BC7A98700000000840102089CA0000000010000000000000000000000000064295E0800002138362FFDC000002138362FFDC4649E8B380006717601B2C7C101B2C438C400000003000000000000002E} - x{000021383611794401B2C7C100AB2D3300CCFFE58FC58F57345754FF872EE40765249C6541DFEBBA306B551992F033D080FCEA503F4A317F1AB360F072DBBD734E3EF3236850A562DA7572A0} - x{000021383620BB8102089C9F93934E7EA4579CFA136D7A17BC35A7BCB023E5AC6DF9B897BF9F1FE3C7DED6DA44BB4242648D8A7B88F113355F5E0B24139DFA4F270D138805CAF95D3DF904CC} - x{B8E48DFB43C4F4F604_} - x{8259BB4F2B06EE74DC12CDDA7957DD30F6C00} - x{2_} - x{BE000003BC91627AEA9_} - x{BFFFFFFFBC8B96FC9C5_} - x{2_} - x{BE000003BC91627AEA9_} - x{BFFFFFFFBC8B96FC9C5_} - x{0010EE6B28000} - u{044505CDB6BB0B791407B92E4C15F7F69408C1B70CC1059A1A412FF57EB410C8FE05776DF6C487D5F58DA84FA19A4C5E90BA4F04E87B6A0102229C24231680CCE302190219} - x{9023AFE2FFFFFF110000000000000000000000000002089C9F0000000164295E05000021383620BB8101B2C7BF2_} - p{01013B1714D078D245D415BFC8F3FF645D98D3D789D1C9AC45CA4C487BEF2A726CA00002} - x{820966ED3CAC1BB9D37_} - x{0104B3769E560DDCE9B} - x{0103228FC3811B0789D} - p{01013DF0A2180FBF8310E3EBF3EE0337E3DB4F3C5607B2A95948CB9EBC39B7B781010215} - x{01014070C1CC7BE4DBD} - p{0101335FA553EA4BCA6BDDB4E487595CB1F5127CD062DE48C641510A5F7C2FC6A81D0061} - x{0100500A6EFEE201B29} - x{00FD67093028550BD} - x{00FC517E975F6162F} - x{00E3929D9C8C7EFC8} - x{00E2AB2314DEA6A24} - x{00E2981DD9981B270} - x{00E1DD0C507F2BB90} - p{0101382B16F00C5310BAED87D5AD7F1D067E70B3C0E871C3BFE7A6071658FD0F89C0001C} - x{00C6051B0DBB064} - p{01015B52DBBFDE38BC2D6155B14B477CCE467DE02546347147685BCEE999F95032540019} - x{00C51DF7B0B1370} - x{00C472FA627A36A} - p{0101AA58BFD93E60FDC0E0B56EEB49D336E409C5B835B3B89825E03192C6A607AAE50017} - x{00C42EA4740B996} - p{0101C0BC26E547B2EA220627D3E27DB49753C70793B1CBE233DE65B09159EB8FBC720015} - x{00C428B80EA823C} - x{00C420AB37315A6} - p{0101E717A923ABE0AD67F2FF9AE27916C2CFEA60885164EA1E47E8BD03F22EFD9CFE0014} - x{00C4206976EFBC0} - p{0101CAC41590635CBF68EBE29DBC8C5C118A136358F0CEC5C0830E6A31A7DFF0D21C0010} - x{00C41EF2D28ADB6} - x{00C41EEA3DE89D8} - p{01011E0AC340288F71D6341EB0FB314EB3284CD5B06DA8EE1FAE4BDA56B3CC1B9C9F000C} - x{00C41EE948E3D28} - x{5031068631CA7612_} - x{BA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C03106861E13C993C7C9FE9481C241BD8A281B788EAED1421C3A9B639E0471ABC77EBD52D2E8B634000084E016334706_} - x{C00606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C2188219C3214A98F8000084E01633470D883430F09E4C934_} - p{01019494D1CC8EDF12F05671A1A9BA09921096EB50811E1924EC65C3C629FBB808120004} - p{010134934EFEB320C3614BA963232A3D97A0F0D9343A41113EA96D852BE1E3DE214A0001} - p{01010CFBF895A4279219543BBFB4B028EA8C2EC00FEDE4BA119A3A75403FA5F50F100008} - p{010175964F16FF7B25221B550E09C898280EE4E49BCDE70BA8C460355CC06C683632000B} - p{0101466D1F8C839BE0F4C073E7E5871EF4111F0DB32869A8E507551DD6637F3AD956000D} - p{0101A21C0CCFC1FC0E46C069D3693D595DDC8C568451D490DFAB117A5D634424CD240014} - p{0101341DCE03478E7C34F1FE412B12E7DC7A487A004F3FB367A678612C559947386F0018} - p{010133AF19EA836262A204FF10952173423B90C7801087D2FE83F28D089562D26EDF0026} - p{01014F4DA78B7B4B5B95205258C40DB2DD9D1F1F7CC9947FF42623986733FE7882BD0025} - p{0101902404EFA41FB7E1B55FE73DD5E5FD8857F4DD71E1B65F812AE99B2D5E207FC20024} - p{0101C5D2BAFC40ED77F48AB8D61A99284AC25BC00226B8A3608335447A498EAB53F20038} - p{0101D7ACBB602338C86D610F35CFB362FD76FC18B1812476B6FCA99A0678E665FCF50000} - p{0101C6241C72471DA7C63E4B68F139D5B4190AF49F7E40F33210AC30ABDA0E7070AE005F} - p{0101D7ACBB602338C86D610F35CFB362FD76FC18B1812476B6FCA99A0678E665FCF50000} - p{01012B53E9EAF845A41878D7BFF2B41581A33E0B911CEA033158A2D004CFECDCE3FD003A} - p{0101ED7E26BD36EFA6D5D9B4F6AAAB9813AF0742A84244977F74FD4074C9C98908BE0000} - p{0101ED7E26BD36EFA6D5D9B4F6AAAB9813AF0742A84244977F74FD4074C9C98908BE0000} - p{01016F315F25B4A39AC12C85FEA4ECFE7A83E5E59D1F059783FA0C3EF279730880610000} - x{010190E6DAD4F2D55FF} - x{010101D7C0DED45E81D} - p{0101E2BECF418BA09257A8799C82252615A6FE7061371B4E6423314BD5F1AFC7EEF20067} - x{010095666D27D819F37} - p{0101BA011F0CFD2FD4076DF35E604C9BCD1B8F011558562DECDD01FE089C4498EBD70065} - x{0100576CB100C213754} - x{00ED333FDD8FA65EA} - x{00E7DC8F8C05F9938} - x{00E02AF92CDEC2544} - x{00CD609D35A27FC} - p{01011C4CF0A3559E0A8E1E8F55686F9FEF129FE263D8AC6964225233CA2D749AD85D0027} - x{00C58EE0516C6AC} - p{0101E8E05A988813F0D3E51CCEF0FDE7CBCA183C41DB945AB9525C56917016E50414001D} - x{00C38498E8435DC} - x{00C2676676B41BE} - x{00C0B325678E7E8} - p{0101FBA19B98305B76E7F47FAC36231A7E981DE55C1412F40BEA708590AAB7F6D46D0018} - x{00C0450982B5E66} - p{01018C4122CFAD51D07E9D37FDF5A8FFA374D6CCA70D8B3984404459C7816A9258D40016} - x{00C020D56AFB542} - x{00BF74E9E366C} - x{00BD73C5D3AD4} - p{010153162242031C5E3B057D9AE3A06508410049B4F9A2757F53FF38C5E489C9ABDB0012} - x{00A0413361AAE} - x{00A03FB2F39C4} - x{00A0229D2AE98} - p{01018C28B0BC8E47355432DE9739D965001B2A2F78F10A2D00DCEDCE9FA46B0E16ED0008} - x{00A0224E556CC} - x{00A021CE556CC} - p{01013C6A67F597E285D4CD28D1C19EE094F94242A9DDB3B849C5F1C0A789C48BCE250008} - x{009D3F6CFD2} - p{0101481DB5435F23A0CDB869D3E0BC57B347A723FDD90E6FE8E061E8292183967E3E0009} - x{BA6ADE71DFCF5C7375AB6805BCBFDBBFB473604B4D17A084B9FEB08816EB404E6A4508536716E29930468E1F9818AA2E720DD13DE7043086E7AD975FBB1D0F6B1D9C8AC80001094408285E0C_} - x{C00B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A22C858E43212E0B80000084A204142F0D39A91421534_} - p{0101FEB5FF6820E2FF0D9483E7E0D62C817D846789FB4AE580C878866D959DABD5C00007} - x{0000000729A9A3177E14E8A2B7C6D5587C92805C37EFABDEA4EA0B9F26D9B8A82A8E0D6BDCEA62504_} - p{01017C4D05EDDB6C75FBF5C8D53EF726F1CBD92AD3C4190A8B3FD233AD191B21F8D60009} - p{010142BB3144A3AD75955EE6416142A51D42ABAE84065FEC9F5A1B4D873EE537C9FA000B} - p{0101E975BCCADE13E7C125532BAEC89E7874C1AD154D027B1554C9C2152376BC7366000D} - p{0101457DA401CF28E66FFCB7FB77B0410C986AAAE7F5BB77BFC5F4521DB8DE9DB8D9000F} - p{0101703704776AD2237497F6FDE9686E1EC3B81EF99E2FD2B9FB850B1C56381CDD870014} - p{0101CC1DAA155C33989D1133C6998B18A50693D3946C741AD0948B9EC503E8B3BEB0001B} - p{0101C35FE470AF7DFF3C7183867EAE2130BB19438AE998DDE9E531128C865E1D87DD001A} - p{0101C817780520281267914DE4240BB2A5C41DD78A8DD97655393BDA6928F4A90AE6001E} - p{0101CBB45B0E87EBB7CBE82E0FEDE2D31C2917900081CCFC358BF740FC09F0667E5C002C} - p{0101DE9217E0224DFAA82F60C0D93FE25A49C09265AD9FBA9A09B4C4D13020CBA1C4002A} - p{0101A0831A37E357E0BE440ACB7B676F614ECA66E284FAA0C7C5D76B5BB0BA4FF176005E} - p{01013E8566F5F5F2B901F000BB83A3E2BC2241CAA776D7CF39A9F96941FB8081799C0000} - p{0101EC90A44EEE02BED840C10E88351163EE9E3613EB9DBE8DA760783DA449714E280001} - p{01015D730BC79B61A2DEFCD1E502BA3336692765E8C46EACF5C53903E35E71A636650067} - p{0101BB06F3506745C5F6A6239D132A70B38439CB60FF95F62E45261BA12E844E889B0001} - p{0101B3E9649D10CCB379368E81A3A7E8E49C8EB53F6ACC69B0BA2FFA80082F70EE390001} - p{0101B3E9649D10CCB379368E81A3A7E8E49C8EB53F6ACC69B0BA2FFA80082F70EE390001} - p{0101A515AAFB83B6EFAF10E9880D3464239A3D286BCCCCE55320C05174FA25AA52A90002} - x{9023AFE2FFFFFF110000000000000000000000000002089CA00000000164295E0800002138362FFDC401B2C7C12_} - x{00000000000000005_} - x{B0400000000000000000D963E08000109C1B17FEE16DBFE285E48E43E249A93F61BD3A57B85BB3EB580A3CDFA802CFF52C478F3C4A4_} - x{820966ED3CABEE987B7_} - x{0104B3769E55F74C3DB} - x{0103228FC2CC136E07B} - p{01013DF0A2180FBF8310E3EBF3EE0337E3DB4F3C5607B2A95948CB9EBC39B7B781010215} - x{01014070C117744B59B} - p{0101335FA553EA4BCA6BDDB4E487595CB1F5127CD062DE48C641510A5F7C2FC6A81D0061} - x{0100500A6E49DA68307} - x{00FD67087B20BB89B} - x{00FC517DE257C7E0D} - x{00E3929CE784E57A6} - x{00E2AB225FD70D202} - x{00E2981D249081A4E} - x{00E1DD0B9B779236E} - p{0101382B16F00C5310BAED87D5AD7F1D067E70B3C0E871C3BFE7A6071658FD0F89C0001C} - x{00C604660621842} - p{01015B52DBBFDE38BC2D6155B14B477CCE467DE02546347147685BCEE999F95032540019} - x{00C51D42A917B4E} - x{00C472455AE0B48} - p{0101AA58BFD93E60FDC0E0B56EEB49D336E409C5B835B3B89825E03192C6A607AAE50017} - x{00C42DEF6C72174} - p{0101C0BC26E547B2EA220627D3E27DB49753C70793B1CBE233DE65B09159EB8FBC720015} - x{00C42803070EA1A} - x{00C41FF62F97D84} - p{0101E717A923ABE0AD67F2FF9AE27916C2CFEA60885164EA1E47E8BD03F22EFD9CFE0014} - x{00C41FB46F5639E} - p{0101CAC41590635CBF68EBE29DBC8C5C118A136358F0CEC5C0830E6A31A7DFF0D21C0010} - x{00C41E3DCAF1594} - x{00C41E35364F1B6} - p{01011E0AC340288F71D6341EB0FB314EB3284CD5B06DA8EE1FAE4BDA56B3CC1B9C9F000C} - x{00C41E34414A506} - x{50310658EFE4158A_} - x{BA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C0310658DC2D69095CC51E39D6E690880CC91ED84A3474116C8F49C33AED0A1C3CC09EC56897BF5C000084E0D8BFF706_} - x{C00606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C2188219C3214AF040000084E0D8BFF70D8832C6E16B48534_} - p{01019494D1CC8EDF12F05671A1A9BA09921096EB50811E1924EC65C3C629FBB808120004} - x{00000001642953590F1E20FA05A095B841DFC5AD719E71E49027E63A970787F78F2B781992B68ABA73BDC400C_} - x{A03214AF210FD95F2DC_} - p{01010CFBF895A4279219543BBFB4B028EA8C2EC00FEDE4BA119A3A75403FA5F50F100008} - p{010175964F16FF7B25221B550E09C898280EE4E49BCDE70BA8C460355CC06C683632000B} - p{0101466D1F8C839BE0F4C073E7E5871EF4111F0DB32869A8E507551DD6637F3AD956000D} - p{0101A21C0CCFC1FC0E46C069D3693D595DDC8C568451D490DFAB117A5D634424CD240014} - p{0101341DCE03478E7C34F1FE412B12E7DC7A487A004F3FB367A678612C559947386F0018} - p{010133AF19EA836262A204FF10952173423B90C7801087D2FE83F28D089562D26EDF0026} - p{01014F4DA78B7B4B5B95205258C40DB2DD9D1F1F7CC9947FF42623986733FE7882BD0025} - p{0101902404EFA41FB7E1B55FE73DD5E5FD8857F4DD71E1B65F812AE99B2D5E207FC20024} - p{0101C5D2BAFC40ED77F48AB8D61A99284AC25BC00226B8A3608335447A498EAB53F20038} - x{A0000000EF18A7C924_} - p{0101C6241C72471DA7C63E4B68F139D5B4190AF49F7E40F33210AC30ABDA0E7070AE005F} - x{A0000000EF18A7C924_} - p{01012B53E9EAF845A41878D7BFF2B41581A33E0B911CEA033158A2D004CFECDCE3FD003A} - x{A0000000EF1911C4CC_} - x{A0000000EF1911C4CC_} - x{A0000000EF1B3B3824_} - x{010190E6DB89E3DE361} - x{010101D7C193C56757F} - p{0101E2BECF418BA09257A8799C82252615A6FE7061371B4E6423314BD5F1AFC7EEF20067} - x{010095666DDCC922C99} - p{0101BA011F0CFD2FD4076DF35E604C9BCD1B8F011558562DECDD01FE089C4498EBD70065} - x{0100576CB1B5B31C4B6} - x{00ED33409280AF34C} - x{00E7DC9040F70269A} - x{00E02AF9E1CFCB2A6} - x{00CD615226AB55E} - p{01011C4CF0A3559E0A8E1E8F55686F9FEF129FE263D8AC6964225233CA2D749AD85D0027} - x{00C58F95427540E} - p{0101E8E05A988813F0D3E51CCEF0FDE7CBCA183C41DB945AB9525C56917016E50414001D} - x{00C3854DD94C33E} - x{00C2681B67BCF20} - x{00C0B3DA589754A} - p{0101FBA19B98305B76E7F47FAC36231A7E981DE55C1412F40BEA708590AAB7F6D46D0018} - x{00C045BE73BEBC8} - p{01018C4122CFAD51D07E9D37FDF5A8FFA374D6CCA70D8B3984404459C7816A9258D40016} - x{00C0218A5C042A4} - x{00C02029DAEC3CE} - x{00BE28B6DC836} - p{010153162242031C5E3B057D9AE3A06508410049B4F9A2757F53FF38C5E489C9ABDB0012} - x{00A0F6246A810} - x{00A0F4A3FC726} - x{00A0D78E33BFA} - p{01018C28B0BC8E47355432DE9739D965001B2A2F78F10A2D00DCEDCE9FA46B0E16ED0008} - x{00A0D73F5E42E} - x{00A0D6BF5E42E} - p{01013C6A67F597E285D4CD28D1C19EE094F94242A9DDB3B849C5F1C0A789C48BCE250008} - x{00A0D23075D34} - p{0101481DB5435F23A0CDB869D3E0BC57B347A723FDD90E6FE8E061E8292183967E3E0009} - x{BA6ADE71DFCF5C7375AB6805BCBFDBBFB473604B4D17A084B9FEB08816EB405068E2C97363B1664ADD57954D7A335D658A1CC2E94CE8A96C8C0A6EB4E2ED111159E9257FA0000109C1B17FEE1C_} - x{C00B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A22C859043214AF040000084E0D8BFF71141A38B25CD934_} - p{0101FEB5FF6820E2FF0D9483E7E0D62C817D846789FB4AE580C878866D959DABD5C00007} - x{0000000729A9A3177E14E8A2B7C6D5587C92805C37EFABDEA4EA0B9F26D9B8A82A8E0D6BDCEA62504_} - p{01017C4D05EDDB6C75FBF5C8D53EF726F1CBD92AD3C4190A8B3FD233AD191B21F8D60009} - p{010142BB3144A3AD75955EE6416142A51D42ABAE84065FEC9F5A1B4D873EE537C9FA000B} - p{0101E975BCCADE13E7C125532BAEC89E7874C1AD154D027B1554C9C2152376BC7366000D} - p{0101457DA401CF28E66FFCB7FB77B0410C986AAAE7F5BB77BFC5F4521DB8DE9DB8D9000F} - p{0101703704776AD2237497F6FDE9686E1EC3B81EF99E2FD2B9FB850B1C56381CDD870014} - p{0101CC1DAA155C33989D1133C6998B18A50693D3946C741AD0948B9EC503E8B3BEB0001B} - p{0101C35FE470AF7DFF3C7183867EAE2130BB19438AE998DDE9E531128C865E1D87DD001A} - p{0101C817780520281267914DE4240BB2A5C41DD78A8DD97655393BDA6928F4A90AE6001E} - p{0101CBB45B0E87EBB7CBE82E0FEDE2D31C2917900081CCFC358BF740FC09F0667E5C002C} - p{0101DE9217E0224DFAA82F60C0D93FE25A49C09265AD9FBA9A09B4C4D13020CBA1C4002A} - p{0101A0831A37E357E0BE440ACB7B676F614ECA66E284FAA0C7C5D76B5BB0BA4FF176005E} - x{A0000000EF184C5AE4_} - x{2_} - x{BE000003BC84F8C240D_} - x{BFFFFFFFBC85CB7E4E3_} - p{01015D730BC79B61A2DEFCD1E502BA3336692765E8C46EACF5C53903E35E71A636650067} - x{2_} - x{BE000003BC91558E0A1_} - x{BFFFFFFFBC8B96FC9C5_} - x{2_} - x{BE000003BC91627AEA9_} - x{BFFFFFFFBC8B96FC9C5_} - x{2_} - x{BE000003BC91627AEA9_} - x{BFFFFFFFBC8B96FC9C5_} - x{0000000000000000FFFFFFFFFFFFFFFF8259BB4F2AFBA61EDBBDCA2588BC7A859000021383611794401B2C7C100AB2D3300CCFFE58FC58F57345754FF872EE40765249C6541DFEBBA306B551992F033D080FCEA503F4A317F1AB360F072DBBD734E3EF3236850A562DA7572A0} - x{2_} - x{BE000003BC91627AEA9_} - x{BFFFFFFFBC8B96FC9C5_} - x{4A33F6FD000000003218ED7B400367D51EE096AC7A440DDAAC406E4729B0F9E6DF16FE41DC9C0512CAA7A3B83FBCB9CEE542950EB55B8950D8807B4559E5450DD97FB9ED4_} - x{98738F902_} - x{0C39C7C81_} - x{BFFB5D18557F2CB862C8FD55A72B335069C1DBCFCF2DBDBCDD21ECB32944D4BCBE8004_} - x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} - x{D003} - x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} - x{E_} - x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} - x{D003} - x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{DF_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} - x{0C8057061B8732C44_} - x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} - x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} - x{BFEDBFE285E48E43E249A93F61BD3A57B85BB3EB580A3CDFA802CFF52C478F3C4A18738F90198738F94_} - x{4606030E71F2} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} - x{A_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} - x{0CBADD094169E6144F5861E3E311_} - x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} - x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} - x{82_} - x{A01B6FF8A1792390F8926A4FD86F4E95EE16ECFAD6028F37EA00B3FD4B11E3CF12805_} - x{4606030E71F2} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} - x{E_} - x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} - x{D003} - x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{DF_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} - x{0C8057061B8732C44_} - x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} - x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} - x{661CE3E5_} - x{4606030E71F2} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} - x{A_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} - x{0CBADD094169E6144F5861E3E311_} - x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} - x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} - x{9D309B72_} - x{0E984DB9_} - x{BFF036D41B2F52198152B3FD3DC263022215EB42AE8A0AB5B5AC342D3026707D8E1CB04711581B6A0D97A90CC0A959FE9EE13181110AF5A15745055ADAD61A169813383EC7280000042706C5FFB8272C11C4} - x{7606DA8365EA43302A567FA7B84C604442BD6855D14156B6B58685A604CE0FB1C00002138362FFDC1F1F27FA52070906F628A06DE23ABB450870EA6D8E7811C6AF1DFAF54B4BA2D8D00002138058CD1C164295E080003472C11C4} - x{E_} - x{8800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F638044D930D01E800FAEE663E38A9F800366072A9B9713E32DEFFA3E28DBAE57E8992A4C2A84F8A25BF8E847343B2A27FC4F62B56B1555B8281E24AEAD43B5988D0700000000B214AF210FD95F2DE_} - x{D003} - x{420058664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD282D3CC289E8000000000000000000000000000000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{DF_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} - x{0C8057061B8732C44_} - x{439CE31388000000000000000021800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002_} - x{C98AD5704C1CE3B8000000000002000000000002466526AA808E6E6EAEC40644BD8980B22C89A57ECA0CFAE4F05C7700E8B976DE4090204C_} - x{72EC8358015F1ED7C5CF2C3C70CA8605BACFB507714E5930EED3254608E21B1D78D7756D5CDCB0CF515C91FEE0FA1E98D0A236BB7959E67178EEFDD53D0CFB4F0E} - x{BFD8664BAB79C77F3D71CDD6ADA016F2FF6EFED1CD812D345E8212E7FAC2205BAD188054616C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD6A80000042706C5FFB866201518} - x{7B0CC9756F38EFE7AE39BAD5B402DE5FEDDFDA39B025A68BD0425CFF58440B75A00002138362FFDC36CE2DC532608D1C3F3031545CE41BA27BCE08610DCF5B2EBF763A1ED63B391590000212881050BC164295E08000146201518} - x{A_} - x{4800C0DB506CBD4866054ACFF4F7098C088857AD0ABA282AD6D6B0D0B4C099C1F639002C3325D5BCE3BF9EB8E6EB56D00B797FB77F68E6C0969A2F410973FD61102DD694169E6144F4061CE3E4000042706C5FFB84C852BC10C_} - x{0000000039346231653335642D663230652D343264612D383065362D636233666461663662373034} - x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} - x{0CBADD094169E6144F5861E3E311_} - x{407BEC3D090000000000000000001D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} - x{C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E04_} - x{72AC2028ECEE4B29B9BAC4EC852A4CA42AF5E8EEECE5B7A91F58B36E9ED7A760B38B37FC90D0EA016DEE056BA8BC84E1645B7A559568ACBE12CE1BD2B112A7234C} \ No newline at end of file diff --git a/src/codegen/combinator.ts b/src/codegen/combinator.ts index 729cfbc..f7cd49f 100644 --- a/src/codegen/combinator.ts +++ b/src/codegen/combinator.ts @@ -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 == '#<') { diff --git a/tests/my.spec.ts b/tests/my.spec.ts index 33b71da..7e14f1f 100644 --- a/tests/my.spec.ts +++ b/tests/my.spec.ts @@ -9,26 +9,20 @@ import { Program } from '../src/ast/nodes' import * as crc32 from 'crc-32'; import { loadBlock, storeBlock } from '../generated_block' -import { Cell, beginCell } from 'ton' +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', () => { - const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQA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F47BX2a46BlCEEASbT5onV/U/84xeSJyavbABIoSAEBjEEiz61R0H6dN/31qP+jdNbMpw2LOYRARFnHgWqSWNQAFihIAQH7oZuYMFt25/R/rDYjGn6YHeVcFBL0C+pwhZCqt/bUbQAYKEgBAejgWpiIE/DT5RzO8P3ny8oYPEHblFq5UlxWkXAW5QQUAB0oSAEBHEzwo1WeCo4ej1Vob5/vEp/iY9isaWQiUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; - const cs = Cell.fromBase64(state); - console.log(cs.hash()) - fs.writeFile('kek.txt', cs.toString(), () => { }); + let builder = beginCell(); + // builder.storeUint(5, 0); - let blk = loadBlock(cs.beginParse()); - // console.log(util.inspect(blk.value_flow, false, null, true /* enable colors */)) - let builder = beginCell(); - storeBlock(blk)(builder); - console.log(builder.endCell().hash()) - fs.writeFile('lol.txt', builder.endCell().toString(), () => { }); + let x = beginCell().endCell().beginParse() + // let y = x.loadBits(0) - expect(cs.hash()builder.endCell().hash()).toBeTruthy() + builder.storeBits(BitString.EMPTY) }) }) diff --git a/tests/tlbgen.spec.ts b/tests/tlbgen.spec.ts index 60ad279..f96c709 100644 --- a/tests/tlbgen.spec.ts +++ b/tests/tlbgen.spec.ts @@ -10,7 +10,7 @@ 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, RefCombinatorInRef, loadRefCombinatorInRef, storeRefCombinatorInRef} from '../generated_test' import { beginCell } from 'ton' -import { loadBlock, storeBlock } from '../generated_block' +import { loadBit, loadBlock, storeBlock } from '../generated_block' const fixturesDir = path.resolve(__dirname, 'fixtures') @@ -115,9 +115,9 @@ 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}} checkSameOnStoreLoad(exprArgUser, loadExprArgUser, storeExprArgUser); @@ -141,6 +141,15 @@ describe('Generating tlb code', () => { checkSameOnStoreLoad(falseAnonField, loadFalseAnonField, storeFalseAnonField) let checkKeyword: CheckKeyword = {kind: 'CheckKeyword', const0: 3} checkSameOnStoreLoad(checkKeyword, loadCheckKeyword, storeCheckKeyword); + + let checkBigIntExpected: bigint = BigInt(2709958555) * BigInt(1e9) + BigInt(228628813); + let checkBigIntBits = 100; + + let initialCell = beginCell().storeUint(checkBigIntExpected, checkBigIntBits).endCell(); + let checkBigInt: BitLenArg = loadBitLenArg(initialCell.beginParse(), checkBigIntBits) + let checkBigIntStored = beginCell(); + storeBitLenArg(checkBigInt)(checkBigIntStored); + expect(deepEqual(initialCell.hash(), checkBigIntStored.endCell().hash())).toBeTruthy(); }) test('Combinators', () => { @@ -151,7 +160,7 @@ 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 = { @@ -481,17 +490,13 @@ describe('Generating tlb code', () => { }) test('block tlb tests', () => { - // const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQAAAAAAAAAAAAAAAAACCJygAAAAAWQpXggAACE4Ni/9xAGyx8EgCgQDAdkAAAAAAAAAAP//////////glm7Tyr7ph7bvcoliLx6hZAAAhODYReUQBssfBAKstMwDM/+WPxY9XNFdU/4cu5AdlJJxlQd/rujBrVRmS8DPQgPzqUD9KMX8as2Dwctu9c04+8yNoUKVi2nVyoIECITgglm7Tyr7ph7cAUQIxMBBLN2nl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iUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; - // const cs = Cell.fromBase64(state); - // console.log(cs.hash()) - // fs.writeFile('kek.txt', cs.toString(), () => { }); - - // let blk = loadBlock(cs.beginParse()); - // let builder = beginCell(); - // storeBlock(blk)(builder); - // console.log(builder.endCell().hash()) - // fs.writeFile('lol.txt', builder.endCell().toString(), () => { }); - - // expect(deepEqual(cs.hash(), builder.endCell().hash())).toBeTruthy() + const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQAAAAAAAAAAAAAAAAACCJygAAAAAWQpXggAACE4Ni/9xAGyx8EgCgQDAdkAAAAAAAAAAP//////////glm7Tyr7ph7bvcoliLx6hZAAAhODYReUQBssfBAKstMwDM/+WPxY9XNFdU/4cu5AdlJJxlQd/rujBrVRmS8DPQgPzqUD9KMX8as2Dwctu9c04+8yNoUKVi2nVyoIECITgglm7Tyr7ph7cAUQIxMBBLN2nlX3TD24GAYQIxMBAZDm24nj3jYYBywVIxMBAQHXwZPFZ1f4SRIIAgEgoQkAE7////+8hct+TjABEQAAAAAAAAAAUKICEbjkjftDxPT2BA0MAA0AEO5rKAAIAiWCWbtPKwbudNwSzdp5V90w9sAIEBACoJvHqYcAAAAAhAECCJygAAAAAQAAAAAAAAAAAAAAAABkKV4IAAAhODYv/cAAACE4Ni/9xGSeizgABnF2AbLHwQGyxDjEAAAAAwAAAAAAAAAuRg8AmAAAITg2ILuBAgicn5OTTn6kV5z6E216F7w1p7ywI+Wsbfm4l7+fH+PH3tbaRLtCQmSNinuI8RM1X14LJBOd+k8nDROIBcr5XT35BMwCASARFgATvgAAA7yRYnrqk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iDQCgIc5VbMjIwiILAJ0/bP0ox8Mhl7pq3nHfz1xzdatoBby/27+0c2BLTReghLn+sIgW60BOakUIU2cW4pkwRo4fmBiqLnIN0T3nBDCG562XX7sdD2sdnIrIAAEJRAgoXgzEIm/ACwzJdW847+euObrVtALeX+3f2jmwJaaL0EJc/1hEC3WiLIWOQyEuC4AAAISiBBQvDTmpFCFTQMbFAFEAAAAHKamjF34U6KK3xtVYfJKAXDfvq96k6gufJtm4qCqODWvc6mJQQChIAQH+tf9oIOL/DZSD5+DWLIF9hGeJ+0rlgMh4hm2VnavVwAAHKEgBAUgdtUNfI6DNuGnT4LxXs0enI/3ZDm/o4GHoKSGDln4+AAkoSAEBPGpn9ZfihdTNKNHBnuCU+UJCqd2zuEnF8cCnicSLziUACChIAQGMKLC8jkc1VDLelznZZQAbKi948QotANztzp+kaw4W7QAIKEgBAVMWIkIDHF47BX2a46BlCEEASbT5onV/U/84xeSJyavbABIoSAEBjEEiz61R0H6dN/31qP+jdNbMpw2LOYRARFnHgWqSWNQAFihIAQH7oZuYMFt25/R/rDYjGn6YHeVcFBL0C+pwhZCqt/bUbQAYKEgBAejgWpiIE/DT5RzO8P3ny8oYPEHblFq5UlxWkXAW5QQUAB0oSAEBHEzwo1WeCo4ej1Vob5/vEp/iY9isaWQiUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; + const cs = Cell.fromBase64(state); + + let blk = loadBlock(cs.beginParse()); + let builder = beginCell(); + storeBlock(blk)(builder); + + expect(deepEqual(cs.hash(), builder.endCell().hash())).toBeTruthy() }) }) From c3b7be9582ab52310f790d76a028ac1739c29c85 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Thu, 14 Dec 2023 00:24:23 -0500 Subject: [PATCH 10/14] fix bigint for some cases but not all --- generated_test.ts | 4 ++-- src/codegen/combinator.ts | 11 +++++------ tests/tlbgen.spec.ts | 20 ++++++++++---------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/generated_test.ts b/generated_test.ts index 9e674d3..50c2748 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -694,7 +694,7 @@ export function storeEither(either: Either, storeX: (x: X) => (build } export function loadBitLenArg(slice: Slice, x: number): BitLenArg { - let value: bigint = slice.loadUint(x); + let value: bigint = slice.loadUintBig(x); return { kind: 'BitLenArg', x: x, @@ -727,7 +727,7 @@ export function storeBitLenArgUser(bitLenArgUser: BitLenArgUser): (builder: Buil } export function loadExprArg(slice: Slice, arg0: number): ExprArg { - let value: bigint = slice.loadUint((arg0 - 2)); + let value: bigint = slice.loadUintBig((arg0 - 2)); return { kind: 'ExprArg', x: (arg0 - 2), diff --git a/src/codegen/combinator.ts b/src/codegen/combinator.ts index f7cd49f..5c68276 100644 --- a/src/codegen/combinator.ts +++ b/src/codegen/combinator.ts @@ -260,16 +260,15 @@ 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'))]) diff --git a/tests/tlbgen.spec.ts b/tests/tlbgen.spec.ts index f96c709..a6a179e 100644 --- a/tests/tlbgen.spec.ts +++ b/tests/tlbgen.spec.ts @@ -119,13 +119,13 @@ describe('Generating tlb code', () => { checkSameOnStoreLoad(bitlenArgUser, loadBitLenArgUser, storeBitLenArgUser); 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); @@ -490,13 +490,13 @@ describe('Generating tlb code', () => { }) test('block tlb tests', () => { - const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQAAAAAAAAAAAAAAAAACCJygAAAAAWQpXggAACE4Ni/9xAGyx8EgCgQDAdkAAAAAAAAAAP//////////glm7Tyr7ph7bvcoliLx6hZAAAhODYReUQBssfBAKstMwDM/+WPxY9XNFdU/4cu5AdlJJxlQd/rujBrVRmS8DPQgPzqUD9KMX8as2Dwctu9c04+8yNoUKVi2nVyoIECITgglm7Tyr7ph7cAUQIxMBBLN2nlX3TD24GAYQIxMBAZDm24nj3jYYBywVIxMBAQHXwZPFZ1f4SRIIAgEgoQkAE7////+8hct+TjABEQAAAAAAAAAAUKICEbjkjftDxPT2BA0MAA0AEO5rKAAIAiWCWbtPKwbudNwSzdp5V90w9sAIEBACoJvHqYcAAAAAhAECCJygAAAAAQAAAAAAAAAAAAAAAABkKV4IAAAhODYv/cAAACE4Ni/9xGSeizgABnF2AbLHwQGyxDjEAAAAAwAAAAAAAAAuRg8AmAAAITg2ILuBAgicn5OTTn6kV5z6E216F7w1p7ywI+Wsbfm4l7+fH+PH3tbaRLtCQmSNinuI8RM1X14LJBOd+k8n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qP+jdNbMpw2LOYRARFnHgWqSWNQAFihIAQH7oZuYMFt25/R/rDYjGn6YHeVcFBL0C+pwhZCqt/bUbQAYKEgBAejgWpiIE/DT5RzO8P3ny8oYPEHblFq5UlxWkXAW5QQUAB0oSAEBHEzwo1WeCo4ej1Vob5/vEp/iY9isaWQiUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; + // const cs = Cell.fromBase64(state); - let blk = loadBlock(cs.beginParse()); - let builder = beginCell(); - storeBlock(blk)(builder); + // let blk = loadBlock(cs.beginParse()); + // let builder = beginCell(); + // storeBlock(blk)(builder); - expect(deepEqual(cs.hash(), builder.endCell().hash())).toBeTruthy() + // expect(deepEqual(cs.hash(), builder.endCell().hash())).toBeTruthy() }) }) From 0127dddc0a013ddaa75b0fe00ae34a6bacedffa2 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Thu, 14 Dec 2023 00:34:10 -0500 Subject: [PATCH 11/14] support bigint --- generated_block.ts | 8 ++++---- generated_test.ts | 20 ++++++++++---------- src/codegen/combinator.ts | 12 +++++++++--- tests/tlbgen.spec.ts | 6 +++--- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/generated_block.ts b/generated_block.ts index 9930c8b..dd0b7c8 100644 --- a/generated_block.ts +++ b/generated_block.ts @@ -314,14 +314,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 { @@ -3666,7 +3666,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, @@ -3686,7 +3686,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, diff --git a/generated_test.ts b/generated_test.ts index 50c2748..340315d 100644 --- a/generated_test.ts +++ b/generated_test.ts @@ -121,7 +121,7 @@ export interface IntBits { export interface IntBitsInside { readonly kind: 'IntBitsInside'; readonly x: number; - readonly a: IntBits; + readonly a: IntBits; } export interface IntBitsOutside { @@ -132,11 +132,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; } @@ -869,8 +869,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 { @@ -883,7 +883,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)); }) @@ -910,11 +910,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', diff --git a/src/codegen/combinator.ts b/src/codegen/combinator.ts index 5c68276..6cea61a 100644 --- a/src/codegen/combinator.ts +++ b/src/codegen/combinator.ts @@ -39,7 +39,11 @@ export function handleCombinator(expr: ParserExpression, fieldName: string, isFi insideStoreParameters = [tMemberExpression(tIdentifier(variableCombinatorName), tIdentifier(goodVariableName(fieldName)))]; let insideStoreParameters2: Expression[] = [tIdentifier('arg')] - + + if (constructor.declaration.combinator.name == 'VarUInteger') { + console.log(expr) + } + if (expr instanceof BuiltinZeroArgs) { if (expr.name == '#') { exprForParam = {argLoadExpr: tNumericLiteral(32), argStoreExpr: tNumericLiteral(32), paramType: 'number', fieldLoadStoreSuffix: 'Uint'} @@ -90,14 +94,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]) diff --git a/tests/tlbgen.spec.ts b/tests/tlbgen.spec.ts index a6a179e..e06e584 100644 --- a/tests/tlbgen.spec.ts +++ b/tests/tlbgen.spec.ts @@ -451,7 +451,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() }, @@ -465,7 +465,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() }, @@ -479,7 +479,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() }, From e1bf1f252237e73b296c35ea6fa80243e94d4e3f Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Thu, 14 Dec 2023 00:43:37 -0500 Subject: [PATCH 12/14] tmp --- tests/tlbgen.spec.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/tlbgen.spec.ts b/tests/tlbgen.spec.ts index e06e584..4104ba3 100644 --- a/tests/tlbgen.spec.ts +++ b/tests/tlbgen.spec.ts @@ -142,14 +142,8 @@ describe('Generating tlb code', () => { let checkKeyword: CheckKeyword = {kind: 'CheckKeyword', const0: 3} checkSameOnStoreLoad(checkKeyword, loadCheckKeyword, storeCheckKeyword); - let checkBigIntExpected: bigint = BigInt(2709958555) * BigInt(1e9) + BigInt(228628813); - let checkBigIntBits = 100; - - let initialCell = beginCell().storeUint(checkBigIntExpected, checkBigIntBits).endCell(); - let checkBigInt: BitLenArg = loadBitLenArg(initialCell.beginParse(), checkBigIntBits) - let checkBigIntStored = beginCell(); - storeBitLenArg(checkBigInt)(checkBigIntStored); - expect(deepEqual(initialCell.hash(), checkBigIntStored.endCell().hash())).toBeTruthy(); + 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', () => { From 8529ab9a52c0369c289ab0b6c72ae257da012cea Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Thu, 14 Dec 2023 01:34:48 -0500 Subject: [PATCH 13/14] tmp --- generated_block.ts | 11 +++++------ generated_test.ts | 1 + src/codegen/combinator.ts | 4 ---- src/codegen/field.ts | 31 ++++++++++++++++++++++++------- src/codegen/main.ts | 1 + tests/my.spec.ts | 2 +- tests/tlbgen.spec.ts | 12 ++++++------ 7 files changed, 38 insertions(+), 24 deletions(-) diff --git a/generated_block.ts b/generated_block.ts index dd0b7c8..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'; } @@ -1141,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; } @@ -6884,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 { @@ -6911,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); diff --git a/generated_test.ts b/generated_test.ts index 340315d..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; diff --git a/src/codegen/combinator.ts b/src/codegen/combinator.ts index 6cea61a..c68968f 100644 --- a/src/codegen/combinator.ts +++ b/src/codegen/combinator.ts @@ -40,10 +40,6 @@ export function handleCombinator(expr: ParserExpression, fieldName: string, isFi insideStoreParameters = [tMemberExpression(tIdentifier(variableCombinatorName), tIdentifier(goodVariableName(fieldName)))]; let insideStoreParameters2: Expression[] = [tIdentifier('arg')] - if (constructor.declaration.combinator.name == 'VarUInteger') { - console.log(expr) - } - if (expr instanceof BuiltinZeroArgs) { if (expr.name == '#') { exprForParam = {argLoadExpr: tNumericLiteral(32), argStoreExpr: tNumericLiteral(32), paramType: 'number', fieldLoadStoreSuffix: 'Uint'} 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/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/tests/my.spec.ts b/tests/my.spec.ts index 7e14f1f..2d2944e 100644 --- a/tests/my.spec.ts +++ b/tests/my.spec.ts @@ -16,7 +16,7 @@ const fixturesDir = path.resolve(__dirname, 'fixtures') describe('parsing into intermediate representation using grammar', () => { test('test.tlb can be parsed', () => { let builder = beginCell(); - // builder.storeUint(5, 0); + builder.storeUint(BigInt(0), 0); let x = beginCell().endCell().beginParse() diff --git a/tests/tlbgen.spec.ts b/tests/tlbgen.spec.ts index 4104ba3..96ade9c 100644 --- a/tests/tlbgen.spec.ts +++ b/tests/tlbgen.spec.ts @@ -484,13 +484,13 @@ describe('Generating tlb code', () => { }) test('block tlb tests', () => { - // const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQAAAAAAAAAAAAAAAAACCJygAAAAAWQpXggAACE4Ni/9xAGyx8EgCgQDAdkAAAAAAAAAAP//////////glm7Tyr7ph7bvcoliLx6hZAAAhODYReUQBssfBAKstMwDM/+WPxY9XNFdU/4cu5AdlJJxlQd/rujBrVRmS8DPQgPzqUD9KMX8as2Dwctu9c04+8yNoUKVi2nVyoIECITgglm7Tyr7ph7cAUQIxMBBLN2nlX3TD24GAYQIxMBAZDm24nj3jYYBywVIxMBAQHXwZPFZ1f4SRIIAgEgoQkAE7////+8hct+TjABEQAAAAAAAAAAUKICEbjkjftDxPT2BA0MAA0AEO5rKAAIAiWCWbtPKwbudNwSzdp5V90w9sAIEBACoJvHqYcAAAAAhAECCJygAAAAAQAAAAAAAAAAAAAAAABkKV4IAAAhODYv/cAAACE4Ni/9xGSeizgABnF2AbLHwQGyxDjEAAAAAwAAAAAAAAAuRg8AmAAAITg2ILuBAgicn5OTTn6kV5z6E216F7w1p7ywI+Wsbfm4l7+fH+PH3tbaRLtCQmSNinuI8RM1X14LJBOd+k8nDROIBcr5XT35BMwCASARFgATvgAAA7yRYnrqkCMTAQCVZm3cySLJmM8TJCITAQBXbLG1sxxLaBSmIhEA7TNAkoCvNMhLqAIBIBcWABO/////vIuW/JxQABO+AAADvJFVjgoQIxMBAyKPwswTbge4RG8ZABGgAAAA7xs7OCQDiUoz9v0AAAAAMhjte0ADZ9Ue4JasekQN2qxAbkcpsPnm3xb+QdycBRLKp6O4P7y5zuVClQ61W4lQ2IB7RVnlRQ3Zf7ntQCAfGwEHnTCbchwCBw6YTbkeH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m4qCqODWvc6mJQQChIAQH+tf9oIOL/DZSD5+DWLIF9hGeJ+0rlgMh4hm2VnavVwAAHKEgBAUgdtUNfI6DNuGnT4LxXs0enI/3ZDm/o4GHoKSGDln4+AAkoSAEBPGpn9ZfihdTNKNHBnuCU+UJCqd2zuEnF8cCnicSLziUACChIAQGMKLC8jkc1VDLelznZZQAbKi948QotANztzp+kaw4W7QAIKEgBAVMWIkIDHF47BX2a46BlCEEASbT5onV/U/84xeSJyavbABIoSAEBjEEiz61R0H6dN/31qP+jdNbMpw2LOYRARFnHgWqSWNQAFihIAQH7oZuYMFt25/R/rDYjGn6YHeVcFBL0C+pwhZCqt/bUbQAYKEgBAejgWpiIE/DT5RzO8P3ny8oYPEHblFq5UlxWkXAW5QQUAB0oSAEBHEzwo1WeCo4ej1Vob5/vEp/iY9isaWQiUjPKLXSa2F0AJyhIAQG6AR8M/S/UB23zXmBMm80bjwEVWFYt7N0B/gicRJjr1wBlKEgBAZAkBO+kH7fhtV/nPdXl/YhX9N1x4bZfgSrpmy1eIH/CACQY+N7F'; - // const cs = Cell.fromBase64(state); + const state = 'te6cckEC0QEAF4EABBAR71Wq////EQ4LARoKigRFBc22uwt5FAe5LkwV9/aUCMG3DMEFmhpBL/V+tBDI/gV3bfbEh9X1jahPoZpMXpC6TwToe2oBAiKcJCMWgMzjAhkCGSUCI1uQI6/i////EQAAAAAAAAAAAAAAAAACCJygAAAAAWQpXggAACE4Ni/9xAGyx8EgCgQDAdkAAAAAAAAAAP//////////glm7Tyr7ph7bvcoliLx6hZAAAhODYReUQBssfBAKstMwDM/+WPxY9XNFdU/4cu5AdlJJxlQd/rujBrVRmS8DPQgPzqUD9KMX8as2Dwctu9c04+8yNoUKVi2nVyoIECITgglm7Tyr7ph7cAUQIxMBBLN2nlX3TD24GAYQIxMBAZDm24nj3jYYBywVIxMBAQHXwZPFZ1f4SRIIAgEgoQkAE7////+8hct+TjABEQAAAAAAAAAAUKICEbjkjftDxPT2BA0MAA0AEO5rKAA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/CACQY+N7F'; + const cs = Cell.fromBase64(state); - // let blk = loadBlock(cs.beginParse()); - // let builder = beginCell(); - // storeBlock(blk)(builder); + let blk = loadBlock(cs.beginParse()); + let builder = beginCell(); + storeBlock(blk)(builder); - // expect(deepEqual(cs.hash(), builder.endCell().hash())).toBeTruthy() + expect(deepEqual(cs.hash(), builder.endCell().hash())).toBeTruthy() }) }) From f357cc4dcb84bbf5aa80fe5c68c73fafc677b928 Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Thu, 14 Dec 2023 01:35:44 -0500 Subject: [PATCH 14/14] fix exotic cell --- tests/my.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/my.spec.ts b/tests/my.spec.ts index 2d2944e..a260eb6 100644 --- a/tests/my.spec.ts +++ b/tests/my.spec.ts @@ -15,7 +15,7 @@ const fixturesDir = path.resolve(__dirname, 'fixtures') describe('parsing into intermediate representation using grammar', () => { test('test.tlb can be parsed', () => { - let builder = beginCell(); + let builder = beginCell();// builder.storeUint(BigInt(0), 0);