native-token: Deprecate float usage, add str usage#171
native-token: Deprecate float usage, add str usage#171joncinque merged 1 commit intoanza-xyz:masterfrom
Conversation
#### Problem The `sol_to_lamports` and `lamports_to_sol` functions are problematic because they use floats, which are not precise. #### Summary of changes Deprecate the functions, and add versions that use strings instead.
rustopian
left a comment
There was a problem hiding this comment.
Correct, good tests, all works great.
|
Oops, @tao-stones your review is still requested directly, my bad on triggering auto-merge |
|
Ah darn, sorry -- for the first point, we'll get a warning on removal, which will fail CI, so we can't forget to remove the const. And for the second point, I wasn't aware of that function... I guess the options are to either include a bool flag (edit: in this new function), or just remove it and tell people to use |
tao-stones
left a comment
There was a problem hiding this comment.
Changes to fee-structure is good.
no worries! i'm the idiot that didn't hit the comment button
👍
yeah agreed. i think we should stick one implementation to avoid all of the caveats of replicode. ... though i could be convinced that build balance message belongs in a different crate 🤔 |
|
Well, I put in #174 so we can discuss there |
#### Problem The `sol_to_lamports` and `lamports_to_sol` functions are problematic because they use floats, which are not precise. #### Summary of changes Deprecate the functions, and add versions that use strings instead.
* remove `OptionalNonZeroElGamalPubkey` in `spl-pod` * add `derive` feature on serde * cargo fmt
* remove `OptionalNonZeroElGamalPubkey` in `spl-pod` * add `derive` feature on serde * cargo fmt
* remove `OptionalNonZeroElGamalPubkey` in `spl-pod` * add `derive` feature on serde * cargo fmt
* remove `OptionalNonZeroElGamalPubkey` in `spl-pod` * add `derive` feature on serde * cargo fmt
* remove `OptionalNonZeroElGamalPubkey` in `spl-pod` * add `derive` feature on serde * cargo fmt

Problem
The
sol_to_lamportsandlamports_to_solfunctions are problematic because they use floats, which are not precise.Summary of changes
Deprecate the functions, and add versions that use strings instead.
Added @tao-stones to check the
FeeStructurechange -- it looks likeFeeStructure::newis only used in one test.