rusty-kaspa
rusty-kaspa copied to clipboard
Add support for IP only for --rpclisten-borsh/json (#402)
Adds support for IP only for the --rpclisten-borsh/json flags. If a port is not provided a default port for a given network would be used.
Functional part looks good to me. However tests look too repetitive. Wdyt about using array and for-loop/iterator? In addition, it is possible to make ip intanzation only once
One can call .iter()
on both NetworkType
, and WrpcEncoding
, then just have a match on these cases, Personally i prefer this way because if new encodings, or network types, were to be added, the test can't compile without handling of new enum variants.
thanks @biryukovmaxim, good points, i updated the code
One can call .iter() on both NetworkType, and WrpcEncoding, then just have a match on these cases
oh interesting, i actually did a quick docs lookup to see it's not standard functionality, but i somehow failed to see it's implemented for those enums already. it'll make code neater, thanks