-
Notifications
You must be signed in to change notification settings - Fork 9
feat: Use any activated account #172
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
f075c32 to
04acf2e
Compare
…p addr in userAccounts. See the PR. Signed-off-by: Jeff Thompson <jeff@thefirst.org>
ce2b149 to
af7dd8d
Compare
…gner). See the PR Signed-off-by: Jeff Thompson <jeff@thefirst.org>
… PR. Signed-off-by: Jeff Thompson <jeff@thefirst.org>
af7dd8d to
2284a81
Compare
D4ryl00
approved these changes
Sep 3, 2024
Contributor
D4ryl00
left a comment
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.
LGTM
jefft0
added a commit
to jefft0/gnonative
that referenced
this pull request
Sep 4, 2024
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
jefft0
added a commit
that referenced
this pull request
Sep 4, 2024
PR #172 update the API to support using any activated account. We need to update the expo provider to the same API. This PR has 3 commits: 1. Update go.mod to use the latest gnokey-mobile following changes in PR gnolang/gnokey-mobile#9 2. In expo, npm install the latest gnolang_gnonative.bufbuild_es and connectrpc_es to access the new API 3. Update expo/src/api/GnoNativeApi.ts to match the new API to use any activated account, specified by address. Note that the address parameters are optional for temporary backwards compatibility. When dSocial and Gnokey Mobile are updated to use the new API and specify the address, we will do a PR to require the address parameter, and to remove the deprecated `selectAccount` and `getActiveAccount`. --------- Signed-off-by: Jeff Thompson <jeff@thefirst.org>
|
🎉 This PR is included in version 1.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We want to use Gno Native Kit as a service where multiple clients are interacting with it simultaneously. Therefore we want to move away from the statefulness of the "active account", and instead require the client to specify the address of the account to use on each call. This PR adds this functionality but still supports the "active account". (We will remove "active account" when dSocial and Gnokey Mobile are changed to use the new API). This PR has four commits:
HasKeyByNameonly need to interact with the Keybase (not the RPC connection or signing). IngnoNativeService, add the fieldkeybaseand use this where possible instead ofgetSigner().Keybase. This is helpful because we will changegetSigner.userAccountstruct currently holds thepassword. We change this to hold thesigner(which has the password inside). IngnoNativeService, we also save thechainIDseparately. WhenSelectAccountRequestcreates a newuserAccount, create a new signer including thechainID. ChangegetSignerto take an account address and use this to look up the signer ins.userAccounts. For temporary backwards comptability, if the address is nil then use the active account.gnoNativeService, change the gnomobileclientfield to only hold therpcClient. ChangegetClientto take an optionalsignerand to return a newgnoclient.Clientwith thesignerand therpcClient. InCall,SendandRun, usegetSignerto use theCallerAddressif available (instead of the "active account").ActivateAccountandGetActivatedAccount. DeprecateSelectAccountandGetActiveAccount. See rpc.proto for details. In gnonativetypes.go, add anAddressfield toSetPasswordRequest,UpdatePasswordRequestandSignTxRequest. Use this address ingetSigner. Update the interface forGnoNativeService.ClientSignTxto take the address.(Due to circular dependencies with gnokey-mobile, this PR doesn't update the expo module. We'll do another PR.)