Skip to content

Commit 6039c38

Browse files
committed
synth: rustfmt the layout fingerprint, bump node crate
1 parent f6f771f commit 6039c38

3 files changed

Lines changed: 43 additions & 13 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hydradx"
3-
version = "16.0.0"
3+
version = "16.0.1"
44
description = "Hydration node"
55
authors = ["GalacticCouncil"]
66
edition = "2021"

node/src/synthetic_logs/compat_events.rs

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -298,19 +298,45 @@ mod tests {
298298
/// new layout to `read_events`.
299299
#[test]
300300
fn node_balances_layout_is_known() {
301-
let who = AccountId::new([0u8; 32]);
302-
// (name, index) for every variant synth reads or has to step over.
301+
let who = || AccountId::new([0u8; 32]);
302+
// one index per variant synth reads or has to step over.
303+
let transfer = NodeBalancesEvent::Transfer {
304+
from: who(),
305+
to: who(),
306+
amount: 0,
307+
};
303308
let fingerprint = [
304-
("Transfer", variant_index(NodeBalancesEvent::Transfer { from: who.clone(), to: who.clone(), amount: 0 })),
305-
("Deposit", variant_index(NodeBalancesEvent::Deposit { who: who.clone(), amount: 0 })),
306-
("Withdraw", variant_index(NodeBalancesEvent::Withdraw { who: who.clone(), amount: 0 })),
307-
("Slashed", variant_index(NodeBalancesEvent::Slashed { who: who.clone(), amount: 0 })),
308-
("Minted", variant_index(NodeBalancesEvent::Minted { who: who.clone(), amount: 0 })),
309-
("Burned", variant_index(NodeBalancesEvent::Burned { who: who.clone(), amount: 0 })),
309+
("Transfer", variant_index(transfer)),
310+
(
311+
"Deposit",
312+
variant_index(NodeBalancesEvent::Deposit { who: who(), amount: 0 }),
313+
),
314+
(
315+
"Withdraw",
316+
variant_index(NodeBalancesEvent::Withdraw { who: who(), amount: 0 }),
317+
),
318+
(
319+
"Slashed",
320+
variant_index(NodeBalancesEvent::Slashed { who: who(), amount: 0 }),
321+
),
322+
(
323+
"Minted",
324+
variant_index(NodeBalancesEvent::Minted { who: who(), amount: 0 }),
325+
),
326+
(
327+
"Burned",
328+
variant_index(NodeBalancesEvent::Burned { who: who(), amount: 0 }),
329+
),
310330
("Issued", variant_index(NodeBalancesEvent::Issued { amount: 0 })),
311331
("Rescinded", variant_index(NodeBalancesEvent::Rescinded { amount: 0 })),
312-
("Locked", variant_index(NodeBalancesEvent::Locked { who: who.clone(), amount: 0 })),
313-
("Frozen", variant_index(NodeBalancesEvent::Frozen { who, amount: 0 })),
332+
(
333+
"Locked",
334+
variant_index(NodeBalancesEvent::Locked { who: who(), amount: 0 }),
335+
),
336+
(
337+
"Frozen",
338+
variant_index(NodeBalancesEvent::Frozen { who: who(), amount: 0 }),
339+
),
314340
];
315341

316342
// layouts `read_events` can decode. add an entry (and a mirror enum) when a
@@ -346,7 +372,11 @@ mod tests {
346372
})
347373
.collect();
348374
// the batch_all alone raises 6 (approve, core bridge, 2x transceiver, 2x manager).
349-
assert!(evm_logs.len() >= 6, "expected the EVM.call logs, got {}", evm_logs.len());
375+
assert!(
376+
evm_logs.len() >= 6,
377+
"expected the EVM.call logs, got {}",
378+
evm_logs.len()
379+
);
350380

351381
// the whole point: the wormhole message must survive the read.
352382
let published = evm_logs

0 commit comments

Comments
 (0)