Skip to content

Add issuer transfer expiry boundary tests for accept_issuer_transfer at exact ISSUER_TRANSFER_EXPIRY_SECS #368

@thlpkee20-wq

Description

@thlpkee20-wq

Description

accept_issuer_transfer rejects with IssuerTransferExpired when now > timestamp + ISSUER_TRANSFER_EXPIRY_SECS, which is an exclusive comparison. The exact-boundary case (now == timestamp + expiry, which should still be accepted) and the saturating-add overflow case are untested. Add ledger-timestamp-controlled tests for these.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/lib.rs (accept_issuer_transfer, propose_issuer_transfer, PendingTransfer)
  • Use env.ledger().set_timestamp to drive the boundary

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/issuer-transfer-expiry-tests
  • Implement changes
    • Propose, advance to exact expiry, assert accept succeeds
    • Advance one second past expiry, assert IssuerTransferExpired
    • Test timestamp.saturating_add near u64::MAX
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test
  • Cover edge cases
    • Exact boundary, one-past, overflow saturation, self-transfer (new==old)
  • Include test output and security notes

Example commit message

test: cover issuer transfer expiry boundary and overflow

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions