-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "pallet-emission0" | ||
description = "The chain's emission pallet." | ||
version = "0.1.0" | ||
license = "MIT-0" | ||
authors.workspace = true | ||
edition.workspace = true | ||
|
||
[features] | ||
default = ["std"] | ||
std = ["codec/std", "polkadot-sdk/std", "scale-info/std"] | ||
|
||
[dependencies] | ||
codec = { workspace = true, features = ["derive"] } | ||
scale-info = { workspace = true, features = ["derive"] } | ||
polkadot-sdk = { workspace = true, features = ["experimental", "runtime"] } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#![cfg_attr(not(feature = "std"), no_std)] | ||
|
||
mod weights; | ||
|
||
use crate::frame::testing_prelude::DispatchResult; | ||
use crate::frame::testing_prelude::OriginFor; | ||
pub use pallet::*; | ||
use polkadot_sdk::frame_support::pallet_prelude::{ValueQuery, *}; | ||
use polkadot_sdk::polkadot_sdk_frame as frame; | ||
|
||
#[frame::pallet] | ||
pub mod pallet { | ||
use frame::traits::ConstU64; | ||
|
||
use super::*; | ||
|
||
#[pallet::storage] | ||
pub type Weights<T> = | ||
StorageMap<_, Identity, u16, BoundedVec<(u16, u16), ConstU32<{ u32::MAX }>>>; | ||
|
||
#[pallet::storage] | ||
pub type PendingEmission<T> = StorageMap<_, Identity, u16, u64, ValueQuery>; | ||
|
||
#[pallet::storage] | ||
pub type UnitEmission<T> = StorageValue<_, u64, ValueQuery, ConstU64<23148148148>>; | ||
|
||
#[pallet::config] | ||
pub trait Config: polkadot_sdk::frame_system::Config {} | ||
|
||
#[pallet::pallet] | ||
pub struct Pallet<T>(_); | ||
|
||
#[pallet::call] | ||
impl<T: Config> Pallet<T> { | ||
#[pallet::call_index(0)] | ||
#[pallet::weight(0)] | ||
Check failure on line 36 in pallets/emission0/src/lib.rs GitHub Actions / clippythis let-binding has unit value
Check failure on line 36 in pallets/emission0/src/lib.rs GitHub Actions / clippyuse of deprecated constant `pallet::warnings::ConstantWeight_0::_w`: It is deprecated to use hard-coded constant as call weight. Please instead benchmark all calls or put the pallet into `dev` mode. For more info see: <https://github.com/paritytech/substrate/pull/13798>
|
||
pub fn set_weights_extrinsic( | ||
origin: OriginFor<T>, | ||
uids: Vec<u16>, | ||
weights: Vec<u16>, | ||
) -> DispatchResult { | ||
weights::set_weights::<T>(origin, uids, weights) | ||
} | ||
|
||
#[pallet::call_index(2)] | ||
#[pallet::weight(0)] | ||
Check failure on line 46 in pallets/emission0/src/lib.rs GitHub Actions / clippythis let-binding has unit value
Check failure on line 46 in pallets/emission0/src/lib.rs GitHub Actions / clippyuse of deprecated constant `pallet::warnings::ConstantWeight_1::_w`: It is deprecated to use hard-coded constant as call weight. Please instead benchmark all calls or put the pallet into `dev` mode. For more info see: <https://github.com/paritytech/substrate/pull/13798>
|
||
pub fn delegate_weight_control_extrinsic( | ||
origin: OriginFor<T>, | ||
target: T::AccountId, | ||
) -> DispatchResult { | ||
weights::delegate_weight_control::<T>(origin, target) | ||
} | ||
|
||
#[pallet::call_index(3)] | ||
#[pallet::weight(0)] | ||
Check failure on line 55 in pallets/emission0/src/lib.rs GitHub Actions / clippythis let-binding has unit value
Check failure on line 55 in pallets/emission0/src/lib.rs GitHub Actions / clippyuse of deprecated constant `pallet::warnings::ConstantWeight_2::_w`: It is deprecated to use hard-coded constant as call weight. Please instead benchmark all calls or put the pallet into `dev` mode. For more info see: <https://github.com/paritytech/substrate/pull/13798>
|
||
pub fn regain_weight_control_extrinsic(origin: OriginFor<T>) -> DispatchResult { | ||
weights::regain_weight_control::<T>(origin) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use polkadot_sdk::{ | ||
frame_support::dispatch::DispatchResult, polkadot_sdk_frame::prelude::OriginFor, | ||
}; | ||
|
||
pub fn set_weights<T: crate::Config>( | ||
_origin: OriginFor<T>, | ||
_uids: Vec<u16>, | ||
_weights: Vec<u16>, | ||
) -> DispatchResult { | ||
todo!() | ||
} | ||
|
||
pub fn delegate_weight_control<T: crate::Config>( | ||
_origin: OriginFor<T>, | ||
_target: T::AccountId, | ||
) -> DispatchResult { | ||
todo!() | ||
} | ||
|
||
pub fn regain_weight_control<T: crate::Config>(_origin: OriginFor<T>) -> DispatchResult { | ||
todo!() | ||
} |