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

[0.40.0] Update SDK v0.39.0 -> v0.40.0 #80

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

joel-u410
Copy link
Contributor

Including the following changes:

  • Update for 0.40.0 compatibility
  • Implement serialization for Transfer
  • Rename transparent_transfer -> transfer

This is roughly similar to #69 but with a couple notable differences:

  • Serialization is implemented for Transfer based on @mateuszjasiuk's implementation but slightly changed (see below)
  • The transparent_transfer enum value is renamed to transfer in the schema

Serialization example for Transfer (formatted for readability):

{
  "sources": [
    {
      "amount": "100.000000",
      "token": "tnam1q87wtaqqtlwkw927gaff34hgda36huk0kgry692a",
      "owner": "tnam1qrcqrpj8r8lv6632wcwv9j0r6pp4n3xsug9hkxzx"
    }
  ],
  "targets": [
    {
      "amount": "100.000000",
      "token": "tnam1q87wtaqqtlwkw927gaff34hgda36huk0kgry692a",
      "owner": "tnam1qq0t2s4dmqvxqwl25fm3eyckgekgftggfg9nfe5h"
    }
  ],
  "shielded_section_hash": null
}

I changed the BTreeMap<Account, DenominatedAmount> to a list of { amount, token, owner } objects instead of a map with the account as key -- in my opinion, it will be easier for consumers to parse the data that way. Thoughts?

Copy link
Collaborator

@mateuszjasiuk mateuszjasiuk left a comment

Choose a reason for hiding this comment

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

@joel-u410 Thanks! Tested and it looks great. I would not rename TransparentTransfer to Transfer as it's closer to what we have in the namada sdk atm

As a side note, if you plan to contribute in the future, you do not have to care about breaking changes to migrations(or any other breaking change) up the the point of first release.

@sirouk Thanks again for your contribution. I will close #69 in favor of this one, as it's almost done.

@joel-u410
Copy link
Contributor Author

joel-u410 commented Jul 22, 2024

I would not rename TransparentTransfer to Transfer as it's closer to what we have in the namada sdk atm

Ok, no problem, I can rename it back. Should I also revert the enum change in the schema migrations?

@joel-u410
Copy link
Contributor Author

@mateuszjasiuk see the latest commit -- is this what you had in mind?

@mateuszjasiuk
Copy link
Collaborator

Yup! This is great. Thank you :)

@mateuszjasiuk
Copy link
Collaborator

Ah run just clippy and fix warnings

auto-merge was automatically disabled July 23, 2024 15:24

Head branch was pushed to by a user without write access

@joel-u410
Copy link
Contributor Author

Ah run just clippy and fix warnings

Ah yes, forgot about clippy -- done!

Including:

* Update for 0.40.0 compatibility
* Implement serialization for Transfer
* Rename transparent_transfer -> transfer
@joel-u410
Copy link
Contributor Author

And just rebased to latest main

@mateuszjasiuk mateuszjasiuk added this pull request to the merge queue Jul 23, 2024
Merged via the queue into anoma:main with commit c897ef5 Jul 23, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants