Skip to content

Commit

Permalink
deps: update substrate to polkadot-v1.9.0 (#1353)
Browse files Browse the repository at this point in the history
* deps: update substrate to polkadot-v1.9.0

* fix tests
  • Loading branch information
koushiro authored Mar 25, 2024
1 parent 98a3cc6 commit f68f4c6
Show file tree
Hide file tree
Showing 11 changed files with 539 additions and 491 deletions.
849 changes: 441 additions & 408 deletions Cargo.lock

Large diffs are not rendered by default.

142 changes: 71 additions & 71 deletions Cargo.toml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions client/rpc/src/eth/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ where
|error| sp_api::ApiError::FailedToDecodeReturnValue {
function: "EthereumRuntimeRPCApi_call",
error,
raw: r
},
)
})
Expand All @@ -276,6 +277,7 @@ where
|error| sp_api::ApiError::FailedToDecodeReturnValue {
function: "EthereumRuntimeRPCApi_call",
error,
raw: r
},
)
})
Expand Down
6 changes: 3 additions & 3 deletions frame/base-fee/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

use frame_support::{
assert_ok,
assert_ok, derive_impl,
dispatch::DispatchClass,
parameter_types,
traits::{ConstU32, OnFinalize},
Expand All @@ -35,9 +35,9 @@ use crate::BaseFeeThreshold as BaseFeeThresholdT;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0));
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
Expand Down
4 changes: 3 additions & 1 deletion frame/dynamic-fee/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use super::*;
use crate as pallet_dynamic_fee;

use frame_support::{
assert_ok, parameter_types,
assert_ok, derive_impl, parameter_types,
traits::{ConstU32, OnFinalize, OnInitialize},
weights::Weight,
};
Expand All @@ -42,6 +42,8 @@ parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0));
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
Expand Down
3 changes: 2 additions & 1 deletion frame/ethereum/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use ethereum::{TransactionAction, TransactionSignature};
use rlp::RlpStream;
// Substrate
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, FindAuthor},
weights::Weight,
ConsensusEngineId, PalletId,
Expand Down Expand Up @@ -53,6 +53,7 @@ parameter_types! {
pub const BlockHashCount: u64 = 250;
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
Expand Down
4 changes: 3 additions & 1 deletion frame/evm/precompile/dispatch/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Test mock for unit tests and benchmarking

use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, FindAuthor},
weights::Weight,
ConsensusEngineId,
Expand Down Expand Up @@ -48,6 +48,8 @@ parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0));
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
Expand Down
4 changes: 3 additions & 1 deletion frame/evm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Test mock for unit tests and benchmarking

use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, FindAuthor},
weights::Weight,
};
Expand Down Expand Up @@ -48,6 +48,8 @@ parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0));
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
Expand Down
4 changes: 3 additions & 1 deletion frame/hotfix-sufficients/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use frame_support::{parameter_types, traits::ConstU32, weights::Weight};
use frame_support::{derive_impl, parameter_types, traits::ConstU32, weights::Weight};
use sp_core::{H160, H256};
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
Expand Down Expand Up @@ -44,6 +44,8 @@ parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0));
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
Expand Down
5 changes: 4 additions & 1 deletion precompiles/tests-external/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
use std::{cell::RefCell, rc::Rc};

// Substrate
use frame_support::{construct_runtime, parameter_types, traits::Everything, weights::Weight};
use frame_support::{
construct_runtime, derive_impl, parameter_types, traits::Everything, weights::Weight,
};
use sp_core::{H160, H256, U256};
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
Expand Down Expand Up @@ -58,6 +60,7 @@ parameter_types! {
pub const SS58Prefix: u8 = 42;
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = Everything;
Expand Down
7 changes: 4 additions & 3 deletions template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use sp_runtime::{
IdentityLookup, NumberFor, One, PostDispatchInfoOf, UniqueSaturatedInto, Verify,
},
transaction_validity::{TransactionSource, TransactionValidity, TransactionValidityError},
ApplyExtrinsicResult, ConsensusEngineId, Perbill, Permill,
ApplyExtrinsicResult, ConsensusEngineId, ExtrinsicInclusionMode, Perbill, Permill,
};
use sp_std::{marker::PhantomData, prelude::*};
use sp_version::RuntimeVersion;
Expand All @@ -35,6 +35,7 @@ use frame_support::weights::constants::ParityDbWeight as RuntimeDbWeight;
#[cfg(feature = "with-rocksdb-weights")]
use frame_support::weights::constants::RocksDbWeight as RuntimeDbWeight;
use frame_support::{
derive_impl,
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
traits::{ConstBool, ConstU32, ConstU8, FindAuthor, OnFinalize, OnTimestampSet},
Expand Down Expand Up @@ -165,7 +166,7 @@ parameter_types! {
}

// Configure FRAME pallets to include in runtime.

#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
/// The ubiquitous event type.
type RuntimeEvent = RuntimeEvent;
Expand Down Expand Up @@ -602,7 +603,7 @@ impl_runtime_apis! {
Executive::execute_block(block)
}

fn initialize_block(header: &<Block as BlockT>::Header) {
fn initialize_block(header: &<Block as BlockT>::Header) -> ExtrinsicInclusionMode {
Executive::initialize_block(header)
}
}
Expand Down

0 comments on commit f68f4c6

Please sign in to comment.