Skip to content
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

feat: implement check sum reporting and update default target #210

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

kayagokalp
Copy link
Member

This PR implements couple of things:

  1. Adds a new target
  2. Adds checksum routines at places where we print user account, and accept user account (transfer to address).
  3. Bumps sdk version to latest, 0.66.8.

Checksum support

  1. At the places where we output hex address we now output checksum encoded hex address so that copied and pasted into any other wallet, users will not face any warning.
  2. At places where we accept a user account address, (currently only transfer's to field), we query the provider to see if this account actually belongs to an user (i.e it is not a blob id, contract id etc).

I needed to add an unwrap, at a place where I am sure that the result is not going to be failing. After this release I will remove it by rewriting the transfer section of the wallet.

We first check if the checksum is valid while parsing the To field. If that is not the case that is an immediate error. If it is indeed with the correct checksum then we proceed to querying the provider to see if it is an actual address.

Couple of examples

Here I try to transfer some funds to a contract, which has invalid

image

Here i try to transfer to my account with valid check sum.

image

@kayagokalp kayagokalp added enhancement New feature or request breaking This is a breaking change labels Oct 14, 2024
@kayagokalp kayagokalp self-assigned this Oct 14, 2024
@kayagokalp kayagokalp changed the title feat: implement check sum for reporting user accounts and check if transfer goes to correct address feat: implement check sum reporting and update target Oct 14, 2024
@kayagokalp kayagokalp changed the title feat: implement check sum reporting and update target feat: implement check sum reporting and update default target Oct 14, 2024
@kayagokalp kayagokalp requested a review from a team October 14, 2024 21:38
Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

Copy link
Member

@JoshuaBatty JoshuaBatty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clear PR description. Looks good

@kayagokalp kayagokalp merged commit e51eda8 into master Oct 14, 2024
12 checks passed
@kayagokalp kayagokalp deleted the kayagokalp/check_sum branch October 14, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This is a breaking change enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants