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 #91

Merged
merged 3 commits into from
Jan 24, 2025
Merged

Bug fix for non-checksummed address #91

merged 3 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')

ValueError: Unsupported asset ID: 0x8309fbdf021edf768dc13195741940ba544dea98

Now:

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

Decimal('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 chore: fixed casing error for assetids Bug fix for non-checksummed address Jan 24, 2025
@cb-heimdall
Copy link

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@milan-cb milan-cb merged commit be17450 into v0.16.0 Jan 24, 2025
8 checks passed
milan-cb added a commit that referenced this pull request Jan 29, 2025
* Bug fix for non-checksummed address (#91)

* chore: fixed casing error for assetids

* updated changelog

* edited changelog to unreleased

* chore: added USDC gasless transfer e2e test (#92)

* chore: added USDC gasless transfer e2e test

* unset dev configuration for sdk

* updated CHANGELOG

* Milan/v0.16.0 release prep (#93)

* skipped gasless transfer test

* chore: bumped version to v0.16.0
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.

3 participants