-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: registry traits consolidation #701
refactor: registry traits consolidation #701
Conversation
Crate versions that have not been updated:
Crate versions that have been updated:
Runtime version has not been increased. |
Token, | ||
PoolShare(AssetId, AssetId), // Use XYX instead |
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.
this would require migration in basislisk ?
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.
yes
pallets/bonds/src/lib.rs
Outdated
@@ -128,6 +131,9 @@ pub mod pallet { | |||
#[pallet::constant] | |||
type FeeReceiver: Get<Self::AccountId>; | |||
|
|||
/// Asset location type | |||
type AssetLocation: Parameter + Member + Default + MaxEncodedLen; |
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.
Same thing here as in xyk
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.
Looks fine to me
pallets/asset-registry/src/lib.rs
Outdated
let bounded_name = match Self::try_into_bounded(Some(name.to_vec()))? { | ||
Some(n) => n, | ||
None => return Err(Error::<T>::InvalidAssetname.into()), | ||
}; |
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.
let bounded_name = match Self::try_into_bounded(Some(name.to_vec()))? { | |
Some(n) => n, | |
None => return Err(Error::<T>::InvalidAssetname.into()), | |
}; | |
let bounded_name = Self::try_into_bounded(Some(name.to_vec())).map_err(|_| Error::<T>::InvalidAssetname)?; |
Shouldn't need the match, no?
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.
But this would suppress error returned from try_into_bounded()
.
InvalidAssetname
is something that should never happen. try_into_bounded
returns None
only if None
was provided as param.
@@ -36,6 +36,7 @@ use sp_runtime::{ | |||
use std::cell::RefCell; | |||
use std::collections::HashMap; | |||
use std::marker::PhantomData; | |||
//use frame_system::GenesisConfig; |
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.
commented code
pallets/lbp/src/types.rs
Outdated
@@ -0,0 +1,67 @@ | |||
// This file is part of Basilisk-node. |
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.
// This file is part of Basilisk-node. | |
// This file is part of HydraDX-node. |
pallets/lbp/src/types.rs
Outdated
use serde::{Deserialize, Serialize}; | ||
|
||
/// Asset Pair representation for AMM trades | ||
/// ( asset_a, asset_b ) combination where asset_a is meant to be exchanged for asset_b |
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.
/// ( asset_a, asset_b ) combination where asset_a is meant to be exchanged for asset_b | |
/// `( asset_in, asset_out )` combination where `asset_in` is meant to be exchanged for `asset_out` |
pallets/lbp/src/types.rs
Outdated
/// asset_in represents asset coming into the pool | ||
/// asset_out represents asset coming out of the pool |
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.
/// asset_in represents asset coming into the pool | |
/// asset_out represents asset coming out of the pool | |
/// `asset_in` represents asset coming into the pool | |
/// `asset_out` represents asset coming out of the pool |
f88cc0b
into
feat/permissionless-asset-registry
Description
This PR consolidates registry traits and refactors all the pallets/code to use new traits and removes old registry traits.