This repository has been archived by the owner on Sep 22, 2022. It is now read-only.
forked from JoshOrndorff/substrate-node-template
-
Notifications
You must be signed in to change notification settings - Fork 23
[Free Calls] free-calls feedback 16Mar #201
Merged
siman
merged 3 commits into
dappforce:feature/free-calls
from
TarekkMA:tarekkma/free-calls-feedback16march
Mar 24, 2022
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -49,9 +49,9 @@ pub mod pallet { | |||||
pub expires_at: Option<BlockNumber>, | ||||||
} | ||||||
|
||||||
/// Information about a parachain event. | ||||||
/// Information about a locker event that was dispatched in the parachain. | ||||||
#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] | ||||||
pub struct ProcessedEventInfo { | ||||||
pub struct LockerEvent { | ||||||
/// The parachain block number at which the event was found. | ||||||
pub block_number: ParachainBlockNumber, | ||||||
|
||||||
|
@@ -91,8 +91,7 @@ pub mod pallet { | |||||
|
||||||
/// Stores information about last processed event on the parachain. | ||||||
#[pallet::storage] | ||||||
#[pallet::getter(fn last_processed_parachain_event)] | ||||||
pub type LastProcessedParachainEvent<T: Config> = StorageValue<_, ProcessedEventInfo>; | ||||||
pub type LastProcessedLockerEvent<T: Config> = StorageValue<_, LockerEvent>; | ||||||
|
||||||
#[pallet::event] | ||||||
#[pallet::generate_deposit(pub (super) fn deposit_event)] | ||||||
|
@@ -103,27 +102,27 @@ pub mod pallet { | |||||
/// Locked information is cleared for an account. | ||||||
LockedInfoCleared { who: T::AccountId }, | ||||||
|
||||||
/// Last processed event have been set. | ||||||
LastProcessedEventSet { event: ProcessedEventInfo }, | ||||||
/// Last processed locker event have been set. | ||||||
LastLockerEventSet { event: LockerEvent }, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
#[pallet::call] | ||||||
impl<T: Config> Pallet<T> { | ||||||
|
||||||
#[pallet::weight(( | ||||||
<T as Config>::WeightInfo::set_last_processed_parachain_event(), | ||||||
<T as Config>::WeightInfo::set_last_processed_locker_event(), | ||||||
DispatchClass::Operational, | ||||||
Pays::Yes, | ||||||
))] | ||||||
pub fn set_last_processed_parachain_event( | ||||||
pub fn set_last_processed_locker_event( | ||||||
origin: OriginFor<T>, | ||||||
last_processed_event_info: ProcessedEventInfo, | ||||||
last_processed_locker_event: LockerEvent, | ||||||
) -> DispatchResultWithPostInfo { | ||||||
let _ = T::OracleOrigin::ensure_origin(origin)?; | ||||||
|
||||||
<LastProcessedParachainEvent<T>>::put(last_processed_event_info.clone()); | ||||||
<LastProcessedLockerEvent<T>>::put(last_processed_locker_event.clone()); | ||||||
|
||||||
Self::deposit_event(Event::LastProcessedEventSet { event: last_processed_event_info }); | ||||||
Self::deposit_event(Event::LastLockerEventSet { event: last_processed_locker_event }); | ||||||
|
||||||
Ok(Pays::No.into()) | ||||||
} | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.