-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: allow address targeting #307
Conversation
f28710d
to
152b8b3
Compare
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @walkah on file. In order for us to review and merge your code, please open a new pull request and sign the Contributor License Agreement following the instructions in our contributing guide. Once the pull request is merged, ping a maintainer who will summon me again. |
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.
Looks good! Tested it out and it works happy path and no such resource provider. 👌
Left some comments, minor stuff. One other comment the error case dumps quite a lot of info, including the CLI flags for the command. Would be nice if we could suppress that, but no need for it to block merging this work.
newTargetOptions, err := ProcessTargetOptions(options.Offer.Target) | ||
if err != nil { | ||
return options, err | ||
} | ||
options.Offer.Target = newTargetOptions | ||
|
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.
We may be able to skip this processing step because we aren't processing the target. Optional though, alright with adding for the future.
return resourceOffer, nil | ||
} | ||
} | ||
return nil, nil |
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.
Could we return an error here? We observed some issues handling errors at the call site:
Lines 150 to 153 in c419ac1
resourceOffer, err := db.GetResourceOfferByAddress(jobOffer.JobOffer.Target.Address) | |
if err != nil { | |
return nil, err | |
} |
Perhaps we could print the error in this block and continue.
Summary
This adds a new CLI flag
--target
that allows sending a job to a specific RP address. The solver is updated to look for a target config and skip the regular matching flow to create a deal with the specified RP (if it exists).Task/Issue reference
Closes: #198
Test plan
./lilypad run --network dev --target 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65 cowsay:v0.0.4 -i Message="hello"
--target
should fail.