File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1529,12 +1529,21 @@ module ntt::ntt_tests {
15291529
15301530 let inbound_last_tx_after = inbound.last_tx_timestamp ();
15311531
1532- // Outbound and inbound rate limit comparisons
1533- assert ! (inbound_last_tx_after != inbound_last_tx_before);
1534- assert ! (inbound_last_tx_after > inbound_last_tx_before);
1535- assert ! (outbound_last_tx_after != outbound_last_tx_before);
1536- assert ! (outbound_last_tx_after > outbound_last_tx_before);
1537- assert ! (outbound_last_tx_after == inbound_last_tx_after);
1532+ // The transfer records the current clock time as last_tx_timestamp for
1533+ // both the inbound and outbound rate limiters. The clock is not advanced
1534+ // between the snapshots, so `before + time == after` holds exactly.
1535+ let time = clock.timestamp_ms ();
1536+
1537+ // Both limiters started at 0 (set during setup at clock time 0).
1538+ assert ! (inbound_last_tx_before == 0 );
1539+ assert ! (outbound_last_tx_before == 0 );
1540+
1541+ // Inbound and outbound timestamps advance to exactly the transfer time.
1542+ assert ! (inbound_last_tx_after == inbound_last_tx_before + time);
1543+ assert ! (outbound_last_tx_after == outbound_last_tx_before + time);
1544+
1545+ // Both limiters are updated to the same timestamp.
1546+ assert ! (outbound_last_tx_after == inbound_last_tx_after);
15381547
15391548 let message = *state.borrow_outbox ().borrow (outbox_key).borrow_data ();
15401549
You can’t perform that action at this time.
0 commit comments