mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add "delshard", "delcollator" to validator-engine-console
This commit is contained in:
parent
e3823c46f3
commit
d4339b839c
13 changed files with 241 additions and 5 deletions
|
@ -1119,3 +1119,44 @@ td::Status AddShardQuery::receive(td::BufferSlice data) {
|
|||
td::TerminalIO::out() << "successfully added shard\n";
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status DelCollatorQuery::run() {
|
||||
TRY_RESULT_ASSIGN(adnl_id_, tokenizer_.get_token<ton::PublicKeyHash>());
|
||||
TRY_RESULT_ASSIGN(wc_, tokenizer_.get_token<td::int32>());
|
||||
TRY_RESULT_ASSIGN(shard_, tokenizer_.get_token<td::int64>());
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status DelCollatorQuery::send() {
|
||||
auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_delCollator>(
|
||||
adnl_id_.tl(), ton::create_tl_shard_id(ton::ShardIdFull(wc_, shard_)));
|
||||
td::actor::send_closure(console_, &ValidatorEngineConsole::envelope_send_query, std::move(b), create_promise());
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status DelCollatorQuery::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 removed collator\n";
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status DelShardQuery::run() {
|
||||
TRY_RESULT_ASSIGN(wc_, tokenizer_.get_token<td::int32>());
|
||||
TRY_RESULT_ASSIGN(shard_, tokenizer_.get_token<td::int64>());
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status DelShardQuery::send() {
|
||||
auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_delShard>(
|
||||
ton::create_tl_shard_id(ton::ShardIdFull(wc_, shard_)));
|
||||
td::actor::send_closure(console_, &ValidatorEngineConsole::envelope_send_query, std::move(b), create_promise());
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status DelShardQuery::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 removed shard\n";
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue