mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
updated submodules, bugfixes
- added new fift/func code for validator complaint creation - bugfixes in validator - updates in tonlib - new versions of rocksdb/abseil - hardfork support
This commit is contained in:
parent
16a4566091
commit
9f008b129f
129 changed files with 8438 additions and 879 deletions
|
@ -21,6 +21,31 @@
|
|||
#include "block/block-auto.h"
|
||||
#include "block/block-parse.h"
|
||||
namespace ton {
|
||||
|
||||
namespace smc {
|
||||
td::Ref<vm::CellSlice> pack_grams(td::uint64 amount) {
|
||||
vm::CellBuilder cb;
|
||||
block::tlb::t_Grams.store_integer_value(cb, td::BigInt256(amount));
|
||||
return vm::load_cell_slice_ref(cb.finalize());
|
||||
}
|
||||
|
||||
bool unpack_grams(td::Ref<vm::CellSlice> cs, td::uint64& amount) {
|
||||
td::RefInt256 got;
|
||||
if (!block::tlb::t_Grams.as_integer_to(cs, got)) {
|
||||
return false;
|
||||
}
|
||||
if (!got->unsigned_fits_bits(63)) {
|
||||
return false;
|
||||
}
|
||||
auto x = got->to_long();
|
||||
if (x < 0) {
|
||||
return false;
|
||||
}
|
||||
amount = x;
|
||||
return true;
|
||||
}
|
||||
} // namespace smc
|
||||
|
||||
td::Ref<vm::Cell> GenericAccount::get_init_state(td::Ref<vm::Cell> code, td::Ref<vm::Cell> data) noexcept {
|
||||
return vm::CellBuilder()
|
||||
.store_zeroes(2)
|
||||
|
@ -47,7 +72,7 @@ void GenericAccount::store_int_message(vm::CellBuilder& cb, const block::StdAddr
|
|||
.store_long(dest_address.workchain, 8)
|
||||
.store_int256(dest_addr, 256);
|
||||
block::tlb::t_Grams.store_integer_value(cb, td::BigInt256(gramms));
|
||||
cb.store_zeroes(9 + 64 + 32 + 1 + 1);
|
||||
cb.store_zeroes(9 + 64 + 32);
|
||||
}
|
||||
|
||||
td::Ref<vm::Cell> GenericAccount::create_ext_message(const block::StdAddress& address, td::Ref<vm::Cell> new_state,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue