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

XCM v0 #1657

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
8f6ce0e
Rename XCMP -> Xcmp
gavofyork Aug 25, 2020
6ce0b56
Merge remote-tracking branch 'origin/rococo-branch' into gav-xcmp
gavofyork Aug 26, 2020
4ba8022
WiP: Xcm
gavofyork Aug 29, 2020
7492c3b
Finish up on draft
gavofyork Aug 31, 2020
9658a23
Remove old code, work on getting it all to build.
gavofyork Aug 31, 2020
84d1c55
XCM handler and parachains now build 🎉
gavofyork Aug 31, 2020
0c0796e
Various fixes
gavofyork Sep 4, 2020
a563c53
Fix compilation
bkchr Sep 7, 2020
38656a0
fix tests
shawntabrizi Sep 7, 2020
d8b67f1
Merge branch 'gav-xcmp' of https://github.com/paritytech/polkadot int…
shawntabrizi Sep 7, 2020
9c16e3d
bump parity-scale-codec 1.3.5, fix `dest_` -> `dest`
shawntabrizi Sep 7, 2020
f979fab
remove unused
shawntabrizi Sep 7, 2020
87e2090
Remove defunct code
gavofyork Sep 8, 2020
f672cc6
Merge branch 'gav-xcmp' of github.com:paritytech/polkadot into gav-xcmp
gavofyork Sep 8, 2020
4d2e8d1
Derive `RuntimeDebug` across XCM enums
shawntabrizi Sep 9, 2020
db7aa74
Working
gavofyork Sep 9, 2020
89b3695
More work
gavofyork Sep 9, 2020
3115e1d
Some fixes
bkchr Sep 10, 2020
0dfcd00
Merge branch 'gav-xcmp' into gav-xcmp-working
gavofyork Sep 10, 2020
9dd154b
More work
gavofyork Sep 10, 2020
4163db9
Merge branch 'gav-xcmp-working' of github.com:paritytech/polkadot int…
gavofyork Sep 10, 2020
0566de0
Move interpreter into polkadot, split & repot
gavofyork Sep 10, 2020
a5c0e95
Move interpreter into polkadot, split & repot
gavofyork Sep 10, 2020
fdfabe6
Remove 'static'
gavofyork Sep 10, 2020
fa116b0
Fix toml file
bkchr Sep 10, 2020
10f8641
imports
shawntabrizi Sep 10, 2020
3887848
fix filename
shawntabrizi Sep 10, 2020
b2384b9
some fixes
shawntabrizi Sep 10, 2020
7d158e8
Fix
gavofyork Sep 10, 2020
8743525
Merge branch 'gav-xcmp-working' of github.com:paritytech/polkadot int…
gavofyork Sep 10, 2020
060a337
Fixes
gavofyork Sep 10, 2020
9a4497a
Fixes
gavofyork Sep 10, 2020
ee07247
Fixes
gavofyork Sep 10, 2020
2d9550e
Fixes
gavofyork Sep 10, 2020
3ae493e
Fixes
gavofyork Sep 10, 2020
40a6fb0
Fixes
gavofyork Sep 10, 2020
534b731
Fixes
gavofyork Sep 10, 2020
953a581
Fixes
gavofyork Sep 10, 2020
91f3914
Fixes
gavofyork Sep 10, 2020
ba8bdaa
Fixes
gavofyork Sep 10, 2020
52affef
Fixes
gavofyork Sep 10, 2020
1b1e265
fixes
shawntabrizi Sep 10, 2020
c958d08
Fixes
gavofyork Sep 10, 2020
1a3dc55
remove `frame-system`
shawntabrizi Sep 10, 2020
721a3e9
Fixes
gavofyork Sep 10, 2020
c83ee04
Merge branch 'gav-xcmp-working' of github.com:paritytech/polkadot int…
gavofyork Sep 10, 2020
a6131ae
Fixes
gavofyork Sep 10, 2020
85dee1a
Fixes
gavofyork Sep 10, 2020
4c77f93
fixes for `parachains`
shawntabrizi Sep 10, 2020
22d5321
Merge branch 'gav-xcmp-working' of https://github.com/paritytech/polk…
shawntabrizi Sep 10, 2020
0d37c9b
Fixes
gavofyork Sep 10, 2020
9ccc139
Merge branch 'gav-xcmp-working' of github.com:paritytech/polkadot int…
gavofyork Sep 10, 2020
7a7c958
QueryHolding
gavofyork Sep 10, 2020
a213bd3
`From` instead of `UncheckedFrom`
shawntabrizi Sep 10, 2020
e609000
Initial effort at integrating xcm-executor into Rococo
gavofyork Sep 10, 2020
c25b4b7
Merge branch 'gav-xcmp-working' of github.com:paritytech/polkadot int…
gavofyork Sep 10, 2020
1aeb7c8
Fixes
gavofyork Sep 10, 2020
6080e7b
Fixes
gavofyork Sep 10, 2020
739eeb7
Fixes
gavofyork Sep 10, 2020
9334f62
Fixes
gavofyork Sep 10, 2020
bc01389
Fixes
gavofyork Sep 10, 2020
ec55f0b
Rococo builds! 🎉
gavofyork Sep 10, 2020
6e112c9
Implement Xcm for the unit type
shawntabrizi Sep 10, 2020
b092cd4
Fixes
gavofyork Sep 10, 2020
61a4090
Fixes
gavofyork Sep 10, 2020
7dea1b3
Fixes
gavofyork Sep 10, 2020
758d675
Fixes
gavofyork Sep 10, 2020
aa08941
Fixes
gavofyork Sep 10, 2020
2e8a923
Fixes
gavofyork Sep 10, 2020
3869118
Fixes
gavofyork Sep 11, 2020
eab83fe
Fixes
gavofyork Sep 11, 2020
6565989
Fixes
gavofyork Sep 11, 2020
a388c68
Refactor all the hard logic away.
gavofyork Sep 11, 2020
17a6a16
Fixes
gavofyork Sep 11, 2020
3121739
Fixes
gavofyork Sep 11, 2020
9b39a46
Fixes
gavofyork Sep 11, 2020
3b3ef7c
Broken.
gavofyork Sep 11, 2020
14b36e3
Add `RuntimeDebug` to Assets
shawntabrizi Sep 11, 2020
a6222b2
Fixes
gavofyork Sep 11, 2020
f5143f3
Merge branch 'gav-xcmp' of github.com:paritytech/polkadot into gav-xcmp
gavofyork Sep 11, 2020
87ab207
Fix DepositReserveAsset. Repotting, renaming and docs.
gavofyork Sep 12, 2020
7d572f6
fix networkid export
shawntabrizi Sep 12, 2020
7d1629d
Full docs.
gavofyork Sep 12, 2020
358673b
Merge remote-tracking branch 'origin/gav-xcmp' into gav-xcmp
gavofyork Sep 12, 2020
baa3e74
Polkadot JS Types
shawntabrizi Sep 12, 2020
2ef7c7e
Update types.json
shawntabrizi Sep 12, 2020
f712a36
Fix `RocLocation`
shawntabrizi Sep 12, 2020
b4bc868
Fixes
gavofyork Sep 12, 2020
ccb2c08
Merge branch 'gav-xcmp' of github.com:paritytech/polkadot into gav-xcmp
gavofyork Sep 12, 2020
573df3d
Generate tuples properly.
gavofyork Sep 12, 2020
e19549f
Improve docs
gavofyork Sep 13, 2020
94b96dd
Docs and API tidy
gavofyork Sep 13, 2020
cf02df9
Merge branch 'gav-xcmp' of github.com:paritytech/polkadot into gav-xcmp
gavofyork Sep 13, 2020
a4eeae0
Introduce some error handling (#1709)
shawntabrizi Sep 13, 2020
b60cf99
Fixes
gavofyork Sep 15, 2020
dfa3290
Merge branch 'gav-xcmp' of github.com:paritytech/polkadot into gav-xcmp
gavofyork Sep 15, 2020
3f22946
Fixes
gavofyork Sep 16, 2020
8c86f3f
Fixes
gavofyork Sep 17, 2020
17bacc8
Fixes
gavofyork Sep 17, 2020
e4c31ee
Add result events, logging
gavofyork Sep 17, 2020
33ecb02
Fixes
gavofyork Sep 18, 2020
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
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
shawntabrizi committed Sep 7, 2020
commit 38656a027f8d42ca8e7be46480886687f4773bb4
2 changes: 1 addition & 1 deletion parachain/src/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub mod v0 {
use super::*;

/// Basically just the XCM (more general) version of `ParachainDispatchOrigin`.
#[derive(Clone, Eq, PartialEq, Encode, Decode)]
#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug)]
pub enum MultiOrigin {
/// Origin should just be the native origin for the sender. For Cumulus/Frame chains this is
/// the `Parachain` origin.
Expand Down
61 changes: 28 additions & 33 deletions runtime/common/src/parachains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,6 @@ impl<T: Trait + Send + Sync> SignedExtension for ValidateDoubleVoteReports<T> wh
}
}

/*
#[cfg(test)]
mod tests {
use super::*;
Expand Down Expand Up @@ -2352,11 +2351,11 @@ mod tests {
init_block();
queue_upward_messages(0.into(), &vec![ vec![0; 4] ]);
queue_upward_messages(1.into(), &vec![ vec![1; 4] ]);
let mut dispatched: Vec<(ParaId, ParachainDispatchOrigin, Vec<u8>)> = vec![];
let dummy = |id, origin, data: &[u8]| dispatched.push((id, origin, data.to_vec()));
let mut dispatched: Vec<(ParaId, Vec<u8>)> = vec![];
let dummy = |id, data: &[u8]| dispatched.push((id, data.to_vec()));
Parachains::dispatch_upward_messages(2, 3, dummy);
assert_eq!(dispatched, vec![
(0.into(), ParachainDispatchOrigin::Parachain, vec![0; 4])
(0.into(), vec![0; 4])
]);
assert!(<RelayDispatchQueue>::get(ParaId::from(0)).is_empty());
assert_eq!(<RelayDispatchQueue>::get(ParaId::from(1)).len(), 1);
Expand All @@ -2366,12 +2365,12 @@ mod tests {
queue_upward_messages(0.into(), &vec![ vec![0; 2] ]);
queue_upward_messages(1.into(), &vec![ vec![1; 2] ]);
queue_upward_messages(2.into(), &vec![ vec![2] ]);
let mut dispatched: Vec<(ParaId, ParachainDispatchOrigin, Vec<u8>)> = vec![];
let dummy = |id, origin, data: &[u8]| dispatched.push((id, origin, data.to_vec()));
let mut dispatched: Vec<(ParaId, Vec<u8>)> = vec![];
let dummy = |id, data: &[u8]| dispatched.push((id, data.to_vec()));
Parachains::dispatch_upward_messages(2, 3, dummy);
assert_eq!(dispatched, vec![
(0.into(), ParachainDispatchOrigin::Parachain, vec![0; 2]),
(2.into(), ParachainDispatchOrigin::Parachain, vec![2])
(0.into(), vec![0; 2]),
(2.into(), vec![2])
]);
assert!(<RelayDispatchQueue>::get(ParaId::from(0)).is_empty());
assert_eq!(<RelayDispatchQueue>::get(ParaId::from(1)).len(), 1);
Expand All @@ -2382,12 +2381,12 @@ mod tests {
queue_upward_messages(0.into(), &vec![ vec![0; 2] ]);
queue_upward_messages(1.into(), &vec![ vec![1; 2] ]);
queue_upward_messages(2.into(), &vec![ vec![2] ]);
let mut dispatched: Vec<(ParaId, ParachainDispatchOrigin, Vec<u8>)> = vec![];
let dummy = |id, origin, data: &[u8]| dispatched.push((id, origin, data.to_vec()));
let mut dispatched: Vec<(ParaId, Vec<u8>)> = vec![];
let dummy = |id, data: &[u8]| dispatched.push((id, data.to_vec()));
Parachains::dispatch_upward_messages(2, 3, dummy);
assert_eq!(dispatched, vec![
(0.into(), ParachainDispatchOrigin::Parachain, vec![0; 2]),
(2.into(), ParachainDispatchOrigin::Parachain, vec![2])
(0.into(), vec![0; 2]),
(2.into(), vec![2])
]);
assert!(<RelayDispatchQueue>::get(ParaId::from(0)).is_empty());
assert_eq!(<RelayDispatchQueue>::get(ParaId::from(1)).len(), 1);
Expand All @@ -2398,12 +2397,12 @@ mod tests {
queue_upward_messages(0.into(), &vec![ vec![0; 2] ]);
queue_upward_messages(1.into(), &vec![ vec![1; 2] ]);
queue_upward_messages(2.into(), &vec![ vec![2] ]);
let mut dispatched: Vec<(ParaId, ParachainDispatchOrigin, Vec<u8>)> = vec![];
let dummy = |id, origin, data: &[u8]| dispatched.push((id, origin, data.to_vec()));
let mut dispatched: Vec<(ParaId, Vec<u8>)> = vec![];
let dummy = |id, data: &[u8]| dispatched.push((id, data.to_vec()));
Parachains::dispatch_upward_messages(2, 3, dummy);
assert_eq!(dispatched, vec![
(0.into(), ParachainDispatchOrigin::Parachain, vec![0; 2]),
(2.into(), ParachainDispatchOrigin::Parachain, vec![2]),
(0.into(), vec![0; 2]),
(2.into(), vec![2]),
]);
assert!(<RelayDispatchQueue>::get(ParaId::from(0)).is_empty());
assert_eq!(<RelayDispatchQueue>::get(ParaId::from(1)).len(), 1);
Expand All @@ -2426,7 +2425,8 @@ mod tests {
let messages = vec![ vec![1, 2] ];
assert_ok!(Parachains::check_upward_messages(0.into(), &messages, 2, 3));
queue_upward_messages(0.into(), &messages);
assert_eq!(<RelayDispatchQueue>::get(ParaId::from(0)), vec![ vec![0] }, vec![1, 2] ] );
assert_eq!(<RelayDispatchQueue>::get(ParaId::from(0)), vec![ vec![0], vec![1, 2]] );
})
}

#[test]
Expand All @@ -2441,14 +2441,14 @@ mod tests {
assert_ok!(Parachains::check_upward_messages(0.into(), &messages, 2, 3));

// oversize and bad since it's not just one.
let messages = vec![ vec![0] vec![0; 4] ];
let messages = vec![ vec![0], vec![0; 4] ];
assert_err!(
Parachains::check_upward_messages(0.into(), &messages, 2, 3),
Error::<Test>::QueueFull
);

// too many messages.
let messages = vec![ vec![0] vec![1] vec![2] ];
let messages = vec![ vec![0], vec![1], vec![2] ];
assert_err!(
Parachains::check_upward_messages(0.into(), &messages, 2, 3),
Error::<Test>::QueueFull
Expand All @@ -2465,7 +2465,7 @@ mod tests {
run_to_block(2);
// too many messages.
queue_upward_messages(0.into(), &vec![ vec![0] ]);
let messages = vec![ vec![1] vec![2] ];
let messages = vec![ vec![1], vec![2] ];
assert_err!(
Parachains::check_upward_messages(0.into(), &messages, 2, 3),
Error::<Test>::QueueFull
Expand Down Expand Up @@ -2536,12 +2536,8 @@ mod tests {
run_to_block(2);
// parachain 0 is self
let mut candidates = vec![
new_candidate_with_upward_messages(0, vec![
(ParachainDispatchOrigin::Signed, vec![1]),
]),
new_candidate_with_upward_messages(1, vec![
(ParachainDispatchOrigin::Parachain, vec![2]),
])
new_candidate_with_upward_messages(0, vec![ vec![1] ]),
new_candidate_with_upward_messages(1, vec![ vec![2] ]),
];
candidates.iter_mut().for_each(make_attestations);

Expand Down Expand Up @@ -3645,7 +3641,7 @@ mod tests {
new_test_ext(parachains).execute_with(|| {
run_to_block(2);

DownwardMessageQueue::<Test>::insert(
DownwardMessageQueue::insert(
&id,
vec![
vec![1],
Expand All @@ -3662,12 +3658,11 @@ mod tests {
candidates.iter_mut().for_each(make_attestations);

assert_ok!(Parachains::set_heads(Origin::none(), candidates));
assert_eq!(
vec![vidlbgflib
::Opaque(vec![3])],
DownwardMessageQueue::<Test>::get(&id),
);
// assert_eq!(
// vec![vidlbgflib
// ::Opaque(vec![3])],
// DownwardMessageQueue::<Test>::get(&id),
// );
});
}
}
*/