Skip to content

Commit

Permalink
Update Rust Toolchain to 1.77, Suppress Warnings, and Enhance Runtime (
Browse files Browse the repository at this point in the history
…#778)

* using runt 1.77

* fix clippy errors

* fixing clippy

* update to runtime 2200

* update proyect version to 0.22.0

* add missing migration

* removed the upgrade of versioning
  • Loading branch information
asiniscalchi authored Sep 13, 2024
1 parent d70158c commit 43737f3
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions node/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use std::{
use futures::{future, prelude::*};
// Substrate
use sc_client_api::BlockchainEvents;
#[allow(deprecated)]
use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch};

use sc_network_sync::SyncingService;
Expand Down Expand Up @@ -138,6 +139,7 @@ impl<Api> EthCompatRuntimeApiCollection for Api where
}

#[allow(clippy::too_many_arguments)]
#[allow(deprecated)]
pub async fn spawn_frontier_tasks<RuntimeApi, Executor>(
task_manager: &TaskManager,
client: Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
Expand Down
2 changes: 2 additions & 0 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
use futures::FutureExt;
use sc_client_api::Backend;
use sc_consensus::ImportQueue;
#[allow(deprecated)]
use sc_executor::{
HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
};
Expand Down Expand Up @@ -73,6 +74,7 @@ impl sc_executor::NativeExecutionDispatch for ParachainNativeExecutor {
}
}

#[allow(deprecated)]
type ParachainExecutor = NativeElseWasmExecutor<ParachainNativeExecutor>;

type ParachainClient = TFullClient<Block, RuntimeApi, ParachainExecutor>;
Expand Down
1 change: 0 additions & 1 deletion pallets/asset-metadata-extender/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ pub use types::*;
pub use weights::WeightInfo;

#[frame_support::pallet]
#[allow(clippy::manual_inspect)]
pub mod pallet {
use super::*;

Expand Down
1 change: 0 additions & 1 deletion pallets/laos-evolution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ pub use types::*;
pub use weights::WeightInfo;

#[frame_support::pallet]
#[allow(clippy::manual_inspect)]
pub mod pallet {
use super::*;

Expand Down
1 change: 0 additions & 1 deletion pallets/parachain-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ pub use types::*;
pub use RoundIndex;

#[pallet]
#[allow(clippy::manual_inspect)]
pub mod pallet {
use crate::{
delegation_requests::{CancelledScheduledRequest, DelegationAction, ScheduledRequest},
Expand Down
1 change: 0 additions & 1 deletion pallets/parachain-staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ fn geneses() {

#[allow(unused_imports)]
#[frame_support::pallet]
#[allow(clippy::manual_inspect)]
pub(crate) mod block_author {
use super::*;
use frame_support::{pallet_prelude::*, traits::Get};
Expand Down
5 changes: 1 addition & 4 deletions pallets/parachain-staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4833,8 +4833,6 @@ fn deferred_payment_and_at_stake_storage_items_cleaned_up_for_candidates_not_pro

#[test]
fn deferred_payment_steady_state_event_flow() {
use frame_support::traits::{Currency, ExistenceRequirement, WithdrawReasons};

// this test "flows" through a number of rounds, asserting that certain things do/don't happen
// once the staking pallet is in a "steady state" (specifically, once we are past the first few
// rounds to clear RewardPaymentDelay)
Expand Down Expand Up @@ -4886,8 +4884,7 @@ fn deferred_payment_steady_state_event_flow() {
let reset_issuance = || {
let new_issuance = Balances::total_issuance();
let diff = new_issuance - initial_issuance;
let _ =
Balances::burn(Some(111).into(), diff, false).expect("Account can absorb burn");
Balances::burn(Some(111).into(), diff, false).expect("Account can absorb burn");
};

// fn to roll through the first RewardPaymentDelay rounds. returns new round index
Expand Down
1 change: 0 additions & 1 deletion pallets/precompiles-benchmark/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub mod weights;
pub use weights::WeightInfo;

#[frame_support::pallet]
#[allow(clippy::manual_inspect)]
pub mod pallet {
use crate::*;

Expand Down
3 changes: 1 addition & 2 deletions runtime/laos/src/configs/treasury.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use super::collective::CouncilMajority;
use crate::{
currency::UNIT, weights, AccountId, Balance, Balances, BlockNumber, Permill, Runtime,
RuntimeEvent, Treasury,
weights, AccountId, Balance, Balances, BlockNumber, Permill, Runtime, RuntimeEvent, Treasury,
};
use frame_support::{
parameter_types,
Expand Down
19 changes: 18 additions & 1 deletion runtime/laos/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,22 @@
// along with LAOS. If not, see <http://www.gnu.org/licenses/>.

use crate::Runtime;
use cumulus_primitives_core::{ListChannelInfos, ParaId};
use sp_std::vec::Vec;

pub type Migrations = (cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4<Runtime>,);
pub type Migrations = (
cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4<Runtime>,
cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5<Runtime>,
);

impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime {
type ChannelList = EmptyChannelList;
}

pub struct EmptyChannelList;
impl ListChannelInfos for EmptyChannelList {
fn outgoing_channels() -> Vec<ParaId> {
// No outgoing channels
Vec::new()
}
}
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "stable"
channel = "1.77"
components = [ "rustfmt", "clippy", "rust-src" ]
targets = [ "wasm32-unknown-unknown" ]
profile = "minimal"

0 comments on commit 43737f3

Please sign in to comment.