Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion for #8615: enrich metadata with type information #3336

Merged
merged 173 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from 169 commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
ff5b8b9
Use beefy branch with scale-info
ascjones May 13, 2021
62dcbe0
Add patches
ascjones May 13, 2021
5e3cd0b
Sprinkle some TypeInfo derives
ascjones May 24, 2021
8ecca4b
Merge branch 'master' into aj-metadata-vnext
ascjones May 24, 2021
897847d
Add some TypeInfo deriv
ascjones Jun 11, 2021
f7f3eba
Merge branch 'master' into aj-metadata-vnext
ascjones Jun 11, 2021
31269db
Cargo.lock
ascjones Jun 11, 2021
af119a8
Derive TypeInfo and skip type params for Xcm types
ascjones Jun 17, 2021
953533d
Merge branch 'master' into aj-metadata-vnext
ascjones Jun 17, 2021
e746c9a
Merge branch 'master' into aj-metadata-vnext
ascjones Jun 17, 2021
55509f8
Cargo.lock
ascjones Jun 17, 2021
fa28059
Fix up scale_info bounds attributes
ascjones Jun 17, 2021
8be661f
Fix up dependencies
ascjones Jun 17, 2021
413d606
Use my own beefy-primitives branch
ascjones Jun 17, 2021
d00852d
Bump BEEFY
adoerr Jun 18, 2021
8efad79
Update patches
ascjones Jun 18, 2021
75f7259
Add some scale-info dependencies and TypeInfo derives
ascjones Jun 18, 2021
5373fe0
Merge branch 'master' into aj-metadata-vnext
ascjones Jun 18, 2021
60f0b98
Merge branch 'ad-bump-beefy' into aj-metadata-vnext
ascjones Jun 18, 2021
b588518
More TypeInfo decoration
ascjones Jun 21, 2021
f25a62e
Merge branch 'master' into aj-metadata-vnext
ascjones Jun 21, 2021
3a33f24
Update scale-info
ascjones Jun 21, 2021
470d72f
Some TypeInfos and remove more Event pallet::metadata
ascjones Jun 21, 2021
62c3c38
Moar TypeInfos
ascjones Jun 21, 2021
c899599
TypeInfos galore, fix up metadata runtime API
ascjones Jun 21, 2021
ae1d656
TypeInfo
ascjones Jun 21, 2021
a769ca5
TypeInfos, update other runtime metadata APIs
ascjones Jun 21, 2021
f1cce46
Fix up Kusama, comment out some `usize` QueueSize parameter types
ascjones Jun 21, 2021
eec770f
Remove local diener patches
ascjones Jun 21, 2021
62574a1
Cargo.lock
ascjones Jun 21, 2021
4e129e9
Merge branch 'master' into aj-metadata-vnext
ascjones Jun 22, 2021
5f0f394
Cargo.lock
ascjones Jun 22, 2021
f9e09ad
Merge branch 'master' into aj-metadata-vnext
ascjones Jun 22, 2021
2d9c1fc
Merge branch 'master' into aj-metadata-vnext
ascjones Jun 23, 2021
f7528a1
Merge branch 'master' into aj-metadata-vnext
ascjones Jul 1, 2021
a6862c6
Update to scale-info crates.io release
ascjones Jul 1, 2021
ea8e22e
Update primitive-types branch
ascjones Jul 1, 2021
9bb3b6c
Update pallet-beefy to use custom branch
ascjones Jul 1, 2021
7b86936
Update other parity-common deps
ascjones Jul 1, 2021
fa73046
Update parity-common patches
ascjones Jul 1, 2021
1d6f032
bump a bunch of deps in parity-common
ordian Jul 2, 2021
2bd1990
Merge remote-tracking branch 'origin/ao-bump-common' into aj-metadata…
ascjones Jul 5, 2021
9cecc0b
Remove parity-common patches
ascjones Jul 5, 2021
1c2ff15
Bump finality-grandpa version
ascjones Jul 5, 2021
1c2ee46
Merge branch 'master' into aj-metadata-vnext
ascjones Jul 5, 2021
c231e94
Merge branch 'master' into aj-metadata-vnext
ascjones Jul 6, 2021
2a755df
Cargo.lock
ascjones Jul 6, 2021
5499db4
Update scale-info to 0.9.1
ascjones Jul 6, 2021
77cce3e
Add recursion_limit for runtime-parachains
ascjones Jul 6, 2021
1107735
Add some scale_info attributes
ascjones Jul 6, 2021
8d66ce5
Merge branch 'master' into aj-metadata-vnext
ascjones Jul 7, 2021
5e5294d
Cargo.lock
ascjones Jul 7, 2021
a51a955
Merge branch 'master' into aj-metadata-vnext
ascjones Jul 9, 2021
1292b75
Revert finality-grandpa bump
ascjones Jul 9, 2021
e2aa670
Cargo.lock, scale-info update
ascjones Jul 9, 2021
58474e8
Merge branch 'master' into aj-metadata-vnext
ascjones Jul 12, 2021
cdcd546
Merge branch 'master' into aj-metadata-vnext
ascjones Jul 27, 2021
f4b02d2
cargo update
ascjones Jul 27, 2021
7e7d804
Make sure using patched version of finality-grandpa
ascjones Jul 28, 2021
3e64870
Use patched scale-info
ascjones Jul 28, 2021
5554974
Update to scale-info 0.10.0
ascjones Jul 29, 2021
6ff0177
Update finality-grandpa
ascjones Jul 29, 2021
3341b13
Merge branch 'master' into aj-metadata-vnext
ascjones Jul 29, 2021
f975429
Cargo.lock
ascjones Jul 29, 2021
db49516
Update beefy deps
ascjones Jul 29, 2021
7dc7788
Update beefy deps again
ascjones Jul 29, 2021
3b7934a
Add scale-info dependency
ascjones Jul 29, 2021
a308780
Remove deprecated pallet::metadata attributes.
ascjones Jul 29, 2021
97ea3a4
Add some missing scale-info deps and derives
ascjones Jul 29, 2021
d36007f
Use some variant struct call syntax
ascjones Jul 29, 2021
4dec4e9
Add missing TypeInfo impl
ascjones Jul 29, 2021
bfecda4
Add some more TypeInfo impls
ascjones Jul 29, 2021
56d3ccf
Convert some call enum struct variant constructors
ascjones Jul 29, 2021
b999aad
More scale-info deps and derives
ascjones Jul 29, 2021
9f39452
Call enum struct variants
ascjones Jul 29, 2021
2758423
TypeInfo derives
ascjones Jul 29, 2021
d64b309
Call enum variant structs
ascjones Jul 29, 2021
0d933df
scale-info deps and derives
ascjones Jul 29, 2021
7f1b8ab
Call enum variant struct constructors
ascjones Jul 29, 2021
63bba5e
Use beefy-primitives scale-info feature
ascjones Jul 30, 2021
d582508
Use grandpa-bridge-gadget master branch
ascjones Jul 30, 2021
ae01899
Remove finality-grandpa patch
ascjones Jul 30, 2021
7058c63
Merge branch 'master' into aj-metadata-vnext
ascjones Jul 30, 2021
816bbce
Add missing scale_info dependency and derive
ascjones Jul 30, 2021
4689c22
Fix up some call variant constructors
ascjones Jul 30, 2021
5d9c506
Add missing scale_info dependency
ascjones Jul 30, 2021
f6a10b8
Fix some test errors
ascjones Jul 30, 2021
e50a25e
More TypeInfo derives
ascjones Jul 30, 2021
276ef25
More call variant structs
ascjones Jul 30, 2021
3583683
Call variant structs in tests
ascjones Aug 2, 2021
9610ecd
Cargo.lock
ascjones Aug 2, 2021
e99a888
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 2, 2021
0dda53e
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 2, 2021
3f02ac1
Fmt
ascjones Aug 2, 2021
1ecb559
Fix more call struct variants
ascjones Aug 2, 2021
42f7c57
Another call struct variant
ascjones Aug 2, 2021
5d75d24
add scale-info/std features explicitly
gui1117 Aug 2, 2021
f8317fb
More call struct variants
ascjones Aug 2, 2021
f89da00
Add missing scale-info dependency
ascjones Aug 2, 2021
7d1a63e
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 2, 2021
5039f0d
Fmt
ascjones Aug 2, 2021
a6819eb
review: activate scale-info/std where missing
ascjones Aug 2, 2021
fc36843
Merge remote-tracking branch 'origin/aj-metadata-vnext' into aj-metad…
ascjones Aug 2, 2021
f83f91a
Remove some duplicate std feature activation
ascjones Aug 2, 2021
80a5467
review: add scale_info bounds() attr
ascjones Aug 2, 2021
e70b2a3
More call variant structs
ascjones Aug 2, 2021
03c1a50
Remove recursion limit
ascjones Aug 2, 2021
8f5d219
Update beefy-primitives
ascjones Aug 3, 2021
de4e971
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 3, 2021
d3992ce
Update beefy-primitives
ascjones Aug 3, 2021
b95be0f
Fix simnet call variant struct errors
ascjones Aug 3, 2021
96e1b2c
Fmt
ascjones Aug 3, 2021
becb2e5
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 3, 2021
93602b2
cargo update -p beefy-primitives
ascjones Aug 3, 2021
78ce022
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 4, 2021
f69894a
Add some missing TypeInfo derives
ascjones Aug 4, 2021
38213d2
Fix some call variants
ascjones Aug 4, 2021
d0199c2
Fix some call variant underscores
ascjones Aug 4, 2021
062c9e7
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 4, 2021
ea3335c
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 4, 2021
c2768f7
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 5, 2021
5deb24b
Cargo.lock
ascjones Aug 5, 2021
90fb002
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 6, 2021
c50bf5d
Cargo.lock
ascjones Aug 6, 2021
bd56a24
Add missing TypeInfo derive
ascjones Aug 6, 2021
cfb5f69
Add some more missing TypeInfo derives
ascjones Aug 6, 2021
8e4d383
Even more missing TypeInfo derives
ascjones Aug 6, 2021
9fa06ea
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 6, 2021
0bcefab
Add TypeInfo derives to new xcm types
ascjones Aug 6, 2021
fa3931e
Fmt
ascjones Aug 6, 2021
54cb9ba
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 23, 2021
82b5340
Cargo.lock
ascjones Aug 23, 2021
1b99947
Add missing TypeInfo impls
ascjones Aug 23, 2021
48f04b7
Cargo.lock
ascjones Aug 23, 2021
31b36a8
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 24, 2021
1085da2
More missing TypeInfos
ascjones Aug 24, 2021
33f4f5b
Fixes
ascjones Aug 24, 2021
2a59367
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 24, 2021
8376552
Cargo.lock
ascjones Aug 24, 2021
329d6ab
Merge branch 'master' into aj-metadata-vnext
ascjones Aug 31, 2021
7609117
Cargo.lock
ascjones Aug 31, 2021
2d86864
Add TypeInfo impls to xcm v2
ascjones Aug 31, 2021
cd0b6f1
Merge branch 'master' into aj-metadata-vnext
ascjones Sep 1, 2021
4254a2a
Update to scale-info 1.0
ascjones Sep 1, 2021
01dd50a
Update finality-grandpa 0.14.4, patch for now
ascjones Sep 1, 2021
66b4953
Update beefy
ascjones Sep 1, 2021
4b088de
Remove patched finality-grandpa
ascjones Sep 2, 2021
066e7c1
Merge branch 'master' into aj-metadata-vnext
ascjones Sep 2, 2021
987a8e2
Add TypeInfo impl to Outcome
ascjones Sep 2, 2021
1868fdd
Fixes
ascjones Sep 2, 2021
8134211
Call variant struct
ascjones Sep 2, 2021
61aead4
Call variant struct
ascjones Sep 2, 2021
5b0327c
Fix test
ascjones Sep 2, 2021
e14c03a
Merge branch 'master' into aj-metadata-vnext
ascjones Sep 3, 2021
6b5a233
Add TypeInfo impl
ascjones Sep 3, 2021
86cd1b4
Merge branch 'master' into aj-metadata-vnext
ascjones Sep 3, 2021
972da56
Merge branch 'master' into aj-metadata-vnext
ascjones Sep 6, 2021
ae7d99e
Cargo.lock
ascjones Sep 6, 2021
3ad7a4b
Merge branch 'master' into aj-metadata-vnext
ascjones Sep 7, 2021
b07f0e6
Merge branch 'master' into aj-metadata-vnext
ascjones Sep 9, 2021
d742982
Cargo.lock
ascjones Sep 9, 2021
547235a
Merge branch 'master' into aj-metadata-vnext
ascjones Sep 13, 2021
78dd90f
Merge branch 'master' into aj-metadata-vnext
ascjones Sep 15, 2021
1ee2d23
Cargo.lock
ascjones Sep 15, 2021
97c92a0
Merge branch 'master' into aj-metadata-vnext
ascjones Sep 15, 2021
3228678
git checkout master Cargo.lock
ascjones Sep 15, 2021
00367d8
update Substrate
Sep 15, 2021
53dfa46
Add missing scale-info features for beefy-primitives
ascjones Sep 15, 2021
c86a008
Merge branch 'aj-metadata-vnext' of github.com:paritytech/polkadot in…
ascjones Sep 15, 2021
da2054d
Fmt
bkchr Sep 15, 2021
f512c86
Remove check for now
bkchr Sep 15, 2021
00a0187
Update beefy-primitives, removes scale-info feature
ascjones Sep 15, 2021
ff5e6b7
Update beefy-primitives again
ascjones Sep 15, 2021
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
407 changes: 246 additions & 161 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bridges/bin/millau/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ impl_runtime_apis! {

impl sp_api::Metadata<Block> for Runtime {
fn metadata() -> OpaqueMetadata {
Runtime::metadata().into()
OpaqueMetadata::new(Runtime::metadata().into())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those change will need to be applied in https://github.com/paritytech/parity-bridges-common too
cc @HCastano

Copy link
Contributor

@HCastano HCastano Aug 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I can approve here in order to make the checks happy, but for a proper review of the bridges integration please open a PR in parity-bridges-common (@ascjones)

}
}

Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/rialto/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ impl_runtime_apis! {

impl sp_api::Metadata<Block> for Runtime {
fn metadata() -> OpaqueMetadata {
Runtime::metadata().into()
OpaqueMetadata::new(Runtime::metadata().into())
}
}

Expand Down
3 changes: 3 additions & 0 deletions bridges/bin/runtime-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
ed25519-dalek = { version = "1.0", default-features = false, optional = true }
hash-db = { version = "0.15.2", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }

# Bridge dependencies

Expand Down Expand Up @@ -40,10 +41,12 @@ std = [
"codec/std",
"frame-support/std",
"hash-db/std",
"scale-info/std",
"pallet-bridge-dispatch/std",
"pallet-bridge-grandpa/std",
"pallet-bridge-messages/std",
"pallet-transaction-payment/std",
"scale-info/std",
"sp-core/std",
"sp-runtime/std",
"sp-state-machine/std",
Expand Down
5 changes: 3 additions & 2 deletions bridges/bin/runtime-common/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use frame_support::{
RuntimeDebug,
};
use hash_db::Hasher;
use scale_info::TypeInfo;
use sp_runtime::{
traits::{AtLeast32BitUnsigned, CheckedAdd, CheckedDiv, CheckedMul},
FixedPointNumber, FixedPointOperand, FixedU128,
Expand Down Expand Up @@ -200,7 +201,7 @@ pub mod source {
/// - hash of finalized header;
/// - storage proof of inbound lane state;
/// - lane id.
#[derive(Clone, Decode, Encode, Eq, PartialEq, RuntimeDebug)]
#[derive(Clone, Decode, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)]
pub struct FromBridgedChainMessagesDeliveryProof<BridgedHeaderHash> {
/// Hash of the bridge header the proof is for.
pub bridged_header_hash: BridgedHeaderHash,
Expand Down Expand Up @@ -431,7 +432,7 @@ pub mod target {
/// - storage proof of messages and (optionally) outbound lane state;
/// - lane id;
/// - nonces (inclusive range) of messages which are included in this proof.
#[derive(Clone, Decode, Encode, Eq, PartialEq, RuntimeDebug)]
#[derive(Clone, Decode, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)]
pub struct FromBridgedChainMessagesProof<BridgedHeaderHash> {
/// Hash of the finalized bridged header the proof is for.
pub bridged_header_hash: BridgedHeaderHash,
Expand Down
2 changes: 1 addition & 1 deletion bridges/fuzz/storage-proof/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0" }
finality-grandpa = "0.14.0"
finality-grandpa = "0.14.4"
hash-db = "0.15.2"
honggfuzz = "0.5.54"
log = "0.4.0"
Expand Down
3 changes: 3 additions & 0 deletions bridges/modules/dispatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
log = { version = "0.4.14", default-features = false }

# Bridge dependencies
Expand All @@ -32,9 +33,11 @@ default = ["std"]
std = [
"bp-message-dispatch/std",
"bp-runtime/std",
"codec/std",
"frame-support/std",
"frame-system/std",
"log/std",
"scale-info/std",
"sp-core/std",
"sp-runtime/std",
"sp-std/std",
Expand Down
51 changes: 30 additions & 21 deletions bridges/modules/dispatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ mod tests {
use super::*;
use frame_support::{dispatch::GetDispatchInfo, parameter_types, weights::Weight};
use frame_system::{EventRecord, Phase};
use scale_info::TypeInfo;
use sp_core::H256;
use sp_runtime::{
testing::Header,
Expand All @@ -412,7 +413,7 @@ mod tests {
const SOURCE_CHAIN_ID: ChainId = *b"srce";
const TARGET_CHAIN_ID: ChainId = *b"trgt";

#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq)]
#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
pub struct TestAccountPublic(AccountId);

impl IdentifyAccount for TestAccountPublic {
Expand All @@ -423,7 +424,7 @@ mod tests {
}
}

#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq)]
#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
pub struct TestSignature(AccountId);

impl Verify for TestSignature {
Expand Down Expand Up @@ -516,7 +517,7 @@ mod tests {

impl Contains<Call> for TestCallFilter {
fn contains(call: &Call) -> bool {
!matches!(*call, Call::System(frame_system::Call::fill_block(_)))
!matches!(*call, Call::System(frame_system::Call::fill_block { .. }))
}
}

Expand Down Expand Up @@ -569,8 +570,9 @@ mod tests {
let id = [0; 4];

const BAD_SPEC_VERSION: SpecVersion = 99;
let mut message =
prepare_root_message(Call::System(<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3])));
let mut message = prepare_root_message(Call::System(frame_system::Call::<TestRuntime>::remark {
remark: vec![1, 2, 3],
}));
let weight = message.weight;
message.spec_version = BAD_SPEC_VERSION;

Expand Down Expand Up @@ -599,7 +601,7 @@ mod tests {
fn should_fail_on_weight_mismatch() {
new_test_ext().execute_with(|| {
let id = [0; 4];
let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3]));
let call = Call::System(frame_system::Call::<TestRuntime>::remark { remark: vec![1, 2, 3] });
let call_weight = call.get_dispatch_info().weight;
let mut message = prepare_root_message(call);
message.weight = 7;
Expand Down Expand Up @@ -637,7 +639,7 @@ mod tests {
let call_origin = CallOrigin::TargetAccount(1, TestAccountPublic(1), TestSignature(99));
let message = prepare_message(
call_origin,
Call::System(<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3])),
Call::System(frame_system::Call::<TestRuntime>::remark { remark: vec![1, 2, 3] }),
);
let weight = message.weight;

Expand Down Expand Up @@ -687,8 +689,9 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];

let mut message =
prepare_root_message(Call::System(<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3])));
let mut message = prepare_root_message(Call::System(frame_system::Call::<TestRuntime>::remark {
remark: vec![1, 2, 3],
}));
let weight = message.weight;
message.call.0 = vec![];

Expand Down Expand Up @@ -716,7 +719,9 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];

let call = Call::System(<frame_system::Call<TestRuntime>>::fill_block(Perbill::from_percent(75)));
let call = Call::System(frame_system::Call::<TestRuntime>::fill_block {
ratio: Perbill::from_percent(75),
});
let weight = call.get_dispatch_info().weight;
let mut message = prepare_root_message(call);
message.weight = weight;
Expand Down Expand Up @@ -745,8 +750,9 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];

let mut message =
prepare_root_message(Call::System(<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3])));
let mut message = prepare_root_message(Call::System(frame_system::Call::<TestRuntime>::remark {
remark: vec![1, 2, 3],
}));
let weight = message.weight;
message.dispatch_fee_payment = DispatchFeePayment::AtTargetChain;

Expand Down Expand Up @@ -779,8 +785,9 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];

let mut message =
prepare_root_message(Call::System(<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3])));
let mut message = prepare_root_message(Call::System(frame_system::Call::<TestRuntime>::remark {
remark: vec![1, 2, 3],
}));
message.dispatch_fee_payment = DispatchFeePayment::AtTargetChain;

System::set_block_number(1);
Expand Down Expand Up @@ -808,7 +815,7 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];

let call = Call::System(<frame_system::Call<TestRuntime>>::set_heap_pages(1));
let call = Call::System(frame_system::Call::<TestRuntime>::set_heap_pages { pages: 1 });
let message = prepare_target_message(call);

System::set_block_number(1);
Expand All @@ -835,7 +842,9 @@ mod tests {
fn should_dispatch_bridge_message_from_root_origin() {
new_test_ext().execute_with(|| {
let id = [0; 4];
let message = prepare_root_message(Call::System(<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3])));
let message = prepare_root_message(Call::System(frame_system::Call::<TestRuntime>::remark {
remark: vec![1, 2, 3],
}));

System::set_block_number(1);
let result = Dispatch::dispatch(SOURCE_CHAIN_ID, TARGET_CHAIN_ID, id, Ok(message), |_, _| unreachable!());
Expand All @@ -862,7 +871,7 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];

let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![]));
let call = Call::System(frame_system::Call::<TestRuntime>::remark { remark: vec![] });
let message = prepare_target_message(call);

System::set_block_number(1);
Expand Down Expand Up @@ -890,7 +899,7 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];

let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![]));
let call = Call::System(frame_system::Call::<TestRuntime>::remark { remark: vec![] });
let message = prepare_source_message(call);

System::set_block_number(1);
Expand All @@ -915,7 +924,7 @@ mod tests {

#[test]
fn origin_is_checked_when_verifying_sending_message_using_source_root_account() {
let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![]));
let call = Call::System(frame_system::Call::<TestRuntime>::remark { remark: vec![] });
let message = prepare_root_message(call);

// When message is sent by Root, CallOrigin::SourceRoot is allowed
Expand All @@ -930,7 +939,7 @@ mod tests {

#[test]
fn origin_is_checked_when_verifying_sending_message_using_target_account() {
let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![]));
let call = Call::System(frame_system::Call::<TestRuntime>::remark { remark: vec![] });
let message = prepare_target_message(call);

// When message is sent by Root, CallOrigin::TargetAccount is not allowed
Expand All @@ -955,7 +964,7 @@ mod tests {

#[test]
fn origin_is_checked_when_verifying_sending_message_using_source_account() {
let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![]));
let call = Call::System(frame_system::Call::<TestRuntime>::remark { remark: vec![] });
let message = prepare_source_message(call);

// Sending a message from the expected origin account works
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/ethereum-contract-builtin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0" }
ethereum-types = "0.11.0"
finality-grandpa = "0.14.1"
finality-grandpa = "0.14.4"
hex = "0.4"
log = "0.4.14"

Expand Down
4 changes: 3 additions & 1 deletion bridges/modules/grandpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
finality-grandpa = { version = "0.14.1", default-features = false }
finality-grandpa = { version = "0.14.4", default-features = false }
log = { version = "0.4.14", default-features = false }
num-traits = { version = "0.2", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
serde = { version = "1.0", optional = true }

# Bridge Dependencies
Expand Down Expand Up @@ -47,6 +48,7 @@ std = [
"frame-system/std",
"log/std",
"num-traits/std",
"scale-info/std",
"serde",
"sp-finality-grandpa/std",
"sp-runtime/std",
Expand Down
2 changes: 2 additions & 0 deletions bridges/modules/messages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ bitvec = { version = "0.20", default-features = false, features = ["alloc"] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
log = { version = "0.4.14", default-features = false }
num-traits = { version = "0.2", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true, features = ["derive"] }

# Bridge dependencies
Expand Down Expand Up @@ -47,6 +48,7 @@ std = [
"frame-system/std",
"log/std",
"num-traits/std",
"scale-info/std",
"serde",
"sp-core/std",
"sp-runtime/std",
Expand Down
9 changes: 5 additions & 4 deletions bridges/modules/messages/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use bp_messages::{
use bp_runtime::{messages::MessageDispatchResult, Size};
use codec::{Decode, Encode};
use frame_support::{parameter_types, weights::Weight};
use scale_info::TypeInfo;
use sp_core::H256;
use sp_runtime::{
testing::Header as SubstrateHeader,
Expand All @@ -42,7 +43,7 @@ use std::collections::BTreeMap;

pub type AccountId = u64;
pub type Balance = u64;
#[derive(Decode, Encode, Clone, Debug, PartialEq, Eq)]
#[derive(Decode, Encode, Clone, Debug, PartialEq, Eq, TypeInfo)]
pub struct TestPayload {
/// Field that may be used to identify messages.
pub id: u64,
Expand Down Expand Up @@ -138,7 +139,7 @@ parameter_types! {
pub storage TokenConversionRate: FixedU128 = 1.into();
}

#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)]
#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq, TypeInfo)]
pub enum TestMessagesParameter {
TokenConversionRate(FixedU128),
}
Expand Down Expand Up @@ -211,7 +212,7 @@ pub const PAYLOAD_REJECTED_BY_TARGET_CHAIN: TestPayload = message_payload(1, 50)
pub type MessagesByLaneVec = Vec<(LaneId, ProvedLaneMessages<Message<TestMessageFee>>)>;

/// Test messages proof.
#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq)]
#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
pub struct TestMessagesProof {
pub result: Result<MessagesByLaneVec, ()>,
}
Expand Down Expand Up @@ -242,7 +243,7 @@ impl From<Result<Vec<Message<TestMessageFee>>, ()>> for TestMessagesProof {
}

/// Messages delivery proof used in tests.
#[derive(Debug, Encode, Decode, Eq, Clone, PartialEq)]
#[derive(Debug, Encode, Decode, Eq, Clone, PartialEq, TypeInfo)]
pub struct TestMessagesDeliveryProof(pub Result<(LaneId, InboundLaneData<TestRelayer>), ()>);

impl Size for TestMessagesDeliveryProof {
Expand Down
2 changes: 1 addition & 1 deletion bridges/primitives/chain-millau/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fixed-hash = { version = "0.7.0", default-features = false }
hash256-std-hasher = { version = "0.15.2", default-features = false }
impl-codec = { version = "0.5.1", default-features = false }
impl-serde = { version = "0.3.1", optional = true }
parity-util-mem = { version = "0.9.0", default-features = false, features = ["primitive-types"] }
parity-util-mem = { version = "0.10.0", default-features = false, features = ["primitive-types"] }
serde = { version = "1.0.101", optional = true, features = ["derive"] }

# Substrate Based Dependencies
Expand Down
4 changes: 3 additions & 1 deletion bridges/primitives/header-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
finality-grandpa = { version = "0.14.1", default-features = false }
finality-grandpa = { version = "0.14.4", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
serde = { version = "1.0", optional = true }

# Substrate Dependencies
Expand All @@ -28,6 +29,7 @@ default = ["std"]
std = [
"codec/std",
"finality-grandpa/std",
"scale-info/std",
"serde/std",
"frame-support/std",
"sp-core/std",
Expand Down
Loading