test: enable self.chain = 'main' to work in python bitcoin test framework#21085
test: enable self.chain = 'main' to work in python bitcoin test framework#21085Saibato wants to merge 1 commit intobitcoin:masterfrom
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 = "" |
| subdir = chain | ||
| if chain == "main": | ||
| subdir = "" | ||
| if os.path.isfile(os.path.join(datadir, subdir, ".cookie")): |
There was a problem hiding this comment.
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.
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,