Skip to content

Commit

Permalink
Merge branch 'develop' into yushi/catalyst-ledger
Browse files Browse the repository at this point in the history
Conflicts:
	packages/yoroi-extension/app/api/ada/lib/cardanoCrypto/catalyst.test.js
  • Loading branch information
yushih committed Jun 3, 2021
2 parents 8858abb + 28a022d commit 3d4c389
Show file tree
Hide file tree
Showing 35 changed files with 7,340 additions and 16,694 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/flow-and-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Flow and lint

on:
pull_request_review:
types: [ submitted ]

jobs:
flow-and-lint:
if: github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Cache node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v2
env:
cache-name: cache-yoroi-extension-node-modules
with:
# https://github.com/actions/cache/blob/main/examples.md#node---npm
# It is recommended to cache the NPM cache (~/.npm) instead of node_modules.
# But we put node version into the cache key and cache node_modules.
path: packages/yoroi-extension/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-node-${{ steps.nvm.outputs.NVMRC }}-${{ hashFiles('packages/yoroi-extension/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: npm install
run: |
cd packages/yoroi-extension
npm install
- name: flow and lint
run: |
cd packages/yoroi-extension
npm run flow
npm run eslint
27 changes: 23 additions & 4 deletions .github/workflows/main.yml → .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,29 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- run: cd packages/yoroi-extension
- run: npm install
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-yoroi-extension-node-modules
with:
# https://github.com/actions/cache/blob/main/examples.md#node---npm
# It is recommended to cache the NPM cache (~/.npm) instead of node_modules.
# But we put node version into the cache key and cache node_modules.
path: packages/yoroi-extension/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-node-${{ steps.nvm.outputs.NVMRC }}-${{ hashFiles('packages/yoroi-extension/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: npm install
run: |
cd packages/yoroi-extension
npm install
- name: Build
run: npm run prod:nightly
run: |
cd packages/yoroi-extension
npm run prod:nightly
env:
YOROI_NIGHTLY_PEM: ${{ secrets.YOROI_NIGHTLY_PEM }}
- name: publish nightly
Expand All @@ -31,7 +50,7 @@ jobs:
# ID of the extension that you are updating
extension: poonlenmfdfbjfeeballhiibknlknepo
# Path to a .zip of your addon
zip: "Yoroi Nightly.zip"
zip: "packages/yoroi-extension/Yoroi Nightly.zip"
# TODO: only share with trusted testers for now
publishTarget: trustedTesters
# Google OAuth2
Expand Down
4 changes: 4 additions & 0 deletions check-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
. ./install-all.sh
npm run flow
npm run eslint
npm run test
2 changes: 2 additions & 0 deletions install-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm i --prefix packages/yoroi-extension
npm i --prefix packages/yoroi-ergo-connector
2 changes: 1 addition & 1 deletion packages/yoroi-ergo-connector/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"start": "webpack-dev-server"
},
"devDependencies": {
"ergo-lib-wasm-browser": "0.10.0",
"ergo-lib-wasm-browser": "0.13.1",
"webpack": "^4.29.3",
"webpack-cli": "^3.1.0",
"webpack-dev-server": "^3.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module.exports = {
'no-undef-init': 0, // need this to improve Flow type inference
'no-unneeded-ternary': ['error', { defaultAssignment: true }],
'prefer-template': 0,
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-trailing-spaces': 1,
'padded-blocks': 0,
'no-undef': 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import styles from './Voting.scss';
const messages = defineMessages({
lineTitle: {
id: 'wallet.voting.lineTitle',
defaultMessage: '!!!Register to vote on Fund 3',
defaultMessage: '!!!Register to vote on Fund {round}',
},
line2: {
id: 'wallet.voting.line2',
Expand Down Expand Up @@ -46,6 +46,7 @@ type Props = {|
+onExternalLinkClick: MouseEvent => void,
+hasAnyPending: boolean,
+isDelegated: boolean,
+round: number,
|};

@observer
Expand All @@ -57,6 +58,8 @@ export default class Voting extends Component<Props> {
render(): Node {
const { intl } = this.context;

const round = this.props.round;

const pendingTxWarningComponent = this.props.hasAnyPending
? (
<div className={styles.warningBox}>
Expand All @@ -76,7 +79,7 @@ export default class Voting extends Component<Props> {
{pendingTxWarningComponent}
<div className={styles.voting}>
<div className={classnames([styles.lineTitle, styles.firstItem])}>
{intl.formatMessage(messages.lineTitle)}
{intl.formatMessage(messages.lineTitle, { round })}
</div>

<div className={styles.lineText}>
Expand Down
4 changes: 3 additions & 1 deletion packages/yoroi-extension/app/config/numbersConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ export const CARDANO_STABLE_SIZE = 2160;
*/
export const ERGO_STABLE_SIZE = Number.MAX_SAFE_INTEGER / 2;

// Catalyst fund 3 requires > 2950 ADA to participate
// Catalyst fund 4 *technically* requires > 450 ADA to participate
// However, the official min amount is 500 ADA
export const CATALYST_MIN_AMOUNT: BigNumber = new BigNumber(450 * 1_000_000);
export const CATALYST_DISPLAYED_MIN_AMOUNT: BigNumber = new BigNumber(500 * 1_000_000);
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import UnsupportedWallet from '../UnsupportedWallet';
import { PublicDeriver } from '../../../api/ada/lib/storage/models/PublicDeriver/index';
import LoadingSpinner from '../../../components/widgets/LoadingSpinner';
import VerticallyCenteredLayout from '../../../components/layout/VerticallyCenteredLayout';
import { CATALYST_MIN_AMOUNT } from '../../../config/numbersConfig';
import { CATALYST_MIN_AMOUNT, CATALYST_DISPLAYED_MIN_AMOUNT } from '../../../config/numbersConfig';
import InsufficientFundsPage from './InsufficientFundsPage';
import { getTokenName, genLookupOrFail } from '../../../stores/stateless/tokenHelpers';
import type { TokenInfoMap } from '../../../stores/toplevel/TokenInfoStore';
Expand All @@ -33,8 +33,8 @@ type Props = {|
|};

const roundInfo = {
startDate: new Date(Date.parse('2021-06-02T19:00:00Z')),
endDate: new Date(Date.parse('2021-06-09T19:00:00Z')),
startDate: new Date(Date.parse('2021-06-03T16:00:00Z')),
endDate: new Date(Date.parse('2021-06-11T11:00:00Z')),
nextRound: 4,
};

Expand Down Expand Up @@ -134,7 +134,9 @@ export default class VotingPage extends Component<Props> {
currentBalance={
balance.getDefaultEntry().amount.shiftedBy(-tokenInfo.Metadata.numberOfDecimals)
}
requiredBalance={CATALYST_MIN_AMOUNT.shiftedBy(-tokenInfo.Metadata.numberOfDecimals)}
requiredBalance={
CATALYST_DISPLAYED_MIN_AMOUNT.shiftedBy(-tokenInfo.Metadata.numberOfDecimals)
}
tokenName={getTokenName(tokenInfo)}
/>;
}
Expand All @@ -155,6 +157,7 @@ export default class VotingPage extends Component<Props> {
hasAnyPending={this.generated.hasAnyPending}
onExternalLinkClick={handleExternalLinkClick}
isDelegated={this.isDelegated === true}
round={roundInfo.nextRound}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const message = (id: number) => ({
type: 'tx',
uid: 0,
tx: {
id: '2df0273e382739f8b4ae3783d81168093e78e0b48ec2c5430ff03d444806a175',
inputs: [{
boxId: '1df0273e382739f8b4ae3783d81168093e78e0b48ec2c5430ff03d444806a174',
extension: {},
Expand All @@ -70,7 +69,6 @@ const message = (id: number) => ({
boxId: '0df0273e382739f8b4ae3783d81168093e78e0b48ec2c5430ff03d444806a173',
}],
outputs: [{
boxId: '3df0273e382739f8b4ae3783d81168093e78e0b48ec2c5430ff03d444806a176',
value: '1234567',
ergoTree: Buffer.from(RustModule.SigmaRust.Address.from_base58(
'9egNKTzQDH658qcdiPEoQfVM1SBxQNxnyF8BCw57aNWerRhhHBQ'
Expand All @@ -80,9 +78,7 @@ const message = (id: number) => ({
tokenId: tokenInfo.tokenId,
}],
additionalRegisters: tokenInfo.registers,
creationHeight: 1,
transactionId: '2df0273e382739f8b4ae3783d81168093e78e0b48ec2c5430ff03d444806a175',
index: 0
creationHeight: 1
}],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export default class ConnectorStore extends Store<StoresMap, ActionsMap> {
this.connectingMessage = response;
});
})
// eslint-disable-next-line no-console
.catch(err => console.error(err));
};

Expand All @@ -177,6 +178,7 @@ export default class ConnectorStore extends Store<StoresMap, ActionsMap> {
this.signingMessage = response;
});
})
// eslint-disable-next-line no-console
.catch(err => console.error(err));
};

Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/cs-CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Before you begin, make sure to complete steps below",
"wallet.voting.line3": "Download the Catalyst Voting App.",
"wallet.voting.line4": "Open the Catalyst Voting App and click on the Complete registration button.",
"wallet.voting.lineTitle": "Register to vote on Fund 3",
"wallet.voting.lineTitle": "Register to vote on Fund { round }",
"wallet.withdrawal.transaction.unregister": "This transaction will unregister one or more staking keys, giving you back your {refundAmount} {ticker} from your deposit",
"widgets.copyableaddress.addressCopyTooltipMessage": "Copy to clipboard",
"widgets.explorer.tooltip": "Go to {websiteName}",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Bevor du beginnst, schließe bitte die folgenden Schritte ab",
"wallet.voting.line3": "Lade die Catalyst Abstimmungs-App herunter.",
"wallet.voting.line4": "Öffne die Catalyst Voting App und klicke auf die Schaltfläche Registrierung abschließen.",
"wallet.voting.lineTitle": "Registrierung für die Fund 3 Abstimmung",
"wallet.voting.lineTitle": "Registrierung für die Fund { round } Abstimmung",
"wallet.withdrawal.transaction.unregister": "Diese Transaktion wird eine oder mehrere Staking Schlüssel zurückziehen, und Dir {refundAmount} {ticker} zurückgeben",
"widgets.copyableaddress.addressCopyTooltipMessage": "In die Zwischenablage kopieren",
"widgets.explorer.tooltip": "Gehe zu {websiteName}",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/el-GR.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Before you begin, make sure to complete steps below",
"wallet.voting.line3": "Download the Catalyst Voting App.",
"wallet.voting.line4": "Open the Catalyst Voting App and click on the Complete registration button.",
"wallet.voting.lineTitle": "Register to vote on Fund 3",
"wallet.voting.lineTitle": "Register to vote on Fund { round }",
"wallet.withdrawal.transaction.unregister": "This transaction will unregister one or more staking keys, giving you back your {refundAmount} {ticker} from your deposit",
"widgets.copyableaddress.addressCopyTooltipMessage": "Αντιγραφή στο πρόχειρο",
"widgets.explorer.tooltip": "Πηγαίνετε στο {websiteName}",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@
"wallet.voting.line2": "Before you begin, make sure to complete steps below",
"wallet.voting.line3": "Download the Catalyst Voting App.",
"wallet.voting.line4": "Open the Catalyst Voting App and click on the Complete registration button.",
"wallet.voting.lineTitle": "Register to vote on Fund 3",
"wallet.voting.lineTitle": "Register to vote on Fund { round }",
"wallet.voting.notDelegated": "You have not delegated. Your voting power is how much you delegate and the voting rewards will be distributed to your delegation reward address. Please make sure to delegate before voting.",
"wallet.withdrawal.transaction.unregister": "This transaction will unregister one or more staking keys, giving you back your {refundAmount} {ticker} from your deposit",
"widgets.copyableaddress.addressCopyTooltipMessage": "Copy to clipboard",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Antes de empezar, asegúrate de completar los siguientes pasos",
"wallet.voting.line3": "Descarga la aplicación Catalyst Voting App.",
"wallet.voting.line4": "Abre la Catalyst Voting App y haz clic en el botón Completar registro.",
"wallet.voting.lineTitle": "Registrarse para votar en el Fondo 3",
"wallet.voting.lineTitle": "Registrarse para votar en el Fondo { round }",
"wallet.withdrawal.transaction.unregister": "Esta transacción desregistrará una o más claves de delegación, devolviendo las {refundAmount} {ticker} de tu depósito",
"widgets.copyableaddress.addressCopyTooltipMessage": "Copiar al portapapeles",
"widgets.explorer.tooltip": "Ir a {websiteName}",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Avant de commencer, assurez-vous de suivre les étapes suivantes",
"wallet.voting.line3": "Télécharger l'application Catalyst Voting.",
"wallet.voting.line4": "Ouvrez l'application Catalyst Voting App et cliquez sur le bouton Compléter l'inscription.",
"wallet.voting.lineTitle": "S'enregistrer pour voter au Fund 3",
"wallet.voting.lineTitle": "S'enregistrer pour voter au Fund { round }",
"wallet.withdrawal.transaction.unregister": "Cette opération va désinscrire une ou plusieurs clés de staking, ce qui vous permettra de récupérer votre dépôt de {refundAmount} {ticker}",
"widgets.copyableaddress.addressCopyTooltipMessage": "Copier dans le presse-papier",
"widgets.explorer.tooltip": "Aller sur {websiteName}",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/hr-HR.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Before you begin, make sure to complete steps below",
"wallet.voting.line3": "Download the Catalyst Voting App.",
"wallet.voting.line4": "Open the Catalyst Voting App and click on the Complete registration button.",
"wallet.voting.lineTitle": "Register to vote on Fund 3",
"wallet.voting.lineTitle": "Register to vote on Fund { round }",
"wallet.withdrawal.transaction.unregister": "This transaction will unregister one or more staking keys, giving you back your {refundAmount} {ticker} from your deposit",
"widgets.copyableaddress.addressCopyTooltipMessage": "Copy to clipboard",
"widgets.explorer.tooltip": "Go to {websiteName}",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/id-ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Before you begin, make sure to complete steps below",
"wallet.voting.line3": "Download the Catalyst Voting App.",
"wallet.voting.line4": "Open the Catalyst Voting App and click on the Complete registration button.",
"wallet.voting.lineTitle": "Register to vote on Fund 3",
"wallet.voting.lineTitle": "Register to vote on Fund { round }",
"wallet.withdrawal.transaction.unregister": "This transaction will unregister one or more staking keys, giving you back your {refundAmount} {ticker} from your deposit",
"widgets.copyableaddress.addressCopyTooltipMessage": "Menyalin ke clipboard",
"widgets.explorer.tooltip": "Pergi ke {websiteName}",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Prima di iniziare, assicurati di completare i seguenti passi",
"wallet.voting.line3": "Scarica la Catalyst Voting App.",
"wallet.voting.line4": "Aprire la Catalyst Voting App e clicca sul pulsante Completa la registrazione.",
"wallet.voting.lineTitle": "Registrati per votare sul Fund 3",
"wallet.voting.lineTitle": "Registrati per votare sul Fund { round }",
"wallet.withdrawal.transaction.unregister": "Questa transazione deregistrerà una o più chiavi di staking, restituendovi i vostri {refundAmount} {ticker} dal vostro deposito",
"widgets.copyableaddress.addressCopyTooltipMessage": "Copia negli appunti",
"widgets.explorer.tooltip": "Vai a {websiteName}",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Before you begin, make sure to complete steps below",
"wallet.voting.line3": "Download the Catalyst Voting App.",
"wallet.voting.line4": "Open the Catalyst Voting App and click on the Complete registration button.",
"wallet.voting.lineTitle": "Register to vote on Fund 3",
"wallet.voting.lineTitle": "Register to vote on Fund { round }",
"wallet.withdrawal.transaction.unregister": "This transaction will unregister one or more staking keys, giving you back your {refundAmount} {ticker} from your deposit",
"widgets.copyableaddress.addressCopyTooltipMessage": "クリップボードにコピーする",
"widgets.explorer.tooltip": "{websiteName}へ",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Before you begin, make sure to complete steps below",
"wallet.voting.line3": "Download the Catalyst Voting App.",
"wallet.voting.line4": "Open the Catalyst Voting App and click on the Complete registration button.",
"wallet.voting.lineTitle": "Register to vote on Fund 3",
"wallet.voting.lineTitle": "Register to vote on Fund { round }",
"wallet.withdrawal.transaction.unregister": "This transaction will unregister one or more staking keys, giving you back your {refundAmount} {ticker} from your deposit",
"widgets.copyableaddress.addressCopyTooltipMessage": "클립보드로 복사",
"widgets.explorer.tooltip": "{websiteName} 로 가기",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/nl-NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Zorg ervoor dat u de onderstaande stappen uitvoert voordat u begint",
"wallet.voting.line3": "Download de Catalyst Stem-applicatie.",
"wallet.voting.line4": "Open de Catalyst Stem-applicatie en klik op de knop \"Registratie voltooien\".",
"wallet.voting.lineTitle": "Registreer uzelf om op Fonds 3 te stemmen",
"wallet.voting.lineTitle": "Registreer uzelf om op Fonds { round } te stemmen",
"wallet.withdrawal.transaction.unregister": "Met deze transactie wordt de registratie van een of meer stemsleutels ongedaan gemaakt, waardoor u uw {refundAmount} {ticker} van uw storting terugkrijgt",
"widgets.copyableaddress.addressCopyTooltipMessage": "Kopieer naar klembord",
"widgets.explorer.tooltip": "Ga naar {websiteName}",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Before you begin, make sure to complete steps below",
"wallet.voting.line3": "Download the Catalyst Voting App.",
"wallet.voting.line4": "Open the Catalyst Voting App and click on the Complete registration button.",
"wallet.voting.lineTitle": "Register to vote on Fund 3",
"wallet.voting.lineTitle": "Register to vote on Fund { round }",
"wallet.withdrawal.transaction.unregister": "Essa transação irá revogar uma ou mais chave de participação, reembolsando suas {refundAmount}{ticker} pagas como depósito no registro de sua chave de participação",
"widgets.copyableaddress.addressCopyTooltipMessage": "Copiar para área de transferência",
"widgets.explorer.tooltip": "Ir para {websiteName}",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
"wallet.voting.line2": "Before you begin, make sure to complete steps below",
"wallet.voting.line3": "Download the Catalyst Voting App.",
"wallet.voting.line4": "Open the Catalyst Voting App and click on the Complete registration button.",
"wallet.voting.lineTitle": "Register to vote on Fund 3",
"wallet.voting.lineTitle": "Register to vote on Fund { round }",
"wallet.withdrawal.transaction.unregister": "This transaction will unregister one or more staking keys, giving you back your {refundAmount} {ticker} from your deposit",
"widgets.copyableaddress.addressCopyTooltipMessage": "Скопировать в буфер обмена",
"widgets.explorer.tooltip": "Перейти на {websiteName}",
Expand Down
Loading

0 comments on commit 3d4c389

Please sign in to comment.