-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat(rpc): add cancellations param to submit_block rpc #131
base: main
Are you sure you want to change the base?
Conversation
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.
not sure why we went w/ String
for type of cancellation signal
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.
moving in the right direction!
let path = format!("/relay/v1/builder/blocks"); | ||
let target = self.api.endpoint.join(&path).map_err(ApiError::from)?; | ||
let mut request = self.api.http.post(target).json(signed_submission); | ||
if with_cancellations { request = request.query(&[("cancellations", with_cancellations)]) }; |
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.
see above comment
@@ -24,10 +24,11 @@ async fn handle_get_proposal_schedule<R: BlindedBlockRelayer>( | |||
|
|||
async fn handle_submit_bid<R: BlindedBlockRelayer>( | |||
State(relayer): State<R>, | |||
Query(with_cancellations): Query<bool>, |
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.
following the spec, this will fail
I think you can try Query<usize>
but could also just do Query<String>
and something like
let with_cancellations = if with_cancellations == "1" { true } else { false };
@PatStiles can you address the linter failures? |
Done! |
@@ -28,7 +28,7 @@ impl BlindedBlockRelayer for Client { | |||
signed_submission: &SignedBidSubmission, | |||
with_cancellations: bool, | |||
) -> Result<(), Error> { | |||
let path = format!("/relay/v1/builder/blocks"); | |||
let path = "/relay/v1/builder/blocks".to_string(); |
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.
let path = "/relay/v1/builder/blocks".to_string(); | |
let path = "/relay/v1/builder/blocks"; |
Closes #114