1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Remove obsolete interface for importing blocks

This commit is contained in:
SpyCheese 2022-08-08 12:41:28 +03:00
parent 51e6885f2c
commit 7241522de2
13 changed files with 0 additions and 385 deletions

View file

@ -1029,69 +1029,6 @@ td::Status GetValidatorSessionsInfoQuery::receive(td::BufferSlice data) {
return td::Status::OK();
}
td::Status GenerateBlockCandidateQuery::run() {
TRY_RESULT_ASSIGN(wc_, tokenizer_.get_token<td::int32>());
TRY_RESULT_ASSIGN(shard_, tokenizer_.get_token<td::int64>() );
TRY_RESULT_ASSIGN(seqno_, tokenizer_.get_token<td::int32>());
TRY_RESULT_ASSIGN(file_, tokenizer_.get_token<std::string>());
return td::Status::OK();
}
td::Status GenerateBlockCandidateQuery::send() {
auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_generateBlockCandidate>(
ton::create_tl_block_id_simple(ton::BlockId(wc_, shard_, seqno_)));
td::actor::send_closure(console_, &ValidatorEngineConsole::envelope_send_query, std::move(b), create_promise());
return td::Status::OK();
}
td::Status GenerateBlockCandidateQuery::receive(td::BufferSlice data) {
TRY_RESULT_PREFIX(f, ton::fetch_tl_object<ton::ton_api::db_candidate>(data.as_slice(), true),
"received incorrect answer: ");
TRY_STATUS_PREFIX(td::write_file(file_, data.as_slice()), "failed to write block to file");
td::TerminalIO::out() << "successfully written candidate to file\n";
return td::Status::OK();
}
td::Status GetRequiredBlockCandidatesQuery::run() {
TRY_STATUS(tokenizer_.check_endl());
return td::Status::OK();
}
td::Status GetRequiredBlockCandidatesQuery::send() {
auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_getRequiredBlockCandidates>();
td::actor::send_closure(console_, &ValidatorEngineConsole::envelope_send_query, std::move(b), create_promise());
return td::Status::OK();
}
td::Status GetRequiredBlockCandidatesQuery::receive(td::BufferSlice data) {
TRY_RESULT_PREFIX(
f, ton::fetch_tl_object<ton::ton_api::engine_validator_requiredBlockCandidates>(data.as_slice(), true),
"received incorrect answer: ");
td::TerminalIO::out() << td::json_encode<std::string>(td::ToJson(*f), true);
return td::Status::OK();
}
td::Status ImportBlockCandidateQuery::run() {
TRY_RESULT_ASSIGN(file_, tokenizer_.get_token<std::string>());
return td::Status::OK();
}
td::Status ImportBlockCandidateQuery::send() {
TRY_RESULT(data, td::read_file(file_));
TRY_RESULT_PREFIX(candidate, ton::fetch_tl_object<ton::ton_api::db_candidate>(data.as_slice(), true),
"invalid file: ");
auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_importBlockCandidate>(std::move(candidate));
td::actor::send_closure(console_, &ValidatorEngineConsole::envelope_send_query, std::move(b), create_promise());
return td::Status::OK();
}
td::Status ImportBlockCandidateQuery::receive(td::BufferSlice data) {
TRY_RESULT_PREFIX(f, ton::fetch_tl_object<ton::ton_api::engine_validator_success>(data.as_slice(), true),
"received incorrect answer: ");
td::TerminalIO::out() << "successfully imported a block candidate\n";
return td::Status::OK();
}
td::Status AddCollatorQuery::run() {
TRY_RESULT_ASSIGN(adnl_id_, tokenizer_.get_token<ton::PublicKeyHash>());
TRY_RESULT_ASSIGN(wc_, tokenizer_.get_token<td::int32>());