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

updated smartcontracts

- updated smartcontracts
- updated fullnode database layout
- fixed memory leak in blockchain-explorer
- updated tonlib
This commit is contained in:
ton 2019-10-23 17:43:50 +04:00
parent 9c9248a9ae
commit c860ce3d1e
104 changed files with 7309 additions and 1335 deletions

View file

@ -48,6 +48,15 @@
} \
}
#define TRY_STATUS_PROMISE(promise_name, status) \
{ \
auto try_status = (status); \
if (try_status.is_error()) { \
promise_name.set_error(std::move(try_status)); \
return; \
} \
}
#define TRY_RESULT(name, result) TRY_RESULT_IMPL(TD_CONCAT(TD_CONCAT(r_, name), __LINE__), auto name, result)
#define TRY_RESULT_PROMISE(promise_name, name, result) \
@ -309,6 +318,11 @@ class Status {
return std::move(*this);
}
Auto move_as_ok() {
UNREACHABLE();
return {};
}
Status move_as_error_prefix(const Status &status) const TD_WARN_UNUSED_RESULT {
return status.move_as_error_suffix(message());
}

View file

@ -128,7 +128,7 @@ auto invoke(F &&f,
}
template <class F, class... Args, std::size_t... S>
auto call_tuple_impl(F &func, std::tuple<Args...> &&tuple, IntSeq<S...>) {
auto call_tuple_impl(F &&func, std::tuple<Args...> &&tuple, IntSeq<S...>) {
return func(std::forward<Args>(std::get<S>(tuple))...);
}
@ -163,7 +163,7 @@ class LogicAnd {
};
template <class F, class... Args>
auto call_tuple(F &func, std::tuple<Args...> &&tuple) {
auto call_tuple(F &&func, std::tuple<Args...> &&tuple) {
return detail::call_tuple_impl(func, std::move(tuple), detail::IntRange<sizeof...(Args)>());
}

View file

@ -38,6 +38,34 @@
namespace td {
class RandomSteps {
public:
struct Step {
std::function<void()> func;
td::uint32 weight;
};
RandomSteps(std::vector<Step> steps) : steps_(std::move(steps)) {
for (auto &step : steps_) {
steps_sum_ += step.weight;
}
}
template <class Random>
void step(Random &rnd) {
auto w = rnd() % steps_sum_;
for (auto &step : steps_) {
if (w < step.weight) {
step.func();
break;
}
w -= step.weight;
}
}
private:
std::vector<Step> steps_;
td::int32 steps_sum_ = 0;
};
class RegressionTester {
public:
virtual ~RegressionTester() = default;