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

[BREAKING] chore: upgrade to polkadot 0.9.36 #802

Merged
merged 1 commit into from
Jan 20, 2023
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
1,699 changes: 829 additions & 870 deletions Cargo.lock

Large diffs are not rendered by default.

438 changes: 219 additions & 219 deletions Cargo.toml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions crates/annuity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ pub mod pallet {
// The pallet's dispatchable functions.
#[pallet::call]
impl<T: Config<I>, I: 'static> Pallet<T, I> {
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::withdraw_rewards())]
#[transactional]
pub fn withdraw_rewards(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
Expand All @@ -111,6 +112,7 @@ pub mod pallet {
Ok(().into())
}

#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::update_rewards())]
#[transactional]
pub fn update_rewards(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
Expand All @@ -119,6 +121,7 @@ pub mod pallet {
Ok(().into())
}

#[pallet::call_index(2)]
#[pallet::weight(T::WeightInfo::set_reward_per_wrapped())]
#[transactional]
pub fn set_reward_per_wrapped(
Expand Down
2 changes: 1 addition & 1 deletion crates/btc-relay/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.1.5" }
jsonrpsee = { version = "0.15.1", features = ["server", "macros"] }
jsonrpsee = { version = "0.16.2", features = ["server", "macros"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" }
Expand Down
5 changes: 5 additions & 0 deletions crates/btc-relay/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ pub mod pallet {
///
/// Total Complexity: O(1)
/// # </weight>
#[pallet::call_index(0)]
#[pallet::weight(<T as Config>::WeightInfo::initialize())]
#[transactional]
pub fn initialize(
Expand Down Expand Up @@ -175,6 +176,7 @@ pub mod pallet {
///
/// Total Complexity: O(C + P)
/// # </weight>
#[pallet::call_index(1)]
#[pallet::weight(<T as Config>::WeightInfo::store_block_header())]
#[transactional]
pub fn store_block_header(
Expand Down Expand Up @@ -202,6 +204,7 @@ pub mod pallet {
/// * `expected_btc` - expected amount of BTC (satoshis) sent to the recipient
/// * `recipient_btc_address` - 20 byte Bitcoin address of recipient of the BTC in the 1st / payment UTXO
/// * `op_return_id` - 32 byte hash identifier expected in OP_RETURN (replay protection)
#[pallet::call_index(2)]
#[pallet::weight(<T as Config>::WeightInfo::verify_and_validate_transaction())]
#[transactional]
pub fn verify_and_validate_transaction(
Expand Down Expand Up @@ -242,6 +245,7 @@ pub mod pallet {
/// - One storage read to check stable bitcoin confirmations. O(1)
/// - One storage read to check stable parachain confirmations. O(1)
/// # </weight>
#[pallet::call_index(3)]
#[pallet::weight(<T as Config>::WeightInfo::verify_transaction_inclusion())]
#[transactional]
pub fn verify_transaction_inclusion(
Expand All @@ -267,6 +271,7 @@ pub mod pallet {
/// * `expected_btc` - expected amount of BTC (satoshis) sent to the recipient
/// * `recipient_btc_address` - expected Bitcoin address of recipient (p2sh, p2pkh, p2wpkh)
/// * `op_return_id` - 32 byte hash identifier expected in OP_RETURN (replay protection)
#[pallet::call_index(4)]
#[pallet::weight(<T as Config>::WeightInfo::validate_transaction())]
#[transactional]
pub fn validate_transaction(
Expand Down
2 changes: 2 additions & 0 deletions crates/clients-info/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pub mod pallet {
/// * `client_name` - raw byte string representation of the client name (e.g. `b"vault"`, `b"oracle"`,
/// `b"faucet"`)
/// * `release` - The release information for the given `client_name`
#[pallet::call_index(0)]
#[pallet::weight(<T as Config>::WeightInfo::set_current_client_release())]
#[transactional]
pub fn set_current_client_release(
Expand All @@ -89,6 +90,7 @@ pub mod pallet {
/// * `client_name` - raw byte string representation of the client name (e.g. `b"vault"`, `b"oracle"`,
/// `b"faucet"`)
/// * `release` - The release information for the given `client_name`
#[pallet::call_index(1)]
#[pallet::weight(<T as Config>::WeightInfo::set_pending_client_release())]
#[transactional]
pub fn set_pending_client_release(
Expand Down
5 changes: 5 additions & 0 deletions crates/collator-selection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ pub mod pallet {
#[pallet::call]
impl<T: Config> Pallet<T> {
/// Set the list of invulnerable (fixed) collators.
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::set_invulnerables(new.len() as u32))]
pub fn set_invulnerables(origin: OriginFor<T>, new: Vec<T::AccountId>) -> DispatchResultWithPostInfo {
T::UpdateOrigin::ensure_origin(origin)?;
Expand All @@ -301,6 +302,7 @@ pub mod pallet {
/// Set the ideal number of collators (not including the invulnerables).
/// If lowering this number, then the number of running collators could be higher than this figure.
/// Aside from that edge case, there should be no other way to have more collators than the desired number.
#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::set_desired_candidates())]
pub fn set_desired_candidates(origin: OriginFor<T>, max: u32) -> DispatchResultWithPostInfo {
T::UpdateOrigin::ensure_origin(origin)?;
Expand All @@ -316,6 +318,7 @@ pub mod pallet {
}

/// Set the candidacy bond amount.
#[pallet::call_index(2)]
#[pallet::weight(T::WeightInfo::set_candidacy_bond())]
pub fn set_candidacy_bond(origin: OriginFor<T>, bond: BalanceOf<T>) -> DispatchResultWithPostInfo {
T::UpdateOrigin::ensure_origin(origin)?;
Expand All @@ -328,6 +331,7 @@ pub mod pallet {
/// registered session keys and (b) be able to reserve the `CandidacyBond`.
///
/// This call is not available to `Invulnerable` collators.
#[pallet::call_index(3)]
#[pallet::weight(T::WeightInfo::register_as_candidate(T::MaxCandidates::get()))]
pub fn register_as_candidate(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?;
Expand Down Expand Up @@ -380,6 +384,7 @@ pub mod pallet {
/// This call will fail if the total number of candidates would drop below `MinCandidates`.
///
/// This call is not available to `Invulnerable` collators.
#[pallet::call_index(4)]
#[pallet::weight(T::WeightInfo::leave_intent(T::MaxCandidates::get()))]
pub fn leave_intent(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?;
Expand Down
4 changes: 2 additions & 2 deletions crates/currency/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ primitives = { package = "interbtc-primitives", path = "../../primitives", defau
traits = { path = '../traits', default-features = false }

# Orml dependencies
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "3fcd3cf9e63fe80fd9671912833a900ba09d1cc0", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "3fcd3cf9e63fe80fd9671912833a900ba09d1cc0", default-features = false }
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404", default-features = false }

# for other pallets wanting to mock functions
mocktopus = { version = "0.8.0", optional = true }
Expand Down
15 changes: 15 additions & 0 deletions crates/democracy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ pub mod pallet {
/// Emits `Proposed`.
///
/// Weight: `O(p)`
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::propose())]
pub fn propose(
origin: OriginFor<T>,
Expand Down Expand Up @@ -479,6 +480,7 @@ pub mod pallet {
/// weighted according to this value with no refund.
///
/// Weight: `O(S)` where S is the number of seconds a proposal already has.
#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::second(*seconds_upper_bound))]
pub fn second(
origin: OriginFor<T>,
Expand All @@ -505,6 +507,7 @@ pub mod pallet {
/// - `vote`: The vote configuration.
///
/// Weight: `O(R)` where R is the number of referendums the voter has voted on.
#[pallet::call_index(2)]
#[pallet::weight(
T::WeightInfo::vote_new(T::MaxVotes::get())
.max(T::WeightInfo::vote_existing(T::MaxVotes::get()))
Expand All @@ -528,6 +531,7 @@ pub mod pallet {
/// Emits `Started` and `FastTrack`.
///
/// Weight: `O(1)`
#[pallet::call_index(3)]
#[pallet::weight(T::WeightInfo::fast_track())]
pub fn fast_track(
origin: OriginFor<T>,
Expand All @@ -548,6 +552,7 @@ pub mod pallet {
/// Emits `Started` and `FastTrack`.
///
/// Weight: `O(1)`
#[pallet::call_index(4)]
#[pallet::weight(T::WeightInfo::fast_track())]
pub fn fast_track_default(
origin: OriginFor<T>,
Expand All @@ -567,6 +572,7 @@ pub mod pallet {
/// Emits `FastTrackReferendum`.
///
/// Weight: `O(1)`
#[pallet::call_index(5)]
#[pallet::weight(T::WeightInfo::fast_track_referendum())]
pub fn fast_track_referendum(origin: OriginFor<T>, #[pallet::compact] ref_index: PropIndex) -> DispatchResult {
T::FastTrackOrigin::ensure_origin(origin)?;
Expand All @@ -589,6 +595,7 @@ pub mod pallet {
/// - `ref_index`: The index of the referendum to cancel.
///
/// # Weight: `O(1)`.
#[pallet::call_index(6)]
#[pallet::weight(T::WeightInfo::cancel_referendum())]
pub fn cancel_referendum(
origin: OriginFor<T>,
Expand All @@ -606,6 +613,7 @@ pub mod pallet {
/// - `which`: The index of the referendum to cancel.
///
/// Weight: `O(D)` where `D` is the items in the dispatch queue. Weighted as `D = 10`.
#[pallet::call_index(7)]
#[pallet::weight((T::WeightInfo::cancel_queued(10), DispatchClass::Operational))]
pub fn cancel_queued(origin: OriginFor<T>, which: ReferendumIndex) -> DispatchResult {
ensure_root(origin)?;
Expand All @@ -618,6 +626,7 @@ pub mod pallet {
/// The dispatch origin of this call must be _Root_.
///
/// Weight: `O(1)`.
#[pallet::call_index(8)]
#[pallet::weight(T::WeightInfo::clear_public_proposals())]
pub fn clear_public_proposals(origin: OriginFor<T>) -> DispatchResult {
ensure_root(origin)?;
Expand All @@ -630,6 +639,7 @@ pub mod pallet {
/// - `prop_index`: The index of the proposal to cancel.
///
/// Weight: `O(p)` where `p = PublicProps::<T>::decode_len()`
#[pallet::call_index(9)]
#[pallet::weight(T::WeightInfo::cancel_proposal(T::MaxProposals::get()))]
#[transactional]
pub fn cancel_proposal(origin: OriginFor<T>, #[pallet::compact] prop_index: PropIndex) -> DispatchResult {
Expand Down Expand Up @@ -667,6 +677,7 @@ pub mod pallet {
/// Emits `PreimageNoted`.
///
/// Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit).
#[pallet::call_index(10)]
#[pallet::weight(T::WeightInfo::note_preimage(encoded_proposal.len() as u32))]
pub fn note_preimage(origin: OriginFor<T>, encoded_proposal: Vec<u8>) -> DispatchResult {
Self::note_preimage_inner(ensure_signed(origin)?, encoded_proposal)?;
Expand All @@ -685,6 +696,7 @@ pub mod pallet {
/// Emits `PreimageNoted`.
///
/// Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit).
#[pallet::call_index(11)]
#[pallet::weight(T::WeightInfo::note_imminent_preimage(encoded_proposal.len() as u32))]
pub fn note_imminent_preimage(origin: OriginFor<T>, encoded_proposal: Vec<u8>) -> DispatchResultWithPostInfo {
Self::note_imminent_preimage_inner(ensure_signed(origin)?, encoded_proposal)?;
Expand All @@ -709,6 +721,7 @@ pub mod pallet {
/// Emits `PreimageReaped`.
///
/// Weight: `O(D)` where D is length of proposal.
#[pallet::call_index(12)]
#[pallet::weight(T::WeightInfo::reap_preimage(*proposal_len_upper_bound))]
pub fn reap_preimage(
origin: OriginFor<T>,
Expand Down Expand Up @@ -760,13 +773,15 @@ pub mod pallet {
///
/// Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on.
/// Weight is calculated for the maximum number of vote.
#[pallet::call_index(13)]
#[pallet::weight(T::WeightInfo::remove_vote(T::MaxVotes::get()))]
pub fn remove_vote(origin: OriginFor<T>, index: ReferendumIndex) -> DispatchResult {
let who = ensure_signed(origin)?;
Self::try_remove_vote(&who, index)
}

/// Enact a proposal from a referendum. For now we just make the weight be the maximum.
#[pallet::call_index(14)]
#[pallet::weight(1000)]
pub fn enact_proposal(origin: OriginFor<T>, proposal_hash: T::Hash, index: ReferendumIndex) -> DispatchResult {
ensure_root(origin)?;
Expand Down
6 changes: 5 additions & 1 deletion crates/democracy/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ impl Contains<RuntimeCall> for BaseFilter {
parameter_types! {
pub const BlockHashCount: u64 = 250;
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::constants::WEIGHT_PER_SECOND.set_proof_size(u64::MAX));
frame_system::limits::BlockWeights::simple_max(
Weight::from_parts(
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND,
u64::MAX,
));
}

impl frame_system::Config for Test {
Expand Down
2 changes: 1 addition & 1 deletion crates/escrow/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version = '0.3.0'

[dependencies]
codec = { package = "parity-scale-codec", version = "3.1.5" }
jsonrpsee = { version = "0.15.1", features = ["server", "macros"] }
jsonrpsee = { version = "0.16.2", features = ["server", "macros"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" }
Expand Down
6 changes: 6 additions & 0 deletions crates/escrow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ pub mod pallet {
// The pallet's dispatchable functions.
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pallet::weight(<T as Config>::WeightInfo::create_lock())]
#[transactional]
pub fn create_lock(
Expand Down Expand Up @@ -284,6 +285,7 @@ pub mod pallet {
Self::deposit_for(&who, amount, unlock_height)
}

#[pallet::call_index(1)]
#[pallet::weight(<T as Config>::WeightInfo::increase_amount())]
#[transactional]
pub fn increase_amount(origin: OriginFor<T>, #[pallet::compact] amount: BalanceOf<T>) -> DispatchResult {
Expand All @@ -303,6 +305,7 @@ pub mod pallet {
Self::deposit_for(&who, amount, Zero::zero()).into()
}

#[pallet::call_index(2)]
#[pallet::weight(<T as Config>::WeightInfo::increase_unlock_height())]
#[transactional]
pub fn increase_unlock_height(origin: OriginFor<T>, unlock_height: T::BlockNumber) -> DispatchResult {
Expand Down Expand Up @@ -330,13 +333,15 @@ pub mod pallet {
Self::deposit_for(&who, Zero::zero(), unlock_height)
}

#[pallet::call_index(3)]
#[pallet::weight(<T as Config>::WeightInfo::withdraw())]
#[transactional]
pub fn withdraw(origin: OriginFor<T>) -> DispatchResult {
let who = ensure_signed(origin)?;
Self::remove_lock(&who)
}

#[pallet::call_index(4)]
#[pallet::weight(0)]
#[transactional]
pub fn set_account_limit(
Expand All @@ -350,6 +355,7 @@ pub mod pallet {
Ok(().into())
}

#[pallet::call_index(5)]
#[pallet::weight(0)]
#[transactional]
pub fn set_account_block(origin: OriginFor<T>, who: T::AccountId) -> DispatchResultWithPostInfo {
Expand Down
5 changes: 5 additions & 0 deletions crates/farming/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ pub mod pallet {
/// to the existing duration and the rewards per period are modified
/// s.t. that the total (old remaining + new) rewards are distributed
/// over the new total duration
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::update_reward_schedule())]
#[transactional]
pub fn update_reward_schedule(
Expand Down Expand Up @@ -249,6 +250,7 @@ pub mod pallet {

/// Explicitly remove a reward schedule and transfer any remaining
/// balance to the treasury
#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::remove_reward_schedule())]
#[transactional]
pub fn remove_reward_schedule(
Expand Down Expand Up @@ -280,6 +282,7 @@ pub mod pallet {
}

/// Stake the pool tokens in the reward pool
#[pallet::call_index(2)]
#[pallet::weight(T::WeightInfo::deposit())]
#[transactional]
pub fn deposit(
Expand All @@ -305,6 +308,7 @@ pub mod pallet {
}

/// Unstake the pool tokens from the reward pool
#[pallet::call_index(3)]
#[pallet::weight(T::WeightInfo::withdraw())]
#[transactional]
pub fn withdraw(
Expand All @@ -323,6 +327,7 @@ pub mod pallet {
}

/// Withdraw any accrued rewards from the reward pool
#[pallet::call_index(4)]
#[pallet::weight(T::WeightInfo::claim())]
#[transactional]
pub fn claim(
Expand Down
4 changes: 2 additions & 2 deletions crates/fee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "
currency = { path = "../currency", features = ["testing-utils"] }

# Orml dependencies
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "3fcd3cf9e63fe80fd9671912833a900ba09d1cc0", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "3fcd3cf9e63fe80fd9671912833a900ba09d1cc0", default-features = false }
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404", default-features = false }

# Parachain dependencies
primitives = { package = "interbtc-primitives", path = "../../primitives"}
Expand Down
Loading