-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Goal The goal of this PR is to allow providers to publish messages on specific schema_ids for a given delegator Provider should provider list of schema_ids while adding a user as delegator Closes #224 Closes #314 Closes #140 # Checklist - [x] Updated the js/api-augment code if a custom RPC added/changed - [x] Update msa and messages pallets to support schema grants between delegator and provider - [x] Runtime updated - [x] Tests added - [x] Benchmarks added - [x] Weights updated
- Loading branch information
1 parent
47462e3
commit e20b67e
Showing
34 changed files
with
846 additions
and
406 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use codec::{Decode, Encode, MaxEncodedLen}; | ||
use frame_support::{traits::Get, BoundedVec}; | ||
use orml_utilities::OrderedSet; | ||
use scale_info::TypeInfo; | ||
|
||
/// Extending OrderSet and implement struct OrderedSetExt | ||
#[derive(TypeInfo, Clone, Decode, Encode, PartialEq, Eq, MaxEncodedLen, Default)] | ||
#[scale_info(skip_type_params(T, S))] | ||
pub struct OrderedSetExt< | ||
T: Ord + Encode + Decode + MaxEncodedLen + Clone + Eq + PartialEq, | ||
S: Get<u32>, | ||
>(pub OrderedSet<T, S>); | ||
|
||
impl<T, S> OrderedSetExt<T, S> | ||
where | ||
T: Ord + Encode + Decode + MaxEncodedLen + Clone + Eq + PartialEq + core::fmt::Debug, | ||
S: Get<u32>, | ||
{ | ||
/// Create a new empty set | ||
pub fn new() -> Self { | ||
Self(OrderedSet::<T, S>::new()) | ||
} | ||
/// Create a set from a `Vec`. | ||
/// `v` will be sorted and dedup first. | ||
pub fn from(bv: BoundedVec<T, S>) -> Self { | ||
Self(OrderedSet::<T, S>::from(bv)) | ||
} | ||
} | ||
|
||
impl<T, S> core::fmt::Debug for OrderedSetExt<T, S> | ||
where | ||
T: Ord + Encode + Decode + MaxEncodedLen + Clone + Eq + PartialEq + core::fmt::Debug, | ||
S: Get<u32>, | ||
{ | ||
fn fmt(&self, _f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { | ||
Ok(()) | ||
} | ||
} |
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
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
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
Oops, something went wrong.