mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
emulator fixes, add basic tests (#1042)
This commit is contained in:
parent
0bf7febf9f
commit
c15d878fee
9 changed files with 352 additions and 18 deletions
|
@ -24,12 +24,12 @@ public:
|
|||
}
|
||||
|
||||
void set_c7(block::StdAddress address, uint32_t unixtime, uint64_t balance, td::BitArray<256> rand_seed, std::shared_ptr<const block::Config> config) {
|
||||
args_.set_address(address);
|
||||
args_.set_address(std::move(address));
|
||||
args_.set_now(unixtime);
|
||||
args_.set_balance(balance);
|
||||
args_.set_rand_seed(rand_seed);
|
||||
args_.set_rand_seed(std::move(rand_seed));
|
||||
if (config) {
|
||||
args_.set_config(config);
|
||||
args_.set_config(std::move(config));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,10 @@ public:
|
|||
args_.set_c7(std::move(c7));
|
||||
}
|
||||
|
||||
void set_config(std::shared_ptr<const block::Config> config) {
|
||||
args_.set_config(std::move(config));
|
||||
}
|
||||
|
||||
void set_prev_blocks_info(td::Ref<vm::Tuple> tuple) {
|
||||
args_.set_prev_blocks_info(std::move(tuple));
|
||||
}
|
||||
|
@ -46,7 +50,8 @@ public:
|
|||
}
|
||||
|
||||
Answer run_get_method(int method_id, td::Ref<vm::Stack> stack) {
|
||||
return smc_.run_get_method(args_.set_stack(stack).set_method_id(method_id));
|
||||
ton::SmartContract::Args args = args_;
|
||||
return smc_.run_get_method(args.set_stack(stack).set_method_id(method_id));
|
||||
}
|
||||
|
||||
Answer send_external_message(td::Ref<vm::Cell> message_body) {
|
||||
|
@ -54,7 +59,8 @@ public:
|
|||
}
|
||||
|
||||
Answer send_internal_message(td::Ref<vm::Cell> message_body, uint64_t amount) {
|
||||
return smc_.send_internal_message(message_body, args_.set_amount(amount));
|
||||
ton::SmartContract::Args args = args_;
|
||||
return smc_.send_internal_message(message_body, args.set_amount(amount));
|
||||
}
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue