mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 11:27:58 +00:00
Contracts add code_len to ContractsInfo (#14523)
* add code_len to v12 * fix * Update frame/contracts/src/wasm/mod.rs * fix * fixes * rm test * add test back * fix * update test * Fix comments * fix build * del * fix clippy * fix * re-rename
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
pub use pallet::*;
|
||||
|
||||
#[frame_support::pallet(dev_mode)]
|
||||
pub mod pallet {
|
||||
use frame_support::{
|
||||
dispatch::{Pays, PostDispatchInfo},
|
||||
pallet_prelude::DispatchResultWithPostInfo,
|
||||
weights::Weight,
|
||||
};
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
/// Dummy function that overcharges the predispatch weight, allowing us to test the correct
|
||||
/// values of [`ContractResult::gas_consumed`] and [`ContractResult::gas_required`] in
|
||||
/// tests.
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(Weight::from_parts(10_000_000, 0))]
|
||||
pub fn overestimate_pre_charge(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
|
||||
ensure_signed(origin)?;
|
||||
Ok(PostDispatchInfo {
|
||||
actual_weight: Some(Weight::from_parts(100, 0)),
|
||||
pays_fee: Pays::Yes,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user