Conversation
ironbeer
left a comment
There was a problem hiding this comment.
Thanks for the pull request, I commented so please check it!
Modify address check logic
↓ |
ironbeer
left a comment
There was a problem hiding this comment.
Thank you for your update! I commented, so please check again.
src/services/transaction.service.ts
Outdated
| webhook, | ||
| ); | ||
| if (status >= 400) { | ||
| webhookCheck = false; |
There was a problem hiding this comment.
should check after Promise.all as the result depends on the order in which the Wenhooks finished.
const statuses = await Promise.all(hooks.map(...))
const result = statuses.every(...)There was a problem hiding this comment.
Thanks.
I modified to checkWebhook to throw an error if there is an error
verse-proxy/src/services/webhook.service.ts
Lines 25 to 41 in 127031f
src/services/webhook.service.ts
Outdated
|
|
||
| const webhookBody = { | ||
| ...(webhook.parse ? tx : body), | ||
| _meta: { ip, headers: verseHeaders }, |
There was a problem hiding this comment.
I think that headers should be passed as it is, but what about it?
There was a problem hiding this comment.
Thanks, I agree with you.
Set the header of the proxy request in _meta.header.
127031f#diff-95cb68dc1b2fad5c19e602ed7ba97f727c4afdcfa35c27c06697cf93ad8f292cR13-R17
src/services/transaction.service.ts
Outdated
| ); | ||
|
|
||
| if (fromCheck && toCheck && valueCheck) { | ||
| let webhookCheck = true; |
There was a problem hiding this comment.
Webhooks are expensive, so please continue early.
e.g.
if (!(fromCheck && toCheck && contractCheck && valueCheck)) {
continue
}
// call webhooksThere was a problem hiding this comment.
Thanks.
Fixed as well as rate limit.
verse-proxy/src/services/transaction.service.ts
Lines 74 to 87 in 127031f
This reverts commit 40870fb.
No description provided.