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

Bug fix for non-checksummed address #236

Merged
merged 4 commits into from
Jan 24, 2025
Merged

Bug fix for non-checksummed address #236

merged 4 commits into from
Jan 24, 2025

Conversation

milan-cb
Copy link
Contributor

@milan-cb milan-cb commented Jan 24, 2025

What changed? Why?

There was a bug in the from_model function in asset.py. On the backend side, any asset id is checksummed before retrieving its details, and when it returns a response to the SDK, its asset id is also checksummed. When a user enters a non-checksummed address, they will get an error since those two asset ids are not equivalent.

This change will allow users to use non-checksummed addresses without getting erroneous errors in their workflow.

Before:

>>> wallet.balance('0x8309fbdf021edf768dc13195741940ba544dea98')

ArgumentError: Unsupported asset ID: 0x8309fbdf021edf768dc13195741940ba544dea98

After:

>>> wallet.balance('0x8309fbdf021edf768dc13195741940ba544dea98')

0.0

Qualified Impact

This change should not be a breaking change for the SDK. The same logic of the check for asset ids exists, but with the normalization of cases, it prevents the bug of non-checksummed addresses and checksummed addresses being considered as unequal.

@milan-cb milan-cb changed the title Milan/psdk 894 Bug fix for non-checksummed address Jan 24, 2025
@alex-stone
Copy link
Contributor

Can we bump the version number on the release branch to mirror the other SDKs?

@milan-cb milan-cb changed the base branch from v0.15.0 to v0.16.0 January 24, 2025 19:00
@milan-cb milan-cb merged commit 5ca82b7 into v0.16.0 Jan 24, 2025
10 checks passed
@milan-cb milan-cb deleted the milan/PSDK-894 branch January 24, 2025 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants