1717 Copyright 2017-2020 Telegram Systems LLP
1818*/
1919#pragma once
20- #include " td/utils/int_types.h"
21- #include " ton/ton-types.h"
2220
2321#include < ctime>
2422
23+ #include " td/utils/as.h"
24+ #include " ton/ton-types.h"
25+
2526namespace block {
2627
2728namespace log {
@@ -35,9 +36,9 @@ struct Start {
3536 unsigned type_field;
3637 unsigned created_at;
3738 unsigned char zerostate_root_hash[32 ];
38- Start (const RootHash& hash, unsigned _now = 0 )
39+ Start (const ton:: RootHash& hash, unsigned _now = 0 )
3940 : tag_field(tag), type_field(log_type), created_at(_now ? _now : (unsigned )std::time(nullptr )) {
40- td::as<RootHash>(zerostate_root_hash) = hash;
41+ td::as<ton:: RootHash>(zerostate_root_hash) = hash;
4142 }
4243};
4344
@@ -48,10 +49,10 @@ struct SetZeroState {
4849 long long file_size;
4950 unsigned char file_hash[32 ];
5051 unsigned char root_hash[32 ];
51- SetZeroState (const RootHash& rhash, const FileHash& fhash, unsigned long long _fsize, unsigned _flags = 0 )
52+ SetZeroState (const ton:: RootHash& rhash, const ton:: FileHash& fhash, unsigned long long _fsize, unsigned _flags = 0 )
5253 : tag_field(tag), flags(_flags), file_size(_fsize) {
53- td::as<FileHash>(file_hash) = fhash;
54- td::as<RootHash>(root_hash) = rhash;
54+ td::as<ton:: FileHash>(file_hash) = fhash;
55+ td::as<ton:: RootHash>(root_hash) = rhash;
5556 }
5657};
5758
@@ -66,16 +67,16 @@ struct NewBlock {
6667 unsigned char file_hash[32 ];
6768 unsigned char root_hash[32 ];
6869 unsigned char last_bytes[8 ];
69- NewBlock (const ton::BlockId& block, const RootHash& rhash, const FileHash& fhash, unsigned long long _fsize,
70+ NewBlock (const ton::BlockId& block, const ton:: RootHash& rhash, const ton:: FileHash& fhash, unsigned long long _fsize,
7071 unsigned _flags)
7172 : tag_field(tag)
7273 , flags(_flags)
7374 , workchain(block.workchain)
7475 , seqno(block.seqno)
7576 , shard(block.shard)
7677 , file_size(_fsize) {
77- td::as<FileHash>(file_hash) = fhash;
78- td::as<RootHash>(root_hash) = rhash;
78+ td::as<ton:: FileHash>(file_hash) = fhash;
79+ td::as<ton:: RootHash>(root_hash) = rhash;
7980 td::as<unsigned long long >(last_bytes) = 0 ;
8081 }
8182};
@@ -91,16 +92,16 @@ struct NewState {
9192 unsigned char file_hash[32 ];
9293 unsigned char root_hash[32 ];
9394 unsigned char last_bytes[8 ];
94- NewState (const ton::BlockId& state, const RootHash& rhash, const FileHash& fhash, unsigned long long _fsize,
95+ NewState (const ton::BlockId& state, const ton:: RootHash& rhash, const ton:: FileHash& fhash, unsigned long long _fsize,
9596 unsigned _flags)
9697 : tag_field(tag)
9798 , flags(_flags)
9899 , workchain(state.workchain)
99100 , seqno(state.seqno)
100101 , shard(state.shard)
101102 , file_size(_fsize) {
102- td::as<FileHash>(file_hash) = fhash;
103- td::as<RootHash>(root_hash) = rhash;
103+ td::as<ton:: FileHash>(file_hash) = fhash;
104+ td::as<ton:: RootHash>(root_hash) = rhash;
104105 td::as<unsigned long long >(last_bytes) = 0 ;
105106 }
106107};
0 commit comments