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
|
@ -81,25 +81,32 @@ class WriteFile : public td::actor::Actor {
|
|||
|
||||
class ReadFile : public td::actor::Actor {
|
||||
public:
|
||||
enum Flags : td::uint32 { f_disable_log = 1 };
|
||||
void start_up() override {
|
||||
auto S = td::read_file(file_name_, max_length_, offset_);
|
||||
if (S.is_ok()) {
|
||||
promise_.set_result(S.move_as_ok());
|
||||
} else {
|
||||
// TODO check error code
|
||||
LOG(ERROR) << "missing file " << file_name_;
|
||||
if (flags_ & Flags::f_disable_log) {
|
||||
LOG(DEBUG) << "missing file " << file_name_;
|
||||
} else {
|
||||
LOG(ERROR) << "missing file " << file_name_;
|
||||
}
|
||||
promise_.set_error(td::Status::Error(ErrorCode::notready, "file does not exist"));
|
||||
}
|
||||
stop();
|
||||
}
|
||||
ReadFile(std::string file_name, td::int64 offset, td::int64 max_length, td::Promise<td::BufferSlice> promise)
|
||||
: file_name_(file_name), offset_(offset), max_length_(max_length), promise_(std::move(promise)) {
|
||||
ReadFile(std::string file_name, td::int64 offset, td::int64 max_length, td::uint32 flags,
|
||||
td::Promise<td::BufferSlice> promise)
|
||||
: file_name_(file_name), offset_(offset), max_length_(max_length), flags_(flags), promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
private:
|
||||
std::string file_name_;
|
||||
td::int64 offset_;
|
||||
td::int64 max_length_;
|
||||
td::uint32 flags_;
|
||||
td::Promise<td::BufferSlice> promise_;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue