From c51d07b8c74e7067831b7b0855dd464fa2dec07e Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:50:14 +0800 Subject: [PATCH] https://github.com/pendulum-chain/spacewalk/actions/runs/6482197215/job/17610217546?pr=385#step:12:560 --- pallets/stellar-relay/src/types.rs | 4 ++++ pallets/stellar-relay/src/validation.rs | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pallets/stellar-relay/src/types.rs b/pallets/stellar-relay/src/types.rs index 478b97c3a..18fdbe677 100644 --- a/pallets/stellar-relay/src/types.rs +++ b/pallets/stellar-relay/src/types.rs @@ -1,3 +1,4 @@ +use frame_support::BoundedVec; use crate::{ traits::{Organization, Validator}, Config, @@ -6,3 +7,6 @@ use crate::{ pub type OrganizationIdOf = ::OrganizationId; pub type ValidatorOf = Validator>; pub type OrganizationOf = Organization>; + +pub type ValidatorsList = BoundedVec, ::ValidatorLimit>; +pub type OrganizationsList = BoundedVec, ::OrganizationLimit>; \ No newline at end of file diff --git a/pallets/stellar-relay/src/validation.rs b/pallets/stellar-relay/src/validation.rs index 31126484c..273ce7aaa 100644 --- a/pallets/stellar-relay/src/validation.rs +++ b/pallets/stellar-relay/src/validation.rs @@ -10,14 +10,14 @@ use primitives::stellar::{ use crate::{ pallet::{verify_signature, Config}, - types::{OrganizationOf, ValidatorOf}, Error, NewValidatorsEnactmentBlockHeight, OldOrganizations, OldValidators, Organizations, Pallet, Validators, }; +use crate::types::{OrganizationsList, ValidatorOf, ValidatorsList}; /// Returns a map of organizationID to the number of validators that belongs to it fn validator_count_per_org( - validators: &BoundedVec, T::ValidatorLimit>, + validators: &ValidatorsList, ) -> BTreeMap { let mut validator_count_per_organization_map = BTreeMap::::new(); @@ -36,7 +36,7 @@ fn validator_count_per_org( /// Builds a map used to identify the targeted organizations fn targeted_organization_map( envelopes: &UnlimitedVarArray, - validators: &BoundedVec, T::ValidatorLimit>, + validators: &ValidatorsList, ) -> BTreeMap { // Find the validators that are targeted by the SCP messages let targeted_validators = validators @@ -191,8 +191,8 @@ pub fn find_externalized_envelope( pub fn validators_and_orgs() -> Result< ( - BoundedVec, T::ValidatorLimit>, - BoundedVec, T::OrganizationLimit>, + ValidatorsList, + OrganizationsList, ), Error, > {