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

updated func/fift

- updated func/fift
- updated liteclient/liteserver
- bugfixes
This commit is contained in:
ton 2019-12-29 12:14:12 +03:00
parent d41ce55305
commit acf16718e6
45 changed files with 1360 additions and 185 deletions

View file

@ -346,3 +346,24 @@ bool PrettyPrinter::fetch_uint256_field(vm::CellSlice& cs, int n, std::string na
}
} // namespace tlb
namespace tlb {
bool TypenameLookup::register_types(typename TypenameLookup::register_func_t func) {
return func([this](const char* name, const TLB* tp) { return register_type(name, tp); });
}
bool TypenameLookup::register_type(const char* name, const TLB* tp) {
if (!name || !tp) {
return false;
}
auto res = types.emplace(name, tp);
return res.second;
}
const TLB* TypenameLookup::lookup(std::string str) const {
auto it = types.find(str);
return it != types.end() ? it->second : nullptr;
}
} // namespace tlb