-
Notifications
You must be signed in to change notification settings - Fork 7
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
address associations pallet - demo #185
base: master
Are you sure you want to change the base?
Conversation
abf1379
to
071a64f
Compare
} | ||
|
||
/// Retrieves all main chain - partner chain address associations from the runtime storage. | ||
pub fn get_all_address_associations() -> Vec<(T::MainChainAddress, T::PartnerChainAddress)> |
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.
Are they unbounded? I think pallet has to have it configured and at some point defined behaivor when too many associations are made.
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.
In principle they are. As Midnight or any other chain grows, there will be more and more associations. Also, there's no de-association, so they stay forever. Perhaps this function won't be needed at all, or we could return impl Iterator
.
#[pallet::config] | ||
pub trait Config: frame_system::Config { | ||
/// Main chain address type | ||
type MainChainAddress: Member + Parameter + 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.
I would make it a Key
type MainChainAddress: Member + Parameter + MaxEncodedLen; | ||
|
||
/// Partner chain address type | ||
type PartnerChainAddress: Member + Parameter + 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.
I would make it a Value
and make the pallet cardano-associations. I don't even know if cardano is important part here.
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.
I don't think Cardano is important here, but having a key-pair-pallet
would be too general. I'd like to stay within the domain "associating some main chain identifier with some partner chain identifier", whatever chain the main chain and partner chain happen to be.
Description
This is a demo of the client-facing API of the address associations pallet.