hyperledger / iroha

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

Replace use of `Duration` for timestamps with an actual timestamp, e.g. `chrono::DateTime` #4729

Open 0x009922 opened 3 weeks ago

0x009922 commented 3 weeks ago

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:

These fields are timestamps, not time spans.

I propose to use a structure that is designed specifically for timestamps, e.g. chrono::DateTime.

hollermay commented 2 weeks ago

Can I work on this issue? I can help around this

nxsaken commented 2 weeks ago

Hi @hollermay, feel free to open a PR.

mversic commented 2 weeks ago

start should become start_ms and since should become since_ms. However, getters should return something like chrono::DateTime

@hollermay should I assign you?

hollermay commented 2 weeks ago

start should become start_ms and since should become since_ms. However, getters should return something like chrono::DateTime

@hollermay should I assign you?

Sure I can give a shot

mversic commented 2 weeks ago

also do the same for SignedTransactionV1::creation_time_ms and SignedBlockV1::timestamp_ms

hollermay commented 1 week ago

@mversic please check the pull request