Skip to content

Commit d517ee8

Browse files
fix: go-sdk
1 parent 86c595b commit d517ee8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

sdk/sdk-go/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,10 @@ func FormatRevealedDataPacked(attestationID AttestationId, publicSignals PublicS
457457
// Extract minimum age (olderThan)
458458
var minimumAge string
459459
if attestationID == Aadhaar {
460-
minimumAge = string(revealedDataPackedBytes[revealedDataIndices.OlderThanStart : revealedDataIndices.OlderThanEnd+1])
461-
} else {
462460
firstByte := revealedDataPackedBytes[revealedDataIndices.OlderThanStart]
463461
minimumAge = fmt.Sprintf("%02d", int(firstByte))
462+
} else {
463+
minimumAge = string(revealedDataPackedBytes[revealedDataIndices.OlderThanStart : revealedDataIndices.OlderThanEnd+1])
464464
}
465465

466466
// Extract OFAC data and convert to boolean array

sdk/sdk-go/verifier.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,11 @@ func (s *BackendVerifier) validateTimestamp(
629629
})
630630
}
631631

632-
// Check if timestamp is more than 1 day in the past
632+
// Check if timestamp is more than 1 day in the past (using end-of-day logic)
633+
// Add 23 hours + 59 minutes + 59 seconds to circuit timestamp (matching TypeScript logic)
634+
circuitTimestampEOD := circuitTimestamp.Add(23*time.Hour + 59*time.Minute + 59*time.Second)
633635
oneDayAgo := currentTimestamp.Add(-24 * time.Hour)
634-
if circuitTimestamp.Before(oneDayAgo) {
636+
if circuitTimestampEOD.Before(oneDayAgo) {
635637
*issues = append(*issues, ConfigIssue{
636638
Type: InvalidTimestamp,
637639
Message: "Circuit timestamp is too old",

0 commit comments

Comments
 (0)