Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
32ac2555
Unverified
Commit
32ac2555
authored
Oct 19, 2020
by
Shane Fontaine
Committed by
GitHub
Oct 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve displayed proposal end time accuracy (#1173)
parent
50a599c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
index.ts
src/constants/index.ts
+4
-2
VotePage.tsx
src/pages/Vote/VotePage.tsx
+2
-2
No files found.
src/constants/index.ts
View file @
32ac2555
...
@@ -20,8 +20,10 @@ export const MKR = new Token(ChainId.MAINNET, '0x9f8F72aA9304c8B593d555F12eF6589
...
@@ -20,8 +20,10 @@ export const MKR = new Token(ChainId.MAINNET, '0x9f8F72aA9304c8B593d555F12eF6589
export
const
AMPL
=
new
Token
(
ChainId
.
MAINNET
,
'
0xD46bA6D942050d489DBd938a2C909A5d5039A161
'
,
9
,
'
AMPL
'
,
'
Ampleforth
'
)
export
const
AMPL
=
new
Token
(
ChainId
.
MAINNET
,
'
0xD46bA6D942050d489DBd938a2C909A5d5039A161
'
,
9
,
'
AMPL
'
,
'
Ampleforth
'
)
export
const
WBTC
=
new
Token
(
ChainId
.
MAINNET
,
'
0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599
'
,
18
,
'
WBTC
'
,
'
Wrapped BTC
'
)
export
const
WBTC
=
new
Token
(
ChainId
.
MAINNET
,
'
0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599
'
,
18
,
'
WBTC
'
,
'
Wrapped BTC
'
)
// TODO this is only approximate, it's actually based on blocks
// Block time here is slightly higher (~1s) than average in order to avoid ongoing proposals past the displayed time
export
const
PROPOSAL_LENGTH_IN_DAYS
=
7
export
const
AVERAGE_BLOCK_TIME_IN_SECS
=
14
export
const
PROPOSAL_LENGTH_IN_BLOCKS
=
40
_320
export
const
PROPOSAL_LENGTH_IN_SECS
=
AVERAGE_BLOCK_TIME_IN_SECS
*
PROPOSAL_LENGTH_IN_BLOCKS
export
const
GOVERNANCE_ADDRESS
=
'
0x5e4be8Bc9637f0EAA1A755019e06A68ce081D58F
'
export
const
GOVERNANCE_ADDRESS
=
'
0x5e4be8Bc9637f0EAA1A755019e06A68ce081D58F
'
...
...
src/pages/Vote/VotePage.tsx
View file @
32ac2555
...
@@ -16,7 +16,7 @@ import ReactMarkdown from 'react-markdown'
...
@@ -16,7 +16,7 @@ import ReactMarkdown from 'react-markdown'
import
VoteModal
from
'
../../components/vote/VoteModal
'
import
VoteModal
from
'
../../components/vote/VoteModal
'
import
{
TokenAmount
,
JSBI
}
from
'
@uniswap/sdk
'
import
{
TokenAmount
,
JSBI
}
from
'
@uniswap/sdk
'
import
{
useActiveWeb3React
}
from
'
../../hooks
'
import
{
useActiveWeb3React
}
from
'
../../hooks
'
import
{
PROPOSAL_LENGTH_IN_
DAY
S
,
COMMON_CONTRACT_NAMES
,
UNI
,
ZERO_ADDRESS
}
from
'
../../constants
'
import
{
PROPOSAL_LENGTH_IN_
SEC
S
,
COMMON_CONTRACT_NAMES
,
UNI
,
ZERO_ADDRESS
}
from
'
../../constants
'
import
{
isAddress
,
getEtherscanLink
}
from
'
../../utils
'
import
{
isAddress
,
getEtherscanLink
}
from
'
../../utils
'
import
{
ApplicationModal
}
from
'
../../state/application/actions
'
import
{
ApplicationModal
}
from
'
../../state/application/actions
'
import
{
useModalOpen
,
useToggleDelegateModal
,
useToggleVoteModal
}
from
'
../../state/application/hooks
'
import
{
useModalOpen
,
useToggleDelegateModal
,
useToggleVoteModal
}
from
'
../../state/application/hooks
'
...
@@ -122,7 +122,7 @@ export default function VotePage({
...
@@ -122,7 +122,7 @@ export default function VotePage({
// get and format date from data
// get and format date from data
const
startTimestamp
:
number
|
undefined
=
useTimestampFromBlock
(
proposalData
?.
startBlock
)
const
startTimestamp
:
number
|
undefined
=
useTimestampFromBlock
(
proposalData
?.
startBlock
)
const
endDate
:
DateTime
|
undefined
=
startTimestamp
const
endDate
:
DateTime
|
undefined
=
startTimestamp
?
DateTime
.
fromSeconds
(
startTimestamp
).
plus
({
days
:
PROPOSAL_LENGTH_IN_DAY
S
})
?
DateTime
.
fromSeconds
(
startTimestamp
).
plus
({
seconds
:
PROPOSAL_LENGTH_IN_SEC
S
})
:
undefined
:
undefined
const
now
:
DateTime
=
DateTime
.
local
()
const
now
:
DateTime
=
DateTime
.
local
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment