Skip to content

Commit

Permalink
Add DescribeBodyTerminal to DescribeAllTerminal (#506)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Li <chrisli30@users.noreply.github.com>
  • Loading branch information
arrudagates and chrisli30 authored Apr 9, 2024
1 parent 1abdbdc commit e07a534
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,22 @@ impl DescribeLocation for DescribeAccountKey20Terminal {

pub type DescribeAccountIdTerminal = (DescribeAccountId32Terminal, DescribeAccountKey20Terminal);

pub struct DescribeBodyTerminal;
impl DescribeLocation for DescribeBodyTerminal {
fn describe_location(l: &MultiLocation) -> Option<Vec<u8>> {
match (l.parents, &l.interior) {
(0, X1(Plurality { id, part })) => Some((b"Body", id, part).encode()),
_ => return None,
}
}
}

pub type DescribeAllTerminal = (
DescribeTerminus,
DescribePalletTerminal,
DescribeAccountId32Terminal,
DescribeAccountKey20Terminal,
DescribeBodyTerminal,
);

pub struct DescribeFamily<DescribeInterior>(PhantomData<DescribeInterior>);
Expand Down

0 comments on commit e07a534

Please sign in to comment.