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

refactor: update ark decimals to 18 and new helpers #114

Merged
merged 22 commits into from
Nov 18, 2024

Conversation

patricio0312rev
Copy link
Contributor

@patricio0312rev patricio0312rev commented Nov 18, 2024

[psdk] handle decimals (18) & [psdk] add formatter methods

Changes

  • The number of decimals for the ark mainnet and devnet has been updated from 1e8to 1e18.
  • New constants for the different multipliers and their decimals.
  • New formatUnits and parseUnits methods based on the ones created in PHP.
  • Unit tests have been created and updated to support these changes.

@@ -13,10 +13,10 @@ export * from "./cast-array.js";
export * from "./censor.js";
export * from "./chars.js";
export * from "./chunk.js";
export * from "./clone.js";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The changes here were made by my autoformatter on save 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

aren't these obsolete now you don't include it anymore in the helper package? 🤔

@patricio0312rev patricio0312rev marked this pull request as ready for review November 18, 2024 15:07
packages/mainsail/source/helpers/format-units.test.ts Outdated Show resolved Hide resolved
packages/mainsail/source/helpers/parse-units.test.ts Outdated Show resolved Hide resolved
packages/mainsail/source/helpers/parse-units.ts Outdated Show resolved Hide resolved
packages/mainsail/source/helpers/format-units.ts Outdated Show resolved Hide resolved
@ItsANameToo ItsANameToo marked this pull request as draft November 18, 2024 15:30
@@ -0,0 +1,16 @@
import { formatUnits } from "./format-units";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see the tests aren't configured yet for mainsail. Should I remove these files until then? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

issue is that the mainsail package is a copy of ark and not everything may work. I'll add a card though to enable tests based on the areas that are working so those run at least

@patricio0312rev patricio0312rev marked this pull request as ready for review November 18, 2024 15:51
@ItsANameToo ItsANameToo merged commit 47e0251 into feat/mainsail-evm Nov 18, 2024
2 checks passed
@ItsANameToo ItsANameToo deleted the refactor/update-decimals-and-helpers branch November 18, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants