Summary
Advancing ledger time and sequence number separately requires two calls:
env.advance_time(Duration::days(7));
env.advance_sequence(1000);
In practice, Stellar ledger sequences and timestamps are coupled. A combined helper would make epoch simulation more realistic and concise.
Proposed API
// Advance both time and sequence atomically
env.advance_epoch(Duration::days(7), 1000);
// Or with a named struct for clarity
env.advance_epoch(LedgerEpoch {
duration: Duration::days(7),
sequences: 1000,
});
Rationale
Each Stellar ledger closes roughly every 5 seconds, so 7 days ≈ ~120,960 ledgers. The helper could optionally auto-calculate sequence count from duration based on a configurable close time.
Acceptance Criteria
Summary
Advancing ledger time and sequence number separately requires two calls:
In practice, Stellar ledger sequences and timestamps are coupled. A combined helper would make epoch simulation more realistic and concise.
Proposed API
Rationale
Each Stellar ledger closes roughly every 5 seconds, so 7 days ≈ ~120,960 ledgers. The helper could optionally auto-calculate sequence count from duration based on a configurable close time.
Acceptance Criteria
advance_epoch(duration, sequences)implemented incontracts/crucible/src/time.rswith_ledger_close_time(seconds)builder method for auto-calculationprelude