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

Changed return for cli query clientCt… #629

Merged
merged 3 commits into from
May 30, 2022

Conversation

Prosp3r
Copy link
Contributor

@Prosp3r Prosp3r commented May 27, 2022

Changed return for query epoch-infos which uses the method clientCtx.PrintProto(&res.Params) to clientCtx.PrintObjectLegacy(&res.Params) emulating the governance module to return the time in nanosecond(int64) string format.

For example:
evmosd query epochs epoch-infos --node=http://localhost:26657/ --chain-id=evmos_9000-4
would have produced the following response with duration in seconds:

epochs:
- current_epoch: "1"
  current_epoch_start_height: "1"
  current_epoch_start_time: "2022-05-27T15:30:52.675900Z"
  duration: 86400s
  epoch_counting_started: true
  identifier: day
  start_time: "2022-05-27T15:30:52.675900Z"
- current_epoch: "1"
  current_epoch_start_height: "1"
  current_epoch_start_time: "2022-05-27T15:30:52.675900Z"
  duration: 604800s
  epoch_counting_started: true
  identifier: week
  start_time: "2022-05-27T15:30:52.675900Z"
pagination:
  next_key: null
  total: "2"

With this update it now returns the following response with duration in nanoseconds:

epochs:
- current_epoch: "1"
current_epoch_start_height: "1"
current_epoch_start_time: "2022-05-27T20:36:06.837848Z"
duration: "86400000000000"
epoch_counting_started: true
identifier: day
start_time: "2022-05-27T20:36:06.837848Z"
- current_epoch: "1"
current_epoch_start_height: "1"
current_epoch_start_time: "2022-05-27T20:36:06.837848Z"
duration: "604800000000000"
epoch_counting_started: true
identifier: week
start_time: "2022-05-27T20:36:06.837848Z"
pagination:
total: "2"

…x.PrintProto(&res.Params) to return clientCtx.PrintObjectLegacy(&res.Params) emulating the governance module to return the time in nanosecond stringifies int64
@linear
Copy link

linear bot commented May 27, 2022

ENG-383 epochs: Fix durations denominated in nanoseconds

All durations should be denominated in seconds and should be consistent with the units returned via RPC calls.

There is an inconsistency in how we denominate units for the claims periods. They should be inputted as nanoseconds in proposals, and show up as nanoseconds

@github-actions github-actions bot added the CLI label May 27, 2022
@Prosp3r Prosp3r marked this pull request as ready for review May 27, 2022 20:42
@Prosp3r Prosp3r changed the title Changed return for cli query GetCmdQueryParams() from return clientCt… Changed return for cli query clientCt… May 27, 2022
@jolube
Copy link
Contributor

jolube commented May 27, 2022

Thanks for this change! Mostly LGTM, but could you include an example of how the query response has changed in the PR description? A before and after version of the response should suffice.

Copy link
Contributor

@danburck danburck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Prosp3r Prosp3r merged commit 150082f into main May 30, 2022
@Prosp3r Prosp3r deleted the ENG-383-epochs-fix-durations-denominated-in-nanoseconds branch May 30, 2022 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants