mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
New extra currency behavior
This commit is contained in:
parent
1b70e48327
commit
95c8a448b7
17 changed files with 228 additions and 65 deletions
|
@ -1995,12 +1995,9 @@ bool Collator::init_lt() {
|
|||
* @returns True if the configuration parameters were successfully fetched and initialized, false otherwise.
|
||||
*/
|
||||
bool Collator::fetch_config_params() {
|
||||
auto res = block::FetchConfigParams::fetch_config_params(*config_,
|
||||
&old_mparams_, &storage_prices_, &storage_phase_cfg_,
|
||||
&rand_seed_, &compute_phase_cfg_, &action_phase_cfg_,
|
||||
&masterchain_create_fee_, &basechain_create_fee_,
|
||||
workchain(), now_
|
||||
);
|
||||
auto res = block::FetchConfigParams::fetch_config_params(
|
||||
*config_, &old_mparams_, &storage_prices_, &storage_phase_cfg_, &rand_seed_, &compute_phase_cfg_,
|
||||
&action_phase_cfg_, &serialize_cfg_, &masterchain_create_fee_, &basechain_create_fee_, workchain(), now_);
|
||||
if (res.is_error()) {
|
||||
return fatal_error(res.move_as_error());
|
||||
}
|
||||
|
@ -2750,7 +2747,7 @@ bool Collator::create_ticktock_transaction(const ton::StdSmcAddress& smc_addr, t
|
|||
return fatal_error(td::Status::Error(
|
||||
-666, std::string{"cannot create action phase of a new transaction for smart contract "} + smc_addr.to_hex()));
|
||||
}
|
||||
if (!trans->serialize()) {
|
||||
if (!trans->serialize(serialize_cfg_)) {
|
||||
return fatal_error(td::Status::Error(
|
||||
-666, std::string{"cannot serialize new transaction for smart contract "} + smc_addr.to_hex()));
|
||||
}
|
||||
|
@ -2834,7 +2831,7 @@ Ref<vm::Cell> Collator::create_ordinary_transaction(Ref<vm::Cell> msg_root,
|
|||
after_lt = std::max(after_lt, it->second);
|
||||
}
|
||||
auto res = impl_create_ordinary_transaction(msg_root, acc, now_, start_lt, &storage_phase_cfg_, &compute_phase_cfg_,
|
||||
&action_phase_cfg_, external, after_lt);
|
||||
&action_phase_cfg_, &serialize_cfg_, external, after_lt);
|
||||
if (res.is_error()) {
|
||||
auto error = res.move_as_error();
|
||||
if (error.code() == -701) {
|
||||
|
@ -2885,6 +2882,7 @@ Ref<vm::Cell> Collator::create_ordinary_transaction(Ref<vm::Cell> msg_root,
|
|||
* @param storage_phase_cfg The configuration for the storage phase of the transaction.
|
||||
* @param compute_phase_cfg The configuration for the compute phase of the transaction.
|
||||
* @param action_phase_cfg The configuration for the action phase of the transaction.
|
||||
* @param serialize_cfg The configuration for the serialization of the transaction.
|
||||
* @param external Flag indicating if the message is external.
|
||||
* @param after_lt The logical time after which the transaction should occur. Used only for external messages.
|
||||
*
|
||||
|
@ -2898,6 +2896,7 @@ td::Result<std::unique_ptr<block::transaction::Transaction>> Collator::impl_crea
|
|||
block::StoragePhaseConfig* storage_phase_cfg,
|
||||
block::ComputePhaseConfig* compute_phase_cfg,
|
||||
block::ActionPhaseConfig* action_phase_cfg,
|
||||
block::SerializeConfig* serialize_cfg,
|
||||
bool external, LogicalTime after_lt) {
|
||||
if (acc->last_trans_end_lt_ >= lt && acc->transactions.empty()) {
|
||||
return td::Status::Error(-669, PSTRING() << "last transaction time in the state of account " << acc->workchain
|
||||
|
@ -2965,7 +2964,7 @@ td::Result<std::unique_ptr<block::transaction::Transaction>> Collator::impl_crea
|
|||
return td::Status::Error(
|
||||
-669, "cannot create bounce phase of a new transaction for smart contract "s + acc->addr.to_hex());
|
||||
}
|
||||
if (!trans->serialize()) {
|
||||
if (!trans->serialize(*serialize_cfg)) {
|
||||
return td::Status::Error(-669, "cannot serialize new transaction for smart contract "s + acc->addr.to_hex());
|
||||
}
|
||||
return std::move(trans);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue