8000 domain-manager: fix expiry value in table by rithvikvibhu · Pull Request #326 · kyokan/bob-wallet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

domain-manager: fix expiry value in table #326

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

Merged
merged 1 commit into from
Apr 18, 2021

Conversation

rithvikvibhu
Copy link
Collaborator

Fixes #318.

Uses ns.renewal and the network's renewalWindow instead of ns.height.

image
image
(for ref, taken today - 2020-04-08)

return (
<TableRow key={`${name}`} >
<TableItem>{formatName(name)}</TableItem>
<TableItem>
<Blocktime
height={names[name].height + 105120}
height={names[name].renewal + networks[network].names.renewalWindow}
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks right to me - untested ACK 👍

@pinheadmz
Copy link
Contributor

There's also a big stats object in every namestate by the way that has a lot of these kinds of things computed already (this may even help simplify the code around bid / reveal phase etc in other parts of Bob):

See the very bottom of this JSON:

$ hsd-rpc getnameinfo bob
{
  "start": {
    "reserved": false,
    "week": 25,
    "start": 27216
  },
  "info": {
    "name": "bob",
    "nameHash": "b5d577dc9ce59725e29886632e69ecdf3b6ca49c0a14f4315a2404fc1508672d",
    "state": "CLOSED",
    "height": 27236,
    "renewal": 29434,
    "owner": {
      "hash": "10a6b35f3ebe86996357f911b319fd4a49894810bec171ed701b1963c0348465",
      "index": 0
    },
    "value": 4096000000,
    "highest": 5000000000,
    "data": "0002036e733103626f62002ce706b701c002",
    "transfer": 0,
    "revoked": 0,
    "claimed": 0,
    "renewals": 0,
    "registered": true,
    "expired": false,
    "weak": false,
    "stats": {
      "renewalPeriodStart": 29434,
      "renewalPeriodEnd": 134554,
      "blocksUntilExpire": 71995,
      "daysUntilExpire": 499.97
    }
  }
}

@rithvikvibhu
Copy link
Collaborator Author

Nice to have those stats, and I think they even change based on the name's current state.

The table in Domain Manager gets the details with getnames and that doesn't have stats. Instead of making getnameinfo calls for each of name, this felt simpler/easier.

@chikeichan chikeichan merged commit ec974ad into kyokan:master Apr 18, 2021
@rithvikvibhu rithvikvibhu deleted the expiry-time branch April 18, 2021 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inaccurate domain expiry time [v0.7.0-rc.2]
3 participants
0