maidsafe / sn_dbc

Safe Network DBCs
BSD 3-Clause "New" or "Revised" License
15 stars 16 forks source link

feat: simplify Denomination to use powers-of-ten with exponent #97

Closed dan-da closed 3 years ago

dan-da commented 3 years ago

See the lengthy comment in amount.rs for explanation of the approach. The biggest thing is that Amount changes from a u128 alias to struct Amount{ count: u32, unit: i8 }. This is a different way of representing transactable amounts.

This is a draft PR because mint-repl and bench are not working yet. Also the approach is still being discussed by the team.

dan-da commented 3 years ago

I think this could be merged now. mint-repl, bench, and remaining tests can be made compatible with separate PRs.