Skip to content

Add Ballot Creation Timestamp Verification #29

@Just-Bamford

Description

@Just-Bamford

��# Issue 12: Add Ballot Creation Timestamp Verification

Problem

No way to verify when a ballot was created. Timestamp not stored or queryable.

Solution

  • Store created_at: u64 using env.ledger().timestamp() in record_ballot
  • Add to BallotMetadata struct
  • Implement get_ballot_created_at() read function
  • TypeScript helper to query creation time for verification

Implementation Tasks

  • Store created_at during record_ballot initialization
  • Add created_at field to BallotMetadata
  • Implement get_ballot_created_at() getter
  • Add TypeScript helper sorobanGetBallotCreatedAt()
  • Unit tests: timestamp is set and retrievable
  • Verify timestamp accuracy (within block time tolerance)

Note for Contributors

Complete Issue #1 (ballot metadata storage) first. The created_at timestamp is set once during record_ballot and is immutable thereafter. Use env.ledger().timestamp() to capture the ledger timestamp at ballot creation. Store this value in BallotMetadata and never allow modification. Timestamps enable external verification of ballot creation order and timing. Consider that Stellar block times are approximately 5-6 seconds, so timestamps may have that granularity. Include created_at in all audit reports and use it for queries in combination with expiration checks (Issue #10).

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

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