mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
integrating the existing state of TON Storage / TON Payments / CPS Fift development branches
This commit is contained in:
parent
040df63c98
commit
4e2624459b
153 changed files with 10760 additions and 1695 deletions
|
@ -79,6 +79,19 @@ td::Result<td::string> CellString::load(CellSlice &cs, unsigned int top_bits) {
|
|||
CHECK(to.offs == (int)size);
|
||||
return res;
|
||||
}
|
||||
td::Result<td::Ref<vm::Cell>> CellString::create(td::Slice slice, unsigned int top_bits) {
|
||||
vm::CellBuilder cb;
|
||||
TRY_STATUS(store(cb, slice, top_bits));
|
||||
return cb.finalize();
|
||||
}
|
||||
bool CellString::fetch_to(CellSlice &cs, std::string &res, unsigned int top_bits) {
|
||||
auto r_str = load(cs, top_bits);
|
||||
if (r_str.is_error()) {
|
||||
return false;
|
||||
}
|
||||
res = r_str.move_as_ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
td::Status CellText::store(CellBuilder &cb, td::Slice slice, unsigned int top_bits) {
|
||||
td::uint32 size = td::narrow_cast<td::uint32>(slice.size() * 8);
|
||||
|
@ -154,4 +167,17 @@ td::Result<td::string> CellText::load(CellSlice &cs) {
|
|||
CHECK(to.offs == (int)size);
|
||||
return res;
|
||||
}
|
||||
td::Result<td::Ref<vm::Cell>> CellText::create(td::Slice slice, unsigned int top_bits) {
|
||||
vm::CellBuilder cb;
|
||||
TRY_STATUS(store(cb, slice, top_bits));
|
||||
return cb.finalize();
|
||||
}
|
||||
bool CellText::fetch_to(CellSlice &cs, std::string &res) {
|
||||
auto r_str = load(cs);
|
||||
if (r_str.is_error()) {
|
||||
return false;
|
||||
}
|
||||
res = r_str.move_as_ok();
|
||||
return true;
|
||||
}
|
||||
} // namespace vm
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue