@@ -9,7 +9,7 @@ use std::io::{ErrorKind, Read, Seek, Write};
9
9
use std:: path:: PathBuf ;
10
10
use ton_block:: { InMsg , OutMsg , AccountStatus , ExtOutMessageHeader , MsgEnvelope } ;
11
11
use ton_block:: { HashmapAugType , BlkPrevInfo , Deserializable , ShardIdent } ;
12
- use ton_types:: { UInt256 , deserialize_tree_of_cells, BagOfCells , BuilderData } ;
12
+ use ton_types:: { UInt256 , deserialize_tree_of_cells, BagOfCells } ;
13
13
14
14
#[ cfg( test) ]
15
15
#[ path = "../../../tonos-se-tests/unit/test_block_finality.rs" ]
@@ -102,7 +102,7 @@ debug!("FINBLK {:?}", hashes);
102
102
hash : sb. block_hash . clone ( ) ,
103
103
} ;
104
104
let mut shard = vec ! [ ] ;
105
- BagOfCells :: with_root ( & sb. shard_state . write_to_new_cell ( ) ?. into ( ) )
105
+ BagOfCells :: with_root ( & sb. shard_state . serialize ( ) ?)
106
106
. write_to ( & mut shard, false ) ?;
107
107
// save shard state
108
108
self . shard_state_storage . save_serialized_shardstate_ex (
@@ -352,9 +352,9 @@ debug!("FINBLK {:?}", hashes);
352
352
if !is_sync {
353
353
if let Some ( db) = self . db . clone ( ) {
354
354
355
- // let block_root = block.write_to_new_cell ()?.into() ;
356
- // let state_root = shard_state.write_to_new_cell ()?.into() ;
357
- // let block_info_root = block.read_info()?.write_to_new_cell ()?;
355
+ // let block_root = block.serialize ()?;
356
+ // let state_root = shard_state.serialize ()?;
357
+ // let block_info_root = block.read_info()?.serialize ()?;
358
358
// let block_info_cells = BagOfCells::with_root(&block_info_root.into())
359
359
// .withdraw_cells();
360
360
@@ -594,7 +594,7 @@ debug!(target: "node", "PUT-BLOCK-HASH {:?}", sb.block_hash);
594
594
/// get number of last finalized shard
595
595
fn get_last_finality_shard_hash ( & self ) -> NodeResult < ( u64 , UInt256 ) > {
596
596
// TODO avoid serilization there
597
- let cell: Cell = self . last_finalized_block . shard_state . write_to_new_cell ( ) ?. into ( ) ;
597
+ let cell = self . last_finalized_block . shard_state . serialize ( ) ?;
598
598
599
599
Ok ( ( self . last_finalized_block . seq_no , cell. repr_hash ( ) ) )
600
600
}
@@ -719,9 +719,8 @@ impl ShardBlock {
719
719
// Test-lite-client requires hash od unsigned block
720
720
// TODO will to think, how to do better
721
721
let mut block_data = vec ! [ ] ;
722
- let mut builder = BuilderData :: new ( ) ;
723
- sblock. block ( ) . write_to ( & mut builder) . unwrap ( ) ; // TODO process result
724
- let bag = BagOfCells :: with_root ( & builder. into ( ) ) ;
722
+ let cell = sblock. block ( ) . serialize ( ) . unwrap ( ) ; // TODO process result
723
+ let bag = BagOfCells :: with_root ( & cell) ;
725
724
bag. write_to ( & mut block_data, false ) . unwrap ( ) ; // TODO process result
726
725
727
726
let mut hasher = Sha256 :: new ( ) ;
@@ -747,7 +746,7 @@ impl ShardBlock {
747
746
buf. append ( & mut self . block_hash . as_slice ( ) . to_vec ( ) ) ;
748
747
buf. append ( & mut self . file_hash . as_slice ( ) . to_vec ( ) ) ;
749
748
750
- BagOfCells :: with_root ( & self . shard_state . write_to_new_cell ( ) ?. into ( ) )
749
+ BagOfCells :: with_root ( & self . shard_state . serialize ( ) ?)
751
750
. write_to ( & mut buf, false ) ?;
752
751
753
752
let mut block_buf = Vec :: new ( ) ;
@@ -852,7 +851,7 @@ pub(crate) fn generate_block_with_seq_no(shard_ident: ShardIdent, seq_no: u32, p
852
851
let mut outmsg2 = Message :: with_ext_out_header ( eomh) ;
853
852
* outmsg2. body_mut ( ) = Some ( SliceData :: new ( vec ! [ 0x02 ; 120 ] ) ) ;
854
853
855
- let tr_cell: Cell = transaction. write_to_new_cell ( ) . unwrap ( ) . into ( ) ;
854
+ let tr_cell = transaction. serialize ( ) . unwrap ( ) ;
856
855
857
856
let out_msg1 = OutMsg :: new (
858
857
& MsgEnvelope :: with_message_and_fee ( & outmsg1, 9u32 . into ( ) ) . unwrap ( ) ,
0 commit comments