mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 20:51:05 +00:00
Run cargo fmt on the whole code base (#9394)
* Run cargo fmt on the whole code base * Second run * Add CI check * Fix compilation * More unnecessary braces * Handle weights * Use --all * Use correct attributes... * Fix UI tests * AHHHHHHHHH * 🤦 * Docs * Fix compilation * 🤷 * Please stop * 🤦 x 2 * More * make rustfmt.toml consistent with polkadot Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
@@ -55,13 +55,34 @@ mod tests {
|
||||
#[test]
|
||||
fn test_h256() {
|
||||
let tests = vec![
|
||||
(Default::default(), "0x0000000000000000000000000000000000000000000000000000000000000000"),
|
||||
(H256::from_low_u64_be(2), "0x0000000000000000000000000000000000000000000000000000000000000002"),
|
||||
(H256::from_low_u64_be(15), "0x000000000000000000000000000000000000000000000000000000000000000f"),
|
||||
(H256::from_low_u64_be(16), "0x0000000000000000000000000000000000000000000000000000000000000010"),
|
||||
(H256::from_low_u64_be(1_000), "0x00000000000000000000000000000000000000000000000000000000000003e8"),
|
||||
(H256::from_low_u64_be(100_000), "0x00000000000000000000000000000000000000000000000000000000000186a0"),
|
||||
(H256::from_low_u64_be(u64::MAX), "0x000000000000000000000000000000000000000000000000ffffffffffffffff"),
|
||||
(
|
||||
Default::default(),
|
||||
"0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
),
|
||||
(
|
||||
H256::from_low_u64_be(2),
|
||||
"0x0000000000000000000000000000000000000000000000000000000000000002",
|
||||
),
|
||||
(
|
||||
H256::from_low_u64_be(15),
|
||||
"0x000000000000000000000000000000000000000000000000000000000000000f",
|
||||
),
|
||||
(
|
||||
H256::from_low_u64_be(16),
|
||||
"0x0000000000000000000000000000000000000000000000000000000000000010",
|
||||
),
|
||||
(
|
||||
H256::from_low_u64_be(1_000),
|
||||
"0x00000000000000000000000000000000000000000000000000000000000003e8",
|
||||
),
|
||||
(
|
||||
H256::from_low_u64_be(100_000),
|
||||
"0x00000000000000000000000000000000000000000000000000000000000186a0",
|
||||
),
|
||||
(
|
||||
H256::from_low_u64_be(u64::MAX),
|
||||
"0x000000000000000000000000000000000000000000000000ffffffffffffffff",
|
||||
),
|
||||
];
|
||||
|
||||
for (number, expected) in tests {
|
||||
@@ -72,9 +93,21 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_invalid() {
|
||||
assert!(ser::from_str::<H256>("\"0x000000000000000000000000000000000000000000000000000000000000000\"").unwrap_err().is_data());
|
||||
assert!(ser::from_str::<H256>("\"0x000000000000000000000000000000000000000000000000000000000000000g\"").unwrap_err().is_data());
|
||||
assert!(ser::from_str::<H256>("\"0x00000000000000000000000000000000000000000000000000000000000000000\"").unwrap_err().is_data());
|
||||
assert!(ser::from_str::<H256>(
|
||||
"\"0x000000000000000000000000000000000000000000000000000000000000000\""
|
||||
)
|
||||
.unwrap_err()
|
||||
.is_data());
|
||||
assert!(ser::from_str::<H256>(
|
||||
"\"0x000000000000000000000000000000000000000000000000000000000000000g\""
|
||||
)
|
||||
.unwrap_err()
|
||||
.is_data());
|
||||
assert!(ser::from_str::<H256>(
|
||||
"\"0x00000000000000000000000000000000000000000000000000000000000000000\""
|
||||
)
|
||||
.unwrap_err()
|
||||
.is_data());
|
||||
assert!(ser::from_str::<H256>("\"\"").unwrap_err().is_data());
|
||||
assert!(ser::from_str::<H256>("\"0\"").unwrap_err().is_data());
|
||||
assert!(ser::from_str::<H256>("\"10\"").unwrap_err().is_data());
|
||||
|
||||
Reference in New Issue
Block a user