gnolang / gnonative

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

Chore: Add HasByName, etc. Update go.mod replace for berty/gno #66

Closed jefft0 closed 11 months ago

jefft0 commented 11 months ago

This pull request adds HasByName and other fixes. It has three commits:

  1. Use the latest go.mod replace berty/gno v0.0.6 . This includes HasByName, HasByAddress and HasByNameOrAddress. It also has the bug fix for GetByAddress to return the error ErrKeyNotFound same as GetByName. Therefore, we update GetByAddress in api.go to check for this and return rpc.ErrCode_ErrCryptoKeyNotFound.
  2. The Keybase method GetByAddress takes a crypto.Address. However in PR #64, we used a bech32 string address for GetKeyInfoByAddress. But it should take a byte array address, just like the Keybase method and like queryAccount. This is the same byte array address in the response to GetByKeyInfoByName, etc. (Currently the UI doesn't use GetKeyInfoByAddress so this change shouldn't affect the front end.)
  3. Finally, add support for HasByName, HasByAddress and HasByNameOrAddress.