Skip to content
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

Merged
merged 20 commits into from
Sep 21, 2023
Merged

Conversation

dr-orlovsky
Copy link
Member

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

@dr-orlovsky dr-orlovsky requested a review from zoedberg August 12, 2023 09:59
@dr-orlovsky dr-orlovsky added bug Something isn't working enhancement New feature or request *compatibility* Issues affecting compatibility and interoperability labels Aug 12, 2023
@dr-orlovsky dr-orlovsky added this to the v0.10.x milestone Aug 12, 2023

impl Chain {
#[inline]
pub fn is_testnet(self) -> bool {
Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

@dr-orlovsky dr-orlovsky Sep 18, 2023

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.

Copy link
Contributor

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.

Copy link
Member Author

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"

@dr-orlovsky dr-orlovsky changed the title Improvements and fixes for primitive types Improvements and fixes for primitive types #2 Sep 20, 2023
@dr-orlovsky dr-orlovsky marked this pull request as ready for review September 20, 2023 15:38
@dr-orlovsky
Copy link
Member Author

dr-orlovsky commented Sep 20, 2023

Ok, I am planning to merge it as it is - since downstream in bp-wallet I finally got read-only non-RGB wallet functionality working based on this code (without any rust-bitcoin dependencies), i.e. kinda milestone.

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

Copy link
Contributor

@zoedberg zoedberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 263d48e

@dr-orlovsky dr-orlovsky merged commit 89c0391 into master Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working *compatibility* Issues affecting compatibility and interoperability enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants