Skip to content

Add get_mint_timestamp read method - #323

Merged
Calebux merged 1 commit into
zintarh:mainfrom
Daverisky-max:add-get-mint-timestamp
Jul 29, 2026
Merged

Add get_mint_timestamp read method#323
Calebux merged 1 commit into
zintarh:mainfrom
Daverisky-max:add-get-mint-timestamp

Conversation

@Daverisky-max

Copy link
Copy Markdown

Fixes #281 - Add get_mint_timestamp read method

Summary

This PR adds a read method to return the mint timestamp for a given user-period as an Option<u64>, resolving issue #281.

Acceptance Criteria

  • Read Method: Implemented get_mint_timestamp(e: Env, user: Address, period: u64) -> Option<u64>.
  • Tests: Added test_get_mint_timestamp_exists and test_get_mint_timestamp_missing testing both scenarios in src/test.rs.
  • Documentation: Explicitly documented that the returned timestamp represents ledger time, not wall-clock time, and returns None if no mint has occurred.

Notes for Reviewers

  • The baseline test suite (cargo test) failed to compile prior to these changes due to a dependency resolution error in soroban-env-host v21.2.1 (ChaCha20Rng: ed25519_dalek::rand_core::CryptoRng trait bound not satisfied). The changes introduced here follow existing storage patterns and should be structurally sound once the dependency tree compiles.
  • Extracted the timestamp as a u64 based on the existing WrapRecord { timestamp: u64 } struct implementation.
  • Pre-existing clippy warnings in src/mint.rs regarding manual range bounds were left untouched as they were out of scope.

- Adds get_mint_timestamp to queries, returning the ledger timestamp of a wrap mint for a given user and period as an Option<u64>.

- Adds tests covering both the value exists and value missing cases in src/test.rs.
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Daverisky-max Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Calebux
Calebux merged commit 61bddc4 into zintarh:main Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Add get_wrap_timestamp convenience query

3 participants