rusty-kaspa icon indicating copy to clipboard operation
rusty-kaspa copied to clipboard

Add support for IP only for --rpclisten-borsh/json (#402)

Open gvbgduh opened this issue 3 months ago • 2 comments

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.

gvbgduh avatar Mar 23 '24 14:03 gvbgduh

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.

D-Stacks avatar Mar 27 '24 21:03 D-Stacks

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

gvbgduh avatar Apr 01 '24 08:04 gvbgduh