-
Notifications
You must be signed in to change notification settings - Fork 24
add dips graphql #331
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
add dips graphql #331
Conversation
1c724c9 to
ab06867
Compare
Pull Request Test Coverage Report for Build 11707736076Details
💛 - Coveralls |
2c3a2ec to
4a514e9
Compare
72ebe2c to
e2359ab
Compare
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.
Please, check my comments 🙂
2c49fc1 to
bd31868
Compare
641ad4d to
2fbf0c3
Compare
c2c60c6 to
af6a0ff
Compare
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.
In general, LGTM ✅
| // should only be usable within a limited period of time. | ||
| uint64 timestamp; |
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.
I have followed the thread, and it is used in the cancellation request validation. What's the goal of this timestamp?
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.
essentially to prevent re-use or any variation of that.
| sqlx::query!( | ||
| "UPDATE dips_agreements SET updated_at=now(), cancelled_at=now(), signed_cancellation_payload=$1 WHERE id=$2", | ||
| bs, | ||
| id, | ||
| ) | ||
| .execute(&self.pool) | ||
| .await?; |
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.
I would return an error when there's no agreement in the DB with the provided ID. If I am correct, the query will not update anything and will return successfully.
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.
Isn't that the correct outcome anyway? If the query doesn't update anything it's a noop. I don't have a strong preference, if you do I'll change it otherwise I think I'll leave that in for the moment
| // data should be the signed voucher, eip712 signed, rlp and base64 encoded. | ||
| signed_request: String, | ||
| ) -> FieldResult<String> { | ||
| let store: &Arc<dyn AgreementStore> = ctx.data()?; |
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.
Out of curiosity. Why did you choose dynamic dispatch over a generic argument?
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.
Normally I find it easier to work with dynamic dispatch, generic arguments tend to propagate through the code very easily, I don't think the perf penalty on something like this is worth the trade-off.
3612be8 to
d843fa7
Compare
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.
LGTM ✅
BEGIN_COMMIT_OVERRIDE
chore: add dips graphql
END_COMMIT_OVERRIDE