Skip to content

Conversation

@Saibato
Copy link
Contributor

@Saibato Saibato commented Feb 5, 2021

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,

mainchain and testchains could behave different.
So make sure we can now easy test this.
@fanquake fanquake added the Tests label Feb 5, 2021
with open(os.path.join(datadir, chain, ".cookie"), 'r', encoding="ascii") as f:
subdir = chain
if subdir == "main":
subdir = ""
Copy link
Member

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 "."

Comment on lines +419 to +422
subdir = chain
if chain == "main":
subdir = ""
if os.path.isfile(os.path.join(datadir, subdir, ".cookie")):
Copy link
Member

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":
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

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.?

@DrahtBot
Copy link
Contributor

🐙 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".

@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #23608 (test: fix feature_rbf.py --descriptors and add to test runner by theStack)

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.

@maflcko
Copy link
Member

maflcko commented Feb 22, 2022

Are you still working on this?

@fanquake fanquake closed this Apr 26, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants