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

Add identity and collator_selection migrations #1248

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 8 additions & 7 deletions runtime/bifrost-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ use frame_support::{
OnUnbalanced,
},
};
use frame_system::pallet_prelude::BlockNumberFor;
use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned};
use frame_system::{
pallet_prelude::BlockNumberFor, EnsureRoot, EnsureRootWithSuccess, EnsureSigned,
};
use hex_literal::hex;
use orml_oracle::{DataFeeder, DataProvider, DataProviderExtended};
use pallet_identity::legacy::IdentityInfo;
Expand Down Expand Up @@ -501,8 +502,8 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
},
ProxyType::IdentityJudgement => matches!(
c,
RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. })
| RuntimeCall::Utility(..)
RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) |
RuntimeCall::Utility(..)
),
}
}
Expand Down Expand Up @@ -1119,12 +1120,11 @@ impl FeeGetter<RuntimeCall> for ExtraFeeMatcher {
extra_fee_name: ExtraFeeName::StatemineTransfer,
extra_fee_currency: RelayCurrencyId::get(),
},
RuntimeCall::VtokenVoting(bifrost_vtoken_voting::Call::vote { vtoken, .. }) => {
RuntimeCall::VtokenVoting(bifrost_vtoken_voting::Call::vote { vtoken, .. }) =>
ExtraFeeInfo {
extra_fee_name: ExtraFeeName::VoteVtoken,
extra_fee_currency: vtoken.to_token().unwrap_or(vtoken),
}
},
},
RuntimeCall::VtokenVoting(bifrost_vtoken_voting::Call::remove_delegator_vote {
vtoken,
..
Expand Down Expand Up @@ -2071,6 +2071,7 @@ pub mod migrations {
BountiesPalletName,
<Runtime as frame_system::Config>::DbWeight,
>,
pallet_identity::migration::versioned::V0ToV1<Runtime, 100>,
);
}

Expand Down
28 changes: 15 additions & 13 deletions runtime/bifrost-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ use frame_support::{
Currency, EitherOf, EitherOfDiverse, Get, LinearStoragePrice,
},
};
use frame_system::pallet_prelude::BlockNumberFor;
use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned};
use frame_system::{
pallet_prelude::BlockNumberFor, EnsureRoot, EnsureRootWithSuccess, EnsureSigned,
};
use hex_literal::hex;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
// zenlink imports
Expand Down Expand Up @@ -459,20 +460,20 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
),
ProxyType::Governance => matches!(
c,
RuntimeCall::Democracy(..)
| RuntimeCall::Council(..)
| RuntimeCall::TechnicalCommittee(..)
| RuntimeCall::PhragmenElection(..)
| RuntimeCall::Treasury(..)
| RuntimeCall::Utility(..)
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) |
RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::PhragmenElection(..) |
RuntimeCall::Treasury(..) |
RuntimeCall::Utility(..)
),
ProxyType::CancelProxy => {
matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }))
},
ProxyType::IdentityJudgement => matches!(
c,
RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. })
| RuntimeCall::Utility(..)
RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) |
RuntimeCall::Utility(..)
),
}
}
Expand Down Expand Up @@ -971,12 +972,11 @@ impl FeeGetter<RuntimeCall> for ExtraFeeMatcher {
extra_fee_name: ExtraFeeName::StatemineTransfer,
extra_fee_currency: RelayCurrencyId::get(),
},
RuntimeCall::VtokenVoting(bifrost_vtoken_voting::Call::vote { vtoken, .. }) => {
RuntimeCall::VtokenVoting(bifrost_vtoken_voting::Call::vote { vtoken, .. }) =>
ExtraFeeInfo {
extra_fee_name: ExtraFeeName::VoteVtoken,
extra_fee_currency: vtoken.to_token().unwrap_or(vtoken),
}
},
},
RuntimeCall::VtokenVoting(bifrost_vtoken_voting::Call::remove_delegator_vote {
vtoken,
..
Expand Down Expand Up @@ -1886,6 +1886,8 @@ pub mod migrations {
BountiesPalletName,
<Runtime as frame_system::Config>::DbWeight,
>,
pallet_identity::migration::versioned::V0ToV1<Runtime, 100>,
pallet_collator_selection::migration::v2::MigrationToV2<Runtime>,
);
}

Expand Down