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

changed validate broadcast logic, added new queries to

validator-engine-console
This commit is contained in:
ton 2019-09-11 16:50:29 +04:00
parent 47814dca3d
commit d8244eff53
24 changed files with 695 additions and 84 deletions

View file

@ -655,3 +655,23 @@ td::Status CreateElectionBidQuery::receive(td::BufferSlice data) {
TRY_STATUS(td::write_file(fname_, f->to_send_payload_.as_slice()));
return td::Status::OK();
}
td::Status CheckDhtServersQuery::run() {
TRY_RESULT_ASSIGN(id_, tokenizer_.get_token<ton::PublicKeyHash>());
return td::Status::OK();
}
td::Status CheckDhtServersQuery::send() {
auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_checkDhtServers>(id_.tl());
td::actor::send_closure(console_, &ValidatorEngineConsole::envelope_send_query, std::move(b), create_promise());
return td::Status::OK();
}
td::Status CheckDhtServersQuery::receive(td::BufferSlice data) {
TRY_RESULT_PREFIX(f, ton::fetch_tl_object<ton::ton_api::engine_validator_dhtServersStatus>(data.as_slice(), true),
"received incorrect answer: ");
for (auto &s : f->servers_) {
td::TerminalIO::out() << "id=" << s->id_ << " status=" << (s->status_ ? "SUCCESS" : "FAIL") << "\n";
}
return td::Status::OK();
}