mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 06:31:03 +00:00
Contracts: runtime_call and storage_deposit (#13990)
* wip * add comments * fix comment * comments * comments * PR comment * field orders * Update frame/contracts/src/tests.rs * Update frame/contracts/fixtures/call_runtime_and_call.wat Co-authored-by: Sasha Gryaznov <hi@agryaznov.com> * Apply suggestions from code review Co-authored-by: Sasha Gryaznov <hi@agryaznov.com> * Apply suggestions from code review Co-authored-by: Sasha Gryaznov <hi@agryaznov.com> * Update frame/contracts/src/tests.rs Co-authored-by: Sasha Gryaznov <hi@agryaznov.com> * Validate fees of failed call * Update frame/contracts/src/tests.rs * Update frame/contracts/src/tests.rs * Update frame/contracts/src/tests.rs * bubble up refund error * rename fixture file --------- Co-authored-by: Sasha Gryaznov <hi@agryaznov.com> Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -1044,7 +1044,15 @@ impl<T: Config> Invokable<T> for CallInput<T> {
|
||||
debug_message,
|
||||
*determinism,
|
||||
);
|
||||
InternalOutput { gas_meter, storage_deposit: storage_meter.into_deposit(&origin), result }
|
||||
|
||||
match storage_meter.try_into_deposit(&origin) {
|
||||
Ok(storage_deposit) => InternalOutput { gas_meter, storage_deposit, result },
|
||||
Err(err) => InternalOutput {
|
||||
gas_meter,
|
||||
storage_deposit: Default::default(),
|
||||
result: Err(err.into()),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1105,8 +1113,9 @@ impl<T: Config> Invokable<T> for InstantiateInput<T> {
|
||||
&salt,
|
||||
debug_message,
|
||||
);
|
||||
|
||||
storage_deposit = storage_meter
|
||||
.into_deposit(&origin)
|
||||
.try_into_deposit(&origin)?
|
||||
.saturating_add(&StorageDeposit::Charge(extra_deposit));
|
||||
result
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user