tests.rs 32.8 KiB
Newer Older
		let instr2 = QueryResponse { query_id: 71, max_weight: 0, response: Response::Version(2) };
		let mut sent = take_sent_xcm();
		sent.sort_by_key(|k| match (k.1).0[0] {
			QueryResponse { query_id: q, .. } => q,
			_ => 0,
		});
		assert_eq!(
			sent,
			vec![
				(Parachain(1000).into(), Xcm(vec![instr0])),
				(Parachain(1001).into(), Xcm(vec![instr1])),
				(Parachain(1002).into(), Xcm(vec![instr2])),
			]
		);

		let mut contents = VersionNotifyTargets::<Test>::iter().collect::<Vec<_>>();
		contents.sort_by_key(|k| k.2);
		assert_eq!(
			contents,
			vec![
				(2, Parachain(1000).into().versioned(), (69, 0, 2)),
				(2, Parachain(1001).into().versioned(), (70, 0, 2)),
				(2, Parachain(1002).into().versioned(), (71, 0, 2)),
			]
		);
	});
}