-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Improvements and fixes for primitive types #2 #54
Conversation
primitives/src/util.rs
Outdated
|
||
impl Chain { | ||
#[inline] | ||
pub fn is_testnet(self) -> 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.
IMO inverting logic and calling the method is_mainnet
would be clearer
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 do not agree. Right now there is just one mainnet: Chain::Bitcoin
and one can just test it against it. Testnets are multiple and their number may be growing.
In the future more non-testnets may be added (for instance prime). But they are also not "mainnets". Thus since we need to test against testnet/non-testnet - we need method named is_testnet
and not is_mainnet
.
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.
IMO is_testnet
is confusing since there is a specific network called "testnet". Maybe we could call it is_test_network
?
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.
Agree that it is confusing. Probably better is_test
or has_no_value
?
BTW the full name for the testnet is testnet3
. Testnet is not running anymore.
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 still prefer is_test_network
but is_test
also seems ok.
I know that there's testnet3 but since testnet1 and testnet2 have been dismissed everyone just calls it testnet.
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 did is_test_chain
(since the name of the type is Chain
and not Network
). Also seems not to conflict with "testnet"
91eab32
to
272faaf
Compare
95b35ee
to
64477b5
Compare
Ok, I am planning to merge it as it is - since downstream in Next, I will probably do another ongoing PR here, but this one I think should be merged since contains important fixes (like invalid Txid serde serialization for JSON etc). @zoedberg I need your ACK |
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.
ACK 263d48e
As a part of my work on making sure that all RGB wallet-related tasks (including Tapret) are working as required I stumble upon issues and bugs, which are being progressively fixed in this branch