2019-10-28 23:43:19 -07:00
import { getNetworkFullName } from './utils'
2018-07-12 05:40:39 -07:00
let messages = { }
messages . invalidVotingKeyMsg = key => {
2019-10-28 23:43:19 -07:00
return ` The key ${ key } is not valid Voting Key! Please make sure you have loaded correct Voting Key in MetaMask. `
2018-07-12 05:40:39 -07:00
}
messages . VOTED _SUCCESS _MSG = 'You successfully voted'
messages . BALLOT _CREATED _SUCCESS _MSG = 'You successfully created a new ballot'
messages . FINALIZED _SUCCESS _MSG = 'You successfully finalized'
2018-09-19 00:54:31 -07:00
messages . CANCELED _SUCCESS _MSG = 'You successfully canceled'
2018-07-12 05:40:39 -07:00
messages . ALREADY _FINALIZED _MSG = 'This ballot is already finalized'
messages . INVALID _VOTE _MSG = "You can't vote on this ballot"
messages . INVALID _FINALIZE _MSG = "You can't finalize this ballot"
2018-09-19 00:54:31 -07:00
messages . INVALID _CANCEL _MSG = "You can't cancel this ballot"
2018-07-12 05:40:39 -07:00
messages . AFFECTED _KEY _IS _NOT _ADDRESS _MSG = "Ballot affectedKey isn't address"
messages . MINING _KEY _IS _NOT _ADDRESS _MSG = "Ballot miningKey isn't address"
2018-09-17 09:17:56 -07:00
messages . PROPOSED _ADDRESS _IS _NOT _ADDRESS _MSG = "Proposed address isn't address"
2018-07-12 05:40:39 -07:00
messages . END _TIME _SHOULD _BE _GREATER _THAN _NOW _MSG = 'Ballot end time should be greater than now'
messages . BALLOT _TYPE _IS _EMPTY _MSG = 'Ballot type is empty'
2018-10-10 01:52:22 -07:00
messages . USER _DENIED _ACCOUNT _ACCESS = 'You have denied access to your accounts'
2019-10-28 23:43:19 -07:00
messages . NO _METAMASK _MSG = 'Your MetaMask is locked or not installed.'
2018-07-12 05:40:39 -07:00
messages . ballotIsNotActiveMsg = timeToStart => {
return ` The ballot is not active yet. Time to start: ${ timeToStart } `
}
2018-06-21 09:17:46 -07:00
messages . SHOULD _BE _MORE _THAN _MIN _DURATION = ( minDuration , duration , neededHours , neededMinutes ) => {
2018-07-12 05:40:39 -07:00
return ` Ballot end time should be at least ${ minDuration } hours from now in UTC time. Current duration is ${ duration } hours.
2018-01-21 19:25:57 -08:00
Please add $ { neededHours } hours and $ { neededMinutes } minutes in order to set correct end time
2018-07-12 05:40:39 -07:00
`
2018-01-21 19:25:57 -08:00
}
2018-07-12 05:40:39 -07:00
messages . SHOULD _BE _LESS _OR _EQUAL _14 _DAYS = duration => {
return ` Ballot end time should not be more than 14 days from now in UTC time. Current duration is ${ duration } hours. `
2018-03-21 10:15:40 -07:00
}
2018-09-17 09:17:56 -07:00
messages . EMISSION _RELEASE _TIME _IN _FUTURE = emissionReleaseTime => {
return ` You cannot create ballot right now. You'll be able to do that after ${ emissionReleaseTime } UTC. `
}
messages . PREVIOUS _BALLOT _NOT _FINALIZED = 'Previous ballot should be finalized first.'
2018-07-02 01:53:37 -07:00
messages . BALLOT _CREATE _FAILED _TX = ` Your transaction was failed. Please make sure you set correct parameters for ballot creation.
2019-10-28 23:43:19 -07:00
Make sure you don ' t have Transaction Error . Exception thrown in contract code message in MetaMask before you sign it . `
2018-07-02 01:53:37 -07:00
messages . VOTE _FAILED _TX = ` Your transaction was failed. Please make sure you haven't already voted for this ballot.
2019-10-28 23:43:19 -07:00
Make sure you don ' t have Transaction Error . Exception thrown in contract code message in MetaMask before you sign it . `
2018-07-02 01:53:37 -07:00
messages . FINALIZE _FAILED _TX = ` Your transaction was failed. Make sure you don't have Transaction Error.
2019-10-28 23:43:19 -07:00
Exception thrown in contract code message in MetaMask before you sign it . `
2018-09-19 00:54:31 -07:00
messages . CANCEL _BALLOT _FAILED _TX = ` Your transaction was failed. Make sure you don't have Transaction Error.
2019-10-28 23:43:19 -07:00
Exception thrown in contract code message in MetaMask before you sign it . `
2018-07-12 05:40:39 -07:00
messages . DESCRIPTION _IS _EMPTY = 'Description cannot be empty'
messages . wrongRepo = repo => {
return ` There is no contracts.json in configured repo ${ repo } `
}
2019-10-28 23:43:19 -07:00
messages . networkMatchError = function ( netId ) {
const networkName = getNetworkFullName ( Number ( netId ) )
return ` Networks in DApp and MetaMask do not match. Switch MetaMask to <b> ${ networkName } </b> or change the network in DApp. `
2018-07-12 05:40:39 -07:00
}
2019-10-28 23:43:19 -07:00
2022-04-27 03:33:09 -07:00
messages . poaGnoMerging =
'POA is joining the Gnosis Chain ecosystem, and token holders can now swap POA for STAKE and then STAKE for GNO on the Gnosis Chain! More info and instructions <a href="https://www.poa.network/" target="_blank">here</a>.'
messages . poaGnoMerged =
'POA Network merged with the Gnosis Chain.<br /><a href="https://www.poa.network/" target="_blank">More information</a> about the merger.'
2019-10-28 23:43:19 -07:00
export default messages