gnolang / gnonative

Develop for Gno using your app's native language
Apache License 2.0
9 stars 9 forks source link

Chore: Add HasPassword, update go.mod replace for berty/gno #59

Closed jefft0 closed 11 months ago

jefft0 commented 11 months ago

This pull request resolves issue #57. It has three commits:

  1. Add field HasPassword in SelectAccountResponse and GetActiveAccountResponse. Run make generate.
  2. In api.go, set the HasPassword field in the response to SelectAccountResponse and GetActiveAccountResponse. in Call, return gRPC errors for ErrUnknownAddress and ErrDecryptionFailed. In use-gno.ts, make selectAccount return SelectAccountResponse and make getActiveAccount return GetActiveAccountResponse because these have the hasPassword field. Therefore, in home/index.tsx we update the call to getActiveAccount to check response.key. Finally, add "TODO" comments where the UI needs to have the user enter the password.
  3. Use the latest go.mod replace berty/gno v0.0.3 . This has the bug fix for checking if Call returns ErrWrongPassword.