Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tendermint: Add now_utc method to time::Time #1058

Open
thanethomson opened this issue Dec 15, 2021 · 1 comment
Open

tendermint: Add now_utc method to time::Time #1058

thanethomson opened this issue Dec 15, 2021 · 1 comment
Labels
domain-types Anything relating to the creation, modification or removal of domain types enhancement New feature or request

Comments

@thanethomson
Copy link
Contributor

Version(s) of tendermint-rs: v0.23.x, master

Description

From informalsystems/hermes#1665, it's apparent that we should probably provide a mechanism in the time::Time struct in the tendermint crate to construct the current time in UTC, so we can avoid having to import the time crate to do that and then convert it to a time::Time struct.

A drawback of this, as pointed out by @mzabaluev, is that it needs to be feature-guarded since it requires std.

Definition of "done"

When we have a feature-guarded now_utc method on tendermint::time::Time similar to that which the time crate provides.

@thanethomson thanethomson added enhancement New feature or request domain-types Anything relating to the creation, modification or removal of domain types labels Dec 15, 2021
@seanchen1991
Copy link

It's not clear to me how the proposed now_utc method would defer from the tendermint::time::Time::now method:

pub fn now() -> Time {
OffsetDateTime::now_utc().try_into().unwrap()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain-types Anything relating to the creation, modification or removal of domain types enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants