mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
contracts: Allow indeterministic instructions off-chain (#12469)
* Allow indetermistic instructions off-chain * Apply suggestions from code review Co-authored-by: Sasha Gryaznov <hi@agryaznov.com> * fmt Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>
This commit is contained in:
committed by
GitHub
parent
d0dcf008ec
commit
3ae4be8662
@@ -1959,7 +1959,16 @@ impl_runtime_apis! {
|
||||
input_data: Vec<u8>,
|
||||
) -> pallet_contracts_primitives::ContractExecResult<Balance> {
|
||||
let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block);
|
||||
Contracts::bare_call(origin, dest, value, gas_limit, storage_deposit_limit, input_data, true)
|
||||
Contracts::bare_call(
|
||||
origin,
|
||||
dest,
|
||||
value,
|
||||
gas_limit,
|
||||
storage_deposit_limit,
|
||||
input_data,
|
||||
true,
|
||||
pallet_contracts::Determinism::Deterministic,
|
||||
)
|
||||
}
|
||||
|
||||
fn instantiate(
|
||||
@@ -1973,23 +1982,41 @@ impl_runtime_apis! {
|
||||
) -> pallet_contracts_primitives::ContractInstantiateResult<AccountId, Balance>
|
||||
{
|
||||
let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block);
|
||||
Contracts::bare_instantiate(origin, value, gas_limit, storage_deposit_limit, code, data, salt, true)
|
||||
Contracts::bare_instantiate(
|
||||
origin,
|
||||
value,
|
||||
gas_limit,
|
||||
storage_deposit_limit,
|
||||
code,
|
||||
data,
|
||||
salt,
|
||||
true
|
||||
)
|
||||
}
|
||||
|
||||
fn upload_code(
|
||||
origin: AccountId,
|
||||
code: Vec<u8>,
|
||||
storage_deposit_limit: Option<Balance>,
|
||||
determinism: pallet_contracts::Determinism,
|
||||
) -> pallet_contracts_primitives::CodeUploadResult<Hash, Balance>
|
||||
{
|
||||
Contracts::bare_upload_code(origin, code, storage_deposit_limit)
|
||||
Contracts::bare_upload_code(
|
||||
origin,
|
||||
code,
|
||||
storage_deposit_limit,
|
||||
determinism,
|
||||
)
|
||||
}
|
||||
|
||||
fn get_storage(
|
||||
address: AccountId,
|
||||
key: Vec<u8>,
|
||||
) -> pallet_contracts_primitives::GetStorageResult {
|
||||
Contracts::get_storage(address, key)
|
||||
Contracts::get_storage(
|
||||
address,
|
||||
key
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user