-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: enable self.chain = 'main' to work in python bitcoin test framework #21085
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
Conversation
mainchain and testchains could behave different. So make sure we can now easy test this.
| with open(os.path.join(datadir, chain, ".cookie"), 'r', encoding="ascii") as f: | ||
| subdir = chain | ||
| if subdir == "main": | ||
| subdir = "" |
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.
Might be better to use "."
| subdir = chain | ||
| if chain == "main": | ||
| subdir = "" | ||
| if os.path.isfile(os.path.join(datadir, subdir, ".cookie")): |
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.
Instead of duplicating this logic, perhaps a new function to get the cookie filepath is in order.
| if wallet_name is not None: | ||
| n.createwallet(wallet_name=wallet_name, descriptors=self.options.descriptors, load_on_startup=True) | ||
| n.importprivkey(privkey=n.get_deterministic_priv_key().key, label='coinbase') | ||
| if self.chain != "main": |
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.
Why?
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.
because all the key address pair we have now are only for testnets
and will when the chain get initialized used but fail checks, so that the test
would not even start,
We can gen them on the fly if we need keys and addresses. For mainchain tests.?
|
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
Are you still working on this? |
mainchain and testchains could behave different.
So make sure we can now easy test also mainnet behavior.
Mainchain would fail until now because the key address pair where only for testnets and
the rpc cookie was placed assuming testnets in an inaccessible subdir for mainchain,