Skip to content
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

fix: [Reputation Oracle] Update processing pending/paid escrow #1129

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,19 @@ export class WebhookService {
results.hash,
);

await this.webhookRepository.updateOne(
{ id: webhookEntity.id },
{
resultsUrl: results.url,
checkPassed: results.checkPassed,
status: WebhookStatus.PAID,
retriesCount: 0,
},
);
const balance = await escrowClient.getBalance(escrowAddress);

if (balance.toNumber() == 0) {
await this.webhookRepository.updateOne(
{ id: webhookEntity.id },
{
resultsUrl: results.url,
checkPassed: results.checkPassed,
status: WebhookStatus.PAID,
retriesCount: 0,
},
);
}

return true;
} catch (e) {
Expand Down Expand Up @@ -499,6 +503,8 @@ export class WebhookService {
);
}

await escrowClient.complete(webhookEntity.escrowAddress);

await this.webhookRepository.updateOne(
{
id: webhookEntity.id,
Expand Down