mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 22:51:13 +00:00
Use explicit call indices (#12891)
* frame-system: explicit call index Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use explicit call indices Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * pallet-template: explicit call index Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * DNM: Temporarily require call_index Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Revert "DNM: Temporarily require call_index" This reverts commit c4934e312e12af72ca05a8029d7da753a9c99346. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
6e0453a298
commit
31f5119ecd
@@ -674,6 +674,7 @@ mod tests {
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(100)]
|
||||
pub fn some_function(origin: OriginFor<T>) -> DispatchResult {
|
||||
// NOTE: does not make any different.
|
||||
@@ -681,36 +682,42 @@ mod tests {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight((200, DispatchClass::Operational))]
|
||||
pub fn some_root_operation(origin: OriginFor<T>) -> DispatchResult {
|
||||
frame_system::ensure_root(origin)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(2)]
|
||||
#[pallet::weight(0)]
|
||||
pub fn some_unsigned_message(origin: OriginFor<T>) -> DispatchResult {
|
||||
frame_system::ensure_none(origin)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(3)]
|
||||
#[pallet::weight(0)]
|
||||
pub fn allowed_unsigned(origin: OriginFor<T>) -> DispatchResult {
|
||||
frame_system::ensure_root(origin)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(4)]
|
||||
#[pallet::weight(0)]
|
||||
pub fn unallowed_unsigned(origin: OriginFor<T>) -> DispatchResult {
|
||||
frame_system::ensure_root(origin)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(5)]
|
||||
#[pallet::weight((0, DispatchClass::Mandatory))]
|
||||
pub fn inherent_call(origin: OriginFor<T>) -> DispatchResult {
|
||||
frame_system::ensure_none(origin)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(6)]
|
||||
#[pallet::weight(0)]
|
||||
pub fn calculate_storage_root(_origin: OriginFor<T>) -> DispatchResult {
|
||||
let root = sp_io::storage::root(sp_runtime::StateVersion::V1);
|
||||
|
||||
Reference in New Issue
Block a user