Replace use of `Duration` for timestamps with an actual timestamp, e.g. `chrono::DateTime`
In some places in iroha_data_model, structures use Duration for data which doesn't mean a span of time, but actually means a timestamp. Examples:
start: https://github.com/hyperledger/iroha/blob/4362c9427fa8b4090676ac46e8171ef5f1995ff6/data_model/src/events/time.rs#L100-L105since: https://github.com/hyperledger/iroha/blob/4362c9427fa8b4090676ac46e8171ef5f1995ff6/data_model/src/events/time.rs#L126-L131
These fields are timestamps, not time spans.
I propose to use a structure that is designed specifically for timestamps, e.g. chrono::DateTime.
Can I work on this issue? I can help around this
Hi @hollermay, feel free to open a PR.
start should become start_ms and since should become since_ms. However, getters should return something like chrono::DateTime
@hollermay should I assign you?
startshould becomestart_msandsinceshould becomesince_ms. However, getters should return something likechrono::DateTime@hollermay should I assign you?
Sure I can give a shot
also do the same for SignedTransactionV1::creation_time_ms and SignedBlockV1::timestamp_ms
@mversic please check the pull request
u64 is used for timestamps after #4841:
https://github.com/hyperledger/iroha/blob/a27bc2eaa7e3cfab6c35cae3b2bcace63a3fee2b/data_model/src/events/time.rs#L100-L105
@mversic should this issue be closed?
No, it's still valid
https://github.com/hyperledger-iroha/iroha/pull/5015#issuecomment-3050490455