Skip to content
Snippets Groups Projects
Commit a57745dd authored by juangirini's avatar juangirini Committed by GitHub
Browse files

Companion PR for add events to ContractResult (#2510)

* contracts: adapt to new contracts api

* update lockfile for {"substrate", "polkadot"}

---------

Co-authored-by: parity-processbot <>
parent 07cd877e
Branches
No related merge requests found
This diff is collapsed.
......@@ -7,13 +7,13 @@ use frame_support::{
traits::{ConstBool, ConstU32, Nothing},
};
use pallet_contracts::{
weights::SubstrateWeight, Config, DefaultAddressGenerator, Frame, Schedule,
weights::SubstrateWeight, Config, DebugInfo, DefaultAddressGenerator, Frame, Schedule,
};
pub use parachains_common::AVERAGE_ON_INITIALIZE_RATIO;
// Prints debug output of the `contracts` pallet to stdout if the node is
// started with `-lruntime::contracts=debug`.
pub const CONTRACTS_DEBUG_OUTPUT: bool = true;
pub const CONTRACTS_DEBUG_OUTPUT: DebugInfo = DebugInfo::UnsafeDebug;
parameter_types! {
pub const DepositPerItem: Balance = deposit(1, 0);
......
......@@ -99,6 +99,11 @@ pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, Si
pub type Migrations = (pallet_contracts::Migration<Runtime>,);
type EventRecord = frame_system::EventRecord<
<Runtime as frame_system::Config>::RuntimeEvent,
<Runtime as frame_system::Config>::Hash,
>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
......@@ -532,7 +537,7 @@ impl_runtime_apis! {
}
}
impl pallet_contracts::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash> for Runtime {
impl pallet_contracts::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash, EventRecord> for Runtime {
fn call(
origin: AccountId,
dest: AccountId,
......@@ -540,7 +545,7 @@ impl_runtime_apis! {
gas_limit: Option<Weight>,
storage_deposit_limit: Option<Balance>,
input_data: Vec<u8>,
) -> pallet_contracts_primitives::ContractExecResult<Balance> {
) -> pallet_contracts_primitives::ContractExecResult<Balance, EventRecord> {
let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block);
Contracts::bare_call(
origin,
......@@ -550,6 +555,7 @@ impl_runtime_apis! {
storage_deposit_limit,
input_data,
contracts::CONTRACTS_DEBUG_OUTPUT,
pallet_contracts::CollectEvents::UnsafeCollect,
pallet_contracts::Determinism::Enforced,
)
}
......@@ -562,7 +568,7 @@ impl_runtime_apis! {
code: pallet_contracts_primitives::Code<Hash>,
data: Vec<u8>,
salt: Vec<u8>,
) -> pallet_contracts_primitives::ContractInstantiateResult<AccountId, Balance> {
) -> pallet_contracts_primitives::ContractInstantiateResult<AccountId, Balance, EventRecord> {
let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block);
Contracts::bare_instantiate(
origin,
......@@ -573,6 +579,7 @@ impl_runtime_apis! {
data,
salt,
contracts::CONTRACTS_DEBUG_OUTPUT,
pallet_contracts::CollectEvents::UnsafeCollect,
)
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment