-
Notifications
You must be signed in to change notification settings - Fork 126
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
Rpc-clients: Add creation function with separate address and port #718
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.
Added some feedback on testing. But generally good enough this way, so I approve.
src/rpc/tungstenite_client/client.rs
Outdated
|
||
let client2 = TungsteniteRpcClient::with_default_url(1); | ||
|
||
assert_eq!(client.url, client2.url); |
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.
strictly speaking: your testing 2 things, not 1 (and one should ideally test only 1 thing). Apart from testing the new function "with_default_url" you're also testing, that the default port is 9944. Also, what happens if both have an error in their logic? I would check the actual string value.
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.
Adapted in 9c580cc. Is this what you expected?
src/rpc/ws_client/client.rs
Outdated
|
||
let client2 = WsRpcClient::with_default_url(); | ||
|
||
assert_eq!(client.url, client2.url); |
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.
same as above
…cs/substrate-api-client into bh/109-pass-port-independently
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 change
Adds a function
new_with_port
to each rpc-client which concatenates the address and the port into one string.closes #109