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

support for multi-cluster #414

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pallets/ddc-clusters/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,15 @@ pub mod pallet {
}

impl<T: Config> ClusterManager<T> for Pallet<T> {
fn get_all_clusters() -> Result<Vec<ClusterId>, DispatchError> {
let mut cluster_ids = Vec::new();

for cluster_id in <Clusters<T>>::iter_keys() {
aie0 marked this conversation as resolved.
Show resolved Hide resolved
cluster_ids.push(cluster_id);
}

Ok(cluster_ids)
}
fn get_manager_account_id(cluster_id: &ClusterId) -> Result<T::AccountId, DispatchError> {
let cluster =
Clusters::<T>::try_get(cluster_id).map_err(|_| Error::<T>::ClusterDoesNotExist)?;
Expand Down
3 changes: 3 additions & 0 deletions pallets/ddc-customers/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ impl<T: Config> ClusterQuery<T> for TestClusterManager {
}

impl<T: Config> ClusterManager<T> for TestClusterManager {
fn get_all_clusters() -> Result<Vec<ClusterId>, DispatchError> {
unimplemented!()
}
fn get_manager_account_id(_cluster_id: &ClusterId) -> Result<T::AccountId, DispatchError> {
unimplemented!()
}
Expand Down
Loading
Loading