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: fungible metadata amount utils + get_route_ui_fields() FFI #78

Merged
merged 11 commits into from
Dec 9, 2024

Conversation

chris13524
Copy link
Member

@chris13524 chris13524 commented Dec 5, 2024

  • Adds decimals field so Blockchain API can return this
  • Adds to_[bridging_fee_]amount() utils to get formatted values
  • Add get_route_ui_fields() FFI

@chris13524 chris13524 self-assigned this Dec 5, 2024
@chris13524 chris13524 force-pushed the feat/fungible-metadata-amount-utils branch from 8017600 to e2f33b2 Compare December 5, 2024 14:46
@chris13524 chris13524 force-pushed the feat/fungible-metadata-amount-utils branch from e2f33b2 to 5eb523d Compare December 5, 2024 14:47
@chris13524 chris13524 changed the title feat: fungible metadata amount utils feat: fungible metadata amount utils + get_route_ui_fields() FFI Dec 5, 2024
.github/workflows/ci.yml Outdated Show resolved Hide resolved
serialize_with = "crate::utils::serialize_unit"
)]
#[serde(default = "default_unit")]
pub decimals: Unit,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe we can use U8 here instead?

Copy link
Member Author

@chris13524 chris13524 Dec 9, 2024

Choose a reason for hiding this comment

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

Why? I think we should use Unit since it's alloy's type to represent these decimals. It has built-in assertions that the value is less than 77, so we know it's a valid unit. Rust code can also have fewer error conditions when this type is already being used by calling code.

@chris13524 chris13524 force-pushed the feat/fungible-metadata-amount-utils branch from 91fc711 to 7ab64ef Compare December 9, 2024 16:24
@chris13524 chris13524 merged commit 65928eb into main Dec 9, 2024
6 of 7 checks passed
@chris13524 chris13524 deleted the feat/fungible-metadata-amount-utils branch December 9, 2024 18:04
@jakubuid jakubuid restored the feat/fungible-metadata-amount-utils branch December 10, 2024 13:06
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.

4 participants