centrifuge / centrifuge-chain

Centrifuge Chain: the layer-1 blockchain for real-world assets, built on Substrate.
https://centrifuge.io
GNU Lesser General Public License v3.0
182 stars 78 forks source link

Experimental: Strongly typed types of time #1907

Open lemunozm opened 2 months ago

lemunozm commented 2 months ago

Description

The idea of this PR is to have Millis and Seconds as different types for the compiler. This helps to never mix by error different duration units and improve the readability of some parts of the codebase.

To achieve this, we need:

How times should be used now in the code base?

Blockers

~It seems like parity_scale_codec doesn't allow to implement HasCompact trait required by BasicArithmetic:~

Remainders