agicommies / community-proposals

The Unlicense
0 stars 3 forks source link

Compute dates based on block #13

Open steinerkelvin opened 2 months ago

steinerkelvin commented 2 months ago

image

But how?

We can probably just multiply by the average block time. We just need to make sure it's sufficiently close to the actual target block time of 8 seconds.

rad2520 commented 2 months ago

think its fine to assume 8 second blocktime, so the date / hours left doesnt increase and confuse people. also chain has been hitting the target blocktime pretty reliably. should be sufficient to just display hours left till expiration

EdSDR commented 2 months ago

async function getTimeRemaining(expirationBlock: number) { return (expirationBlock - blockNumber) * 8; }