Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit b8bf5d9

Browse files
authored
Merge pull request paritytech#111 from subspace/tweak-weights
Tweak weights on extrinsics
2 parents dabf765 + e4df4e8 commit b8bf5d9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/pallet-feeds/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,15 @@ mod pallet {
109109
}
110110

111111
// TODO: add proper weights
112+
// TODO: For now we don't have fees, but we will have them in the future
112113
/// Put a new object into a feed
113-
#[pallet::weight(10_000)]
114+
#[pallet::weight((10_000, Pays::No))]
114115
pub fn put(
115116
origin: OriginFor<T>,
116117
feed_id: FeedId,
117118
data: PutDataObject,
118119
metadata: ObjectMetadata,
119-
) -> DispatchResultWithPostInfo {
120+
) -> DispatchResult {
120121
let who = ensure_signed(origin)?;
121122

122123
let object_size = data.len() as u64;
@@ -137,8 +138,7 @@ mod pallet {
137138

138139
Self::deposit_event(Event::DataSubmitted(metadata, who, object_size));
139140

140-
// TODO: For now we don't have fees, but we will have them in the future
141-
Ok(Pays::No.into())
141+
Ok(())
142142
}
143143
}
144144
}

crates/pallet-subspace/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ pub mod pallet {
442442
/// This extrinsic must be called unsigned and it is expected that only block authors will
443443
/// call it (validated in `ValidateUnsigned`), as such if the block author is defined it
444444
/// will be defined as the equivocation reporter.
445-
#[pallet::weight(<T as Config>::WeightInfo::report_equivocation())]
445+
#[pallet::weight((<T as Config>::WeightInfo::report_equivocation(), DispatchClass::Operational))]
446446
// Suppression because the custom syntax will also generate an enum and we need enum to have
447447
// boxed value.
448448
#[allow(clippy::boxed_local)]
@@ -474,7 +474,7 @@ pub mod pallet {
474474
///
475475
/// This extrinsic must be called unsigned and it is expected that only block authors will
476476
/// call it (validated in `ValidateUnsigned`).
477-
#[pallet::weight(<T as Config>::WeightInfo::store_root_block())]
477+
#[pallet::weight((<T as Config>::WeightInfo::store_root_block(), DispatchClass::Mandatory, Pays::No))]
478478
pub fn store_root_block(
479479
origin: OriginFor<T>,
480480
root_block: RootBlock,

0 commit comments

Comments
 (0)