-
Notifications
You must be signed in to change notification settings - Fork 94
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
[r2r] get_current_mtp rpc impl #1340
Conversation
@shamardy this PR is ready for review |
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.
Thanks for the fast PR! First review iteration.
fn status_code(&self) -> StatusCode { | ||
match self { | ||
GetCurrentMtpError::Internal(_) => StatusCode::INTERNAL_SERVER_ERROR, | ||
GetCurrentMtpError::NotSupported(_) => StatusCode::INTERNAL_SERVER_ERROR, |
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 coin = lp_coinfind_or_err(&ctx, &req.coin).await?; | ||
|
||
match coin { |
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.
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.
Second review iteration
@shamardy this is ready for review. thanks |
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.
Only one more minor fix 🙂
Makes sense in this case 💯
…On Fri, 15 Jul 2022 at 19:42, shamardy ***@***.***> wrote:
***@***.**** commented on this pull request.
Only one more minor fix 🙂
------------------------------
In mm2src/coins/rpc_command/get_current_mtp.rs
<#1340 (comment)>
:
> + GetCurrentMtpError::NoSuchCoin(_) => StatusCode::NOT_FOUND,
+ GetCurrentMtpError::RpcError(_) | GetCurrentMtpError::NotSupportedCoin(_) => StatusCode::BAD_REQUEST,
NoSuchCoin should be StatusCode::PRECONDITION_REQUIRED since the coin
activation is a precondition to using it in this case.
I guess the best fit for RpcError is StatusCode::INTERNAL_SERVER_ERROR
although it's not implemented like this everywhere else.
—
Reply to this email directly, view it on GitHub
<#1340 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AML2KX3LST23Y5R3HGYSLADVUGWIJANCNFSM53ORYKPQ>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
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.
LGTM!
@sergeyboyko0791 can you please have a look at this PR too? |
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.
Great job!
Only decorative remarks
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 passphrase = "cMhHM3PMpMrChygR4bLF7QsTdenhWpFrrmf2UezBG3eeFsz41rtL"; | ||
|
||
let conf = Mm2TestConf::seednode(&passphrase, &coins); |
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.
I think it's overhead to run a seednode in this test.
Seednode opens a server socket and listens for incoming P2P connections.
But anyway it's not critical now
…into get_current_mtp_rpc
get_current_mtp
API call #1338