-
Notifications
You must be signed in to change notification settings - Fork 0
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
[NayNay] Balance for any address & transfer (using only substrate api) #315
Conversation
- updated balance for prg cli to be able to retrieve balance for any address - using newly exposed utility method to getSubstrate from sdk
Build's will continue to fail for this PR until the addition to the sdk is released. |
@mixmix reviewing this |
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.
Excited for this. Needs more tests to prove it works, and needs to not regress the API
merge conflicts now here too @rh0delta |
Found some bugs that I fixed in this PR: #327 |
Found that when I have a newly fauceted account this function doesn't work: ➜ cli git:(mixmix/any-balance) entropy balance --all | jq
[
{
"account": "5HNMFB1fELqSAEMkRtUMA6ACs1jD693h16Gt8ixvBS6csJRq",
"balance": 2,
"symbol": "BITS"
},
{
"account": "5E4DpqmtnxBA6WbExNvFnJv2Hw5BsUpk8KnAVZLbBMWZVTXb",
"balance": 0,
"symbol": "BITS"
}
]
➜ cli git:(mixmix/any-balance) entropy balance 5HNMFB1fELqSAEMkRtUMA6ACs1jD693h16Gt8ixvBS6csJRq | jq
Provided [account=5HNMFB1fELqSAEMkRtUMA6ACs1jD693h16Gt8ixvBS6csJRq] is not a valid substrate address |
yeah have tried with a registered account and still getting that error "not a valid substrate address" |
ok fixed it in that PR : 619ff78 @rh0delta I've seen us slip with if/ else + boolean logic a couple times now. I didn't spot it either till I did some closer testing. I think we need to EITHER write tests over such things, OR try to write much simpler (and more verbose) if/ else if/ else logic. Have a look at the solution in that linked commit. It's more nesting, but more clear (to me at least) |
* fix getTokenDetail calls, fix faucet sendMoney... * ensure load-entropy works with default account (selectedAccount) * ensure register works with default account (selectedAccount) * fix transfer relying on opts.account * fix balance account-checking logic
- updated trasnfer to only need substrate rather than the entire entropy instance
Mix to re-review |
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.
I like this, it's really interesting seeing how little we might need the full SDK... also begs the question "what is it even used for", "what is our policy for when we use SDK and when we use raw substrate?"
I'd like to see us not go to full class methods - I think keeping some of the pattern of EntropyBase
but making a SubstrateBase
class that we inherit from will keep the patterns of the repo more coherent and give use support for the logging and other things that we need, tidy up need to pass around substrate
etc.
Have left more notes and thinking as I went with more detail.
Nice work!
[NayNay] Only substrate
changes made, mix ooo, need a review from frankie
you probably asking this because you have'nt needed to deal with signing. The sdk is meant to make signing and the format checking of registering with programs simple. |
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.
Looks good to me thanks for the work!
Related Issue(s)
entropy balance <address>
should take any address #237Proposed Changes
Testing
Screenshots (if applicable)
Additional Context
Checklist
CHANGELOG.md
entry.github.com:entropyxyz/entropy-docs
, where necessary.