Skip to content

Testing Environments #156

Answered by satran004
djcyr asked this question in Q&A
Sep 25, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

You are right. There are only two possible values for network Id, 0 (all testnets) and 1 (mainnet).
NetworkId is used during address generation, not protocol magic.

But somewhere in the code, the whole network object is compared during address generation to find the address prefix. This is a bug. We need to fix that to check only networkId in the Network object.

Yes, the workaround is - always pass Networks.testnet() during non mainnet address generation.

This will be fixed as part of this PR to avoid any confusion.
#158

Would there be any problem later if I create a signed transaction
with that account having the wrong magic number (value 2 instead of 1097911063)?

No. It should work.…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@djcyr
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by djcyr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants