hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
438 stars 280 forks source link

refactor: Use `SystemTime` for timestamps #5015

Open dima74 opened 1 month ago

dima74 commented 1 month ago

Context

Fixes #4729

Solution

Use std::time::SystemTime for time stamps instead of std::time::Duration.

Migration Guide (optional)

Review notes (optional)

Checklist

0x009922 commented 1 month ago

From SDK standpoint, it can be useful to clearly see the separation between durations and timestamps in the schema. Currently they are just *_ms: u64 fields.

dima74 commented 1 month ago

From SDK standpoint, it can be useful to clearly see the separation between durations and timestamps in the schema. Currently they are just *_ms: u64 fields.

One option I see here is to create DurationMs and TimestampMs newtype wrappers for u64 and use them correspondingly

0x009922 commented 1 month ago

One option I see here is to create DurationMs and TimestampMs newtype wrappers for u64 and use them correspondingly

That would be helpful.