Update to latest substrate (#723)

* Bump substrate deps.

* Bump scale.

* Bump ethabi.

* Remove inherent from aura.

* Migrate to construct_runtime

* cargo fmt --all
This commit is contained in:
Tomasz Drwięga
2021-02-16 07:10:01 +01:00
committed by Bastian Köcher
parent 32342bf6e5
commit 7aa51f8d30
41 changed files with 198 additions and 160 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
num-traits = { version = "0.2", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
+5 -5
View File
@@ -821,9 +821,9 @@ fn verify_and_decode_messages_proof<Chain: SourceHeaderChain<Fee>, Fee, Dispatch
mod tests {
use super::*;
use crate::mock::{
message, run_test, Origin, TestEvent, TestMessageDeliveryAndDispatchPayment, TestMessagesDeliveryProof,
TestMessagesProof, TestPayload, TestRuntime, PAYLOAD_REJECTED_BY_TARGET_CHAIN, REGULAR_PAYLOAD, TEST_LANE_ID,
TEST_RELAYER_A, TEST_RELAYER_B,
message, run_test, Event as TestEvent, Origin, TestMessageDeliveryAndDispatchPayment,
TestMessagesDeliveryProof, TestMessagesProof, TestPayload, TestRuntime, PAYLOAD_REJECTED_BY_TARGET_CHAIN,
REGULAR_PAYLOAD, TEST_LANE_ID, TEST_RELAYER_A, TEST_RELAYER_B,
};
use bp_message_lane::UnrewardedRelayersState;
use frame_support::{assert_noop, assert_ok};
@@ -847,7 +847,7 @@ mod tests {
System::<TestRuntime>::events(),
vec![EventRecord {
phase: Phase::Initialization,
event: TestEvent::message_lane(RawEvent::MessageAccepted(TEST_LANE_ID, 1)),
event: TestEvent::pallet_message_lane(RawEvent::MessageAccepted(TEST_LANE_ID, 1)),
topics: vec![],
}],
);
@@ -876,7 +876,7 @@ mod tests {
System::<TestRuntime>::events(),
vec![EventRecord {
phase: Phase::Initialization,
event: TestEvent::message_lane(RawEvent::MessagesDelivered(TEST_LANE_ID, 1, 1)),
event: TestEvent::pallet_message_lane(RawEvent::MessagesDelivered(TEST_LANE_ID, 1, 1)),
topics: vec![],
}],
);
+18 -20
View File
@@ -25,7 +25,7 @@ use bp_message_lane::{
};
use bp_runtime::Size;
use codec::{Decode, Encode};
use frame_support::{impl_outer_event, impl_outer_origin, parameter_types, weights::Weight};
use frame_support::{parameter_types, weights::Weight};
use sp_core::H256;
use sp_runtime::{
testing::Header as SubstrateHeader,
@@ -49,25 +49,23 @@ impl sp_runtime::traits::Convert<H256, AccountId> for AccountIdConverter {
}
}
#[derive(Clone, Eq, PartialEq, Debug)]
pub struct TestRuntime;
type Block = frame_system::mocking::MockBlock<TestRuntime>;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
mod message_lane {
pub use crate::Event;
}
use crate as pallet_message_lane;
impl_outer_event! {
pub enum TestEvent for TestRuntime {
frame_system<T>,
pallet_balances<T>,
message_lane<T>,
frame_support::construct_runtime! {
pub enum TestRuntime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Module, Call, Event<T>},
MessageLane: pallet_message_lane::{Module, Call, Event<T>},
}
}
impl_outer_origin! {
pub enum Origin for TestRuntime where system = frame_system {}
}
parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = 1024;
@@ -78,17 +76,17 @@ parameter_types! {
impl frame_system::Config for TestRuntime {
type Origin = Origin;
type Index = u64;
type Call = ();
type Call = Call;
type BlockNumber = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
type AccountId = AccountId;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = SubstrateHeader;
type Event = TestEvent;
type Event = Event;
type BlockHashCount = BlockHashCount;
type Version = ();
type PalletInfo = ();
type PalletInfo = PalletInfo;
type AccountData = pallet_balances::AccountData<Balance>;
type OnNewAccount = ();
type OnKilledAccount = ();
@@ -108,7 +106,7 @@ impl pallet_balances::Config for TestRuntime {
type MaxLocks = ();
type Balance = Balance;
type DustRemoval = ();
type Event = TestEvent;
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = frame_system::Module<TestRuntime>;
type WeightInfo = ();
@@ -121,7 +119,7 @@ parameter_types! {
}
impl Config for TestRuntime {
type Event = TestEvent;
type Event = Event;
type WeightInfo = ();
type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce;
type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane;