Skip to content

[resource-provider/protocol-smart-contract] Create event listener for Deal creation for Resource Provider #534

@narbs91

Description

@narbs91

General Description

As a developer I want to create an onchain event listener on the resource provider when a deal is saved by the solver so that I can react and begin running the job.

Which system(s) or functionality does this affect

This can be one or many. Please also include this in the title

protocol-smart-contracts, resource-provider

Describe the changes, and how this affects/ interacts with each system.

  1. Create a web3 listener for the LilypadPayment__ActiveEscrowLockedForJob event emitted from the LilypadPaymentEngine contract which signals when the job creator and resource provider have locked their escrow in active collateral. (note: prior to this call, a deal will be save on chain but it's safer to listen on the event from the paymentEngine since it will revert if either party don't have enough escrow to preform the job)
  2. Business logic added to fetch the deal object from the solver using the dealId in the event and begin running the job

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions