mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
updated tonlib, fixed bugs
updated tonlib fixed bugs in func validator: partial support for hardforks liteserver: support for waitMasterchainBlock prefix transactions: support for gas flat rate
This commit is contained in:
parent
841d5ebac2
commit
7ea00ebfcf
89 changed files with 1922 additions and 608 deletions
|
@ -179,6 +179,44 @@ void StateDb::get_async_serializer_state(td::Promise<AsyncSerializerState> promi
|
|||
static_cast<UnixTime>(obj->last_ts_)});
|
||||
}
|
||||
|
||||
void StateDb::update_hardforks(std::vector<BlockIdExt> blocks, td::Promise<td::Unit> promise) {
|
||||
auto key = create_hash_tl_object<ton_api::db_state_key_hardforks>();
|
||||
|
||||
std::vector<tl_object_ptr<ton_api::tonNode_blockIdExt>> vec;
|
||||
|
||||
for (auto &e : blocks) {
|
||||
vec.push_back(create_tl_block_id(e));
|
||||
}
|
||||
|
||||
kv_->begin_transaction().ensure();
|
||||
kv_->set(key.as_slice(), create_serialize_tl_object<ton_api::db_state_hardforks>(std::move(vec))).ensure();
|
||||
kv_->commit_transaction();
|
||||
|
||||
promise.set_value(td::Unit());
|
||||
}
|
||||
|
||||
void StateDb::get_hardforks(td::Promise<std::vector<BlockIdExt>> promise) {
|
||||
auto key = create_hash_tl_object<ton_api::db_state_key_hardforks>();
|
||||
|
||||
std::string value;
|
||||
auto R = kv_->get(key.as_slice(), value);
|
||||
R.ensure();
|
||||
if (R.move_as_ok() == td::KeyValue::GetStatus::NotFound) {
|
||||
promise.set_value(std::vector<BlockIdExt>{});
|
||||
return;
|
||||
}
|
||||
auto F = fetch_tl_object<ton_api::db_state_hardforks>(value, true);
|
||||
F.ensure();
|
||||
auto f = F.move_as_ok();
|
||||
|
||||
std::vector<BlockIdExt> vec;
|
||||
for (auto &e : f->blocks_) {
|
||||
vec.push_back(create_block_id(e));
|
||||
}
|
||||
|
||||
promise.set_value(std::move(vec));
|
||||
}
|
||||
|
||||
StateDb::StateDb(td::actor::ActorId<RootDb> root_db, std::string db_path) : root_db_(root_db), db_path_(db_path) {
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue