@@ -1041,8 +1041,7 @@ td::Status ImportCertificateQuery::receive(td::BufferSlice data) {
1041
1041
1042
1042
1043
1043
td::Status SignShardOverlayCertificateQuery::run () {
1044
- TRY_RESULT_ASSIGN (wc_, tokenizer_.get_token <td::int32>());
1045
- TRY_RESULT_ASSIGN (shard_, tokenizer_.get_token <td::int64>() );
1044
+ TRY_RESULT_ASSIGN (shard_, tokenizer_.get_token <ton::ShardIdFull>() );
1046
1045
TRY_RESULT_ASSIGN (key_, tokenizer_.get_token <ton::PublicKeyHash>());
1047
1046
TRY_RESULT_ASSIGN (expire_at_, tokenizer_.get_token <td::int32>());
1048
1047
TRY_RESULT_ASSIGN (max_size_, tokenizer_.get_token <td::uint32>());
@@ -1052,8 +1051,9 @@ td::Status SignShardOverlayCertificateQuery::run() {
1052
1051
}
1053
1052
1054
1053
td::Status SignShardOverlayCertificateQuery::send () {
1055
- auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_signShardOverlayCertificate>
1056
- (wc_, shard_, ton::create_tl_object<ton::ton_api::engine_validator_keyHash>(key_.tl ()), expire_at_, max_size_);
1054
+ auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_signShardOverlayCertificate>(
1055
+ shard_.workchain , shard_.shard , ton::create_tl_object<ton::ton_api::engine_validator_keyHash>(key_.tl ()),
1056
+ expire_at_, max_size_);
1057
1057
td::actor::send_closure (console_, &ValidatorEngineConsole::envelope_send_query, std::move (b), create_promise ());
1058
1058
return td::Status::OK ();
1059
1059
}
@@ -1071,8 +1071,7 @@ td::Status SignShardOverlayCertificateQuery::receive(td::BufferSlice data) {
1071
1071
}
1072
1072
1073
1073
td::Status ImportShardOverlayCertificateQuery::run () {
1074
- TRY_RESULT_ASSIGN (wc_, tokenizer_.get_token <td::int32>());
1075
- TRY_RESULT_ASSIGN (shard_, tokenizer_.get_token <td::int64>() );
1074
+ TRY_RESULT_ASSIGN (shard_, tokenizer_.get_token <ton::ShardIdFull>());
1076
1075
TRY_RESULT_ASSIGN (key_, tokenizer_.get_token <ton::PublicKeyHash>());
1077
1076
TRY_RESULT_ASSIGN (in_file_, tokenizer_.get_token <std::string>());
1078
1077
@@ -1083,8 +1082,9 @@ td::Status ImportShardOverlayCertificateQuery::send() {
1083
1082
TRY_RESULT (data, td::read_file (in_file_));
1084
1083
TRY_RESULT_PREFIX (cert, ton::fetch_tl_object<ton::ton_api::overlay_Certificate>(data.as_slice (), true ),
1085
1084
" incorrect certificate" );
1086
- auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_importShardOverlayCertificate>
1087
- (wc_, shard_, ton::create_tl_object<ton::ton_api::engine_validator_keyHash>(key_.tl ()), std::move (cert));
1085
+ auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_importShardOverlayCertificate>(
1086
+ shard_.workchain , shard_.shard , ton::create_tl_object<ton::ton_api::engine_validator_keyHash>(key_.tl ()),
1087
+ std::move (cert));
1088
1088
td::actor::send_closure (console_, &ValidatorEngineConsole::envelope_send_query, std::move (b), create_promise ());
1089
1089
return td::Status::OK ();
1090
1090
}
@@ -1173,23 +1173,20 @@ td::Status GetPerfTimerStatsJsonQuery::receive(td::BufferSlice data) {
1173
1173
}
1174
1174
1175
1175
td::Status GetShardOutQueueSizeQuery::run () {
1176
- TRY_RESULT_ASSIGN (block_id_.workchain , tokenizer_.get_token <int >());
1177
- TRY_RESULT_ASSIGN (block_id_.shard , tokenizer_.get_token <long long >());
1176
+ TRY_RESULT (shard, tokenizer_.get_token <ton::ShardIdFull>());
1177
+ block_id_.workchain = shard.workchain ;
1178
+ block_id_.shard = shard.shard ;
1178
1179
TRY_RESULT_ASSIGN (block_id_.seqno , tokenizer_.get_token <int >());
1179
1180
if (!tokenizer_.endl ()) {
1180
- ton::ShardIdFull dest;
1181
- TRY_RESULT_ASSIGN (dest.workchain , tokenizer_.get_token <int >());
1182
- TRY_RESULT_ASSIGN (dest.shard , tokenizer_.get_token <long long >());
1183
- dest_ = dest;
1181
+ TRY_RESULT_ASSIGN (dest_, tokenizer_.get_token <ton::ShardIdFull>());
1184
1182
}
1185
1183
TRY_STATUS (tokenizer_.check_endl ());
1186
1184
return td::Status::OK ();
1187
1185
}
1188
1186
1189
1187
td::Status GetShardOutQueueSizeQuery::send () {
1190
1188
auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_getShardOutQueueSize>(
1191
- dest_ ? 1 : 0 , ton::create_tl_block_id_simple (block_id_), dest_ ? dest_.value ().workchain : 0 ,
1192
- dest_ ? dest_.value ().shard : 0 );
1189
+ dest_.is_valid () ? 1 : 0 , ton::create_tl_block_id_simple (block_id_), dest_.workchain , dest_.shard );
1193
1190
td::actor::send_closure (console_, &ValidatorEngineConsole::envelope_send_query, std::move (b), create_promise ());
1194
1191
return td::Status::OK ();
1195
1192
}
@@ -1563,14 +1560,13 @@ td::Status GetAdnlStatsQuery::receive(td::BufferSlice data) {
1563
1560
}
1564
1561
1565
1562
td::Status AddShardQuery::run () {
1566
- TRY_RESULT_ASSIGN (wc_ , tokenizer_.get_token <td::int32 >());
1567
- TRY_RESULT_ASSIGN (shard_, tokenizer_.get_token <td::int64> ());
1563
+ TRY_RESULT_ASSIGN (shard_ , tokenizer_.get_token <ton::ShardIdFull >());
1564
+ TRY_STATUS ( tokenizer_.check_endl ());
1568
1565
return td::Status::OK ();
1569
1566
}
1570
1567
1571
1568
td::Status AddShardQuery::send () {
1572
- auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_addShard>(
1573
- ton::create_tl_shard_id (ton::ShardIdFull (wc_, shard_)));
1569
+ auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_addShard>(ton::create_tl_shard_id (shard_));
1574
1570
td::actor::send_closure (console_, &ValidatorEngineConsole::envelope_send_query, std::move (b), create_promise ());
1575
1571
return td::Status::OK ();
1576
1572
}
@@ -1583,14 +1579,13 @@ td::Status AddShardQuery::receive(td::BufferSlice data) {
1583
1579
}
1584
1580
1585
1581
td::Status DelShardQuery::run () {
1586
- TRY_RESULT_ASSIGN (wc_ , tokenizer_.get_token <td::int32 >());
1587
- TRY_RESULT_ASSIGN (shard_, tokenizer_.get_token <td::int64> ());
1582
+ TRY_RESULT_ASSIGN (shard_ , tokenizer_.get_token <ton::ShardIdFull >());
1583
+ TRY_STATUS ( tokenizer_.check_endl ());
1588
1584
return td::Status::OK ();
1589
1585
}
1590
1586
1591
1587
td::Status DelShardQuery::send () {
1592
- auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_delShard>(
1593
- ton::create_tl_shard_id (ton::ShardIdFull (wc_, shard_)));
1588
+ auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_delShard>(ton::create_tl_shard_id (shard_));
1594
1589
td::actor::send_closure (console_, &ValidatorEngineConsole::envelope_send_query, std::move (b), create_promise ());
1595
1590
return td::Status::OK ();
1596
1591
}
0 commit comments