Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ABW-4001] Update PreAuthorization models #1400
[ABW-4001] Update PreAuthorization models #1400
Changes from 3 commits
b9e5e9f
39e3ea0
338ce5b
99cffa8
be9c5f6
beae529
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Date()
? Shouldn't the timestamp be UTC?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh dearful dates and timezones.. Let me write down my dummy/cautious reasoning to validate the current logic makes sense.
In this case, the subintent will expire X seconds after signature. Let's use
600
(10 minutes) for this example, which we will set using the test dApp.It is currently
13:54 PM GMT+1
in Madrid. This means that when I get to this state, thetimestamp: Date
will return14:04 GMT+1
.Given this
timestamp
is used on thePollPreAuthorizationStatus+View
, we can validate that after signing the preAuth, the view says that it expires in9 minutes
(it shows 10 minutes only for a second) and not in-50 minutes
(as it would be inGMT
timezone)So far so good, now we need to make sure that the value sent to Sargon and then to the dApp makes sense. The process here is:
Swift.Date
intoSargon.Timestamp
(happens thanks to magic code inuniffi.toml
)Now, if we check the final result sent to the dApp we can see it is
1732799073
.Then, using a Playground I can confirm this value corresponds to
14:04
in my timezone:Or if I use a helper tool such as https://www.unixtimestamp.com/ we can verify it is
14:04 GMT+1
and13:04 GMT
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that the same delay applies, regardless of the base, I think this could be safe, unless user goes and changes the date in the settings while the countdown is ticking 😄.
But as we have discussed, the same timestamp that is calculated when creating the Subintent should be used in all places.