From 594033843caeeeea67fa1dfb8bd9adaeca4235de Mon Sep 17 00:00:00 2001 From: polyprogrammist Date: Fri, 12 Jan 2024 16:33:59 -0500 Subject: [PATCH] tmp --- test/generated_files/generated_block.ts | 52 +++++++++++++------------ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/test/generated_files/generated_block.ts b/test/generated_files/generated_block.ts index 9d68097..aa2cede 100644 --- a/test/generated_files/generated_block.ts +++ b/test/generated_files/generated_block.ts @@ -1,4 +1,4 @@ -import { Builder } from 'ton' +import { Builder, Dictionary, DictionaryValue } from 'ton' import { Slice } from 'ton' import { beginCell } from 'ton' import { BitString } from 'ton' @@ -1046,7 +1046,7 @@ export interface Transaction { readonly orig_status: AccountStatus; readonly end_status: AccountStatus; readonly in_msg: Maybe>; - readonly out_msgs: HashmapE>; + readonly out_msgs: Dictionary; readonly total_fees: CurrencyCollection; readonly state_update: HASH_UPDATE; readonly description: TransactionDescr; @@ -2161,7 +2161,7 @@ export interface McBlockExtra { readonly key_block: number; readonly shard_hashes: ShardHashes; readonly shard_fees: ShardFees; - readonly prev_blk_signatures: HashmapE; + readonly prev_blk_signatures: Dictionary; readonly recover_create_msg: Maybe; readonly mint_msg: Maybe; readonly config: ConfigParams | undefined; @@ -6682,14 +6682,17 @@ export function loadTransaction(slice: Slice): Transaction { })) })); - let out_msgs: HashmapE> = loadHashmapE>(slice1, 15, ((slice: Slice) => { - let slice1 = slice.loadRef().beginParse(); - return loadMessage(slice1, ((slice: Slice) => { - return slice + let out_msgs: Dictionary = Dictionary.load(Dictionary.Keys.Uint(15), createSliceValue(), slice1); + console.log('dictionary loaded') + + // loadHashmapE>(slice1, 15, ((slice: Slice) => { + // let slice1 = slice.loadRef().beginParse(); + // return loadMessage(slice1, ((slice: Slice) => { + // return slice - })) + // })) - })); + // })); let total_fees: CurrencyCollection = loadCurrencyCollection(slice); let slice2 = slice.loadRef().beginParse(); let state_update: HASH_UPDATE = loadHASH_UPDATE(slice2, loadAccount); @@ -6742,20 +6745,7 @@ export function storeTransaction(transaction: Transaction): (builder: Builder) = }) }))(cell1); - storeHashmapE>(transaction.out_msgs, ((arg: Message) => { - return ((builder: Builder) => { - let cell1 = beginCell(); - storeMessage(arg, ((arg: Slice) => { - return ((builder: Builder) => { - builder.storeSlice(arg); - }) - - }))(cell1); - builder.storeRef(cell1); - - }) - - }))(cell1); + cell1.storeDict(transaction.out_msgs) builder.storeRef(cell1); storeCurrencyCollection(transaction.total_fees)(builder); let cell2 = beginCell(); @@ -9755,6 +9745,18 @@ masterchain_block_extra#cca5 = McBlockExtra; */ + +function createSliceValue(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeSlice(src); + }, + parse: (src) => { + return src; + } + } +} + export function loadMcBlockExtra(slice: Slice): McBlockExtra { if (((slice.remainingBits >= 16) && (slice.preloadUint(16) == 0xcca5))) { slice.loadUint(16); @@ -9762,7 +9764,7 @@ export function loadMcBlockExtra(slice: Slice): McBlockExtra { let shard_hashes: ShardHashes = loadShardHashes(slice); let shard_fees: ShardFees = loadShardFees(slice); let slice1 = slice.loadRef().beginParse(); - let prev_blk_signatures: HashmapE = loadHashmapE(slice1, 16, loadCryptoSignaturePair); + let prev_blk_signatures: Dictionary = Dictionary.load(Dictionary.Keys.Uint(16), createSliceValue(), slice1) //loadHashmapE(slice1, 16, loadCryptoSignaturePair); let recover_create_msg: Maybe = loadMaybe(slice1, ((slice: Slice) => { let slice1 = slice.loadRef().beginParse(); return loadInMsg(slice1) @@ -9796,7 +9798,7 @@ export function storeMcBlockExtra(mcBlockExtra: McBlockExtra): (builder: Builder storeShardHashes(mcBlockExtra.shard_hashes)(builder); storeShardFees(mcBlockExtra.shard_fees)(builder); let cell1 = beginCell(); - storeHashmapE(mcBlockExtra.prev_blk_signatures, storeCryptoSignaturePair)(cell1); + cell1.storeDict(mcBlockExtra.prev_blk_signatures) storeMaybe(mcBlockExtra.recover_create_msg, ((arg: InMsg) => { return ((builder: Builder) => { let cell1 = beginCell();