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

Fix Asset from_model bug to use passed in asset_id when initializing #46

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

rohan-agarwal-coinbase
Copy link
Contributor

What changed? Why?

  • Right now, we use the passed in asset_id to set the decimals correctly. We don't however set the asset_id. Ruby SDK does this correctly:
        new(
          network: Coinbase.to_sym(asset_model.network_id),
          asset_id: asset_id || Coinbase.to_sym(asset_model.asset_id),
          address_id: asset_model.contract_address,
          decimals: decimals
        )

Testing

Updated unit tests to assert the asset ID in test_asset.py, which confirmed the bug. Tests now pass. Had to also update test_balance.py which actually asserted that the asset_id stored on a balance was different than the model asset, which was wrong.

Qualified Impact

@rohan-agarwal-coinbase rohan-agarwal-coinbase merged commit a6b3587 into v0.11.0 Nov 21, 2024
5 checks passed
@alex-stone alex-stone mentioned this pull request Nov 27, 2024
alex-stone added a commit that referenced this pull request Nov 27, 2024
* Fix Asset from_model bug to use passed in asset_id when initializing (#46)

* Support for fund and quote_fund for wallet funding (#47)

* Fix quote fund to properly pass in normalized amount (#50)

* Contract webhook support (#52)

* contract activity webhook support

* Update webhook.py

* Update webhook_factory.py

* chore: Prep v0.11.0 release (#51)

---------

Co-authored-by: rohan-agarwal-coinbase <[email protected]>
Co-authored-by: cb-howardatcb <[email protected]>
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