Skip to content
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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AmbientTea
Copy link
Contributor

@AmbientTea AmbientTea commented Oct 25, 2024

Description

This is a demo of the client-facing API of the address associations pallet.

@AmbientTea AmbientTea force-pushed the ETCM-8697-address-association-pallet-demo branch from abf1379 to 071a64f Compare October 25, 2024 08:44
}

/// Retrieves all main chain - partner chain address associations from the runtime storage.
pub fn get_all_address_associations() -> Vec<(T::MainChainAddress, T::PartnerChainAddress)>
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants