-
Notifications
You must be signed in to change notification settings - Fork 14
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
[BUG] useAccount hook only returns mainnet stxAddress #162
Comments
The address will change depending on if you put @Xzirez let me know if this doesn't work for you, or if you have a repo I can look at :) |
@aulneau Thank you for the insight. I put testnet in the network prop, but the useAccount hook still gives me the mainnet stxAddress. I am on version 1.0.4. I can make a minimal reproduction of the issue? I will share some of what I notice in the source code. Keep in mind im new here and mostly worked with EVM.
In case I seem picky, I just wanna mention the library is really clean. Super good job. Just trying to understand some stuff here :) EDIT: I found the client prop so question 2 is obsolete i suppose. |
Wonderful, thank you for all the questions/comments! I love when folks really dig in, so you don't seem picky to me at all :) for question one, you can see here: micro-stacks/packages/core/src/network/index.ts Lines 155 to 162 in d1aad39
The
The tests are spread about, there are many tests for the primary library
can you share more about your use case with this question? |
I would like to contribute yes. It's super nice if I can start with some tests. I will check if there is an issue/bug here :)
It was more a question of DI for testing. If I cannot pass the client/config directly through props it would be harder to test. The more flexibility in composition the easier. For the classes "StacksTestnet" and "StacksMainnet". Im not sure if the testnet inheriting from the mainnet is a good idea. Will there only be two net classes at all times? In EVM the handling of nets and tokens became very complex over time since more and more L2/L3s were introduced. It's one of the main challenges with EVM packages. To support an ever-increasing and changing variety of L2s. I feel it would be wise to keep everything that can change depending on a different token isolated from each other. Again this could be completely redundant, im trying to create some discussion is all. I believe the nets all will follow a similar protocol. |
Awesome, that would be great, please let me know how I can help :)
In the case of
Yeah, I would agree that over time it might be better to do something else, but for now, the keys that differentiate a network are:
Everything else should be generally the same :) as subnets come online, it will likely be good to rethink how this works. |
Hi again, Can i message you somewhere else? I Started testing the useAccount hook, but i likely need some general helper methods to test this efficently, which is where i need some pointers :( |
Sure -- i'm in the stacks discord under the username |
Description: When logging in using testnet the useAccount hook will only return the mainnet stxAddress.
Steps to reproduce:
Im attaching some images from the microstacks template app:
The text was updated successfully, but these errors were encountered: