Skip to content
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

Version 1.2.1 Staging Release #276

Merged
merged 8 commits into from
Jan 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
# use nightly version.
# // TODO: This is hardcoded but taken from js-cardano-wasm repo
# which is checked out later
- run: rustup install nightly-2018-06-05
- run: rustup target add wasm32-unknown-unknown --toolchain nightly-2018-06-05
- run: rustup install 1.32.0
- run: rustup target add wasm32-unknown-unknown --toolchain 1.32.0

# Because npm link will write in this path
- run: sudo chown -R "$(whoami):$(whoami)" /usr/local/lib/node_modules
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ production-key.pem
build/
dev/
dll/
screenshots/

*.zip
*.xpi
Expand Down
48 changes: 48 additions & 0 deletions app/api/ada/daedalusTransfer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* eslint-disable camelcase */
// @flow
import './lib/test-config';
import {
Wallet,
} from 'rust-cardano-crypto';
import {
getCryptoDaedalusWalletFromMnemonics,
} from './lib/cardanoCrypto/cryptoWallet';
import {
decodeRustTx,
} from './lib/utils';
import cbor from 'cbor';
import bs58 from 'bs58';
import { SHA3 } from 'sha3';
import blake2b from 'blake2b';

test('Daedalus transfer from old invalid address', () => {
const words = 'note park thrive ignore spare latin common balance clap soup school tiny';
const address = 'DdzFFzCqrhsmcx7z25PRkdbeUNqNNW4brhznpVxbm1EknAahjaCFEjYXg9KJRqkixjgGyz8D9GSX3CFDRoNrZyfJsi61N2FxCnq9yWBy';
const txId = '915f2e6865fb31cc93410efb6c0e580ca74862374b3da461e20135c01f312e7c';
const txIndex = 0;
const wallet = getCryptoDaedalusWalletFromMnemonics(words);
const input = [{
ptr: { id: txId, index: txIndex },
value: '1000000',
addressing: [2147483648, 1316836692]
}];
const outAddress = 'Ae2tdPwUPEZ4Gg5gmqwW2t7ottKBMjWunmPt7DwKkAGsxx9XNSfWqrE1Gbk';
const { result: { cbor_encoded_tx, fee } } = Wallet.move(wallet, input, outAddress);
const { tx: { tx: { inputs, outputs }, witnesses } } = decodeRustTx(cbor_encoded_tx);
expect(inputs.length).toEqual(1);
expect(outputs.length).toEqual(1);
expect(witnesses.length).toEqual(1);
expect(inputs[0].id).toEqual(txId);
expect(inputs[0].index).toEqual(txIndex);
expect(outputs[0].address).toEqual(outAddress);
expect(1000000 - parseInt(outputs[0].value, 10)).toEqual(parseInt(fee, 10));
expect('PkWitness' in witnesses[0]).toEqual(true);
const [pub] = witnesses[0].PkWitness;
const [addressRoot, addressAttr] = cbor.decode(cbor.decode(bs58.decode(address))[0].value);
const addressRootHex = addressRoot.toString('hex');
const ext = [0, [0, Buffer.from(pub, 'hex')], addressAttr];
const hash = new SHA3(256);
hash.update(cbor.encode(ext));
const calculatedRootHex = blake2b(28).update(hash.digest()).digest('hex');
expect(calculatedRootHex).toEqual(addressRootHex);
});
2 changes: 1 addition & 1 deletion app/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@
"wallet.transaction.assuranceLevel.medium": "medium",
"wallet.transaction.confirmations": "confirmations",
"wallet.transaction.conversion.rate": "Conversion rate",
"wallet.transaction.fee": "Fee",
"wallet.transaction.export.dialog.exportButton.label": "Export",
"wallet.transaction.export.dialog.infoText1": "The entire transaction history within your wallet will be exported to a file.",
"wallet.transaction.export.dialog.title": "Export transactions to file",
"wallet.transaction.export.exportIcon.tooltip": "Export to file",
"wallet.transaction.fee": "Fee",
"wallet.transaction.received": "{currency} received",
"wallet.transaction.sent": "{currency} sent",
"wallet.transaction.state.failed": "Transaction failed",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@
"wallet.transaction.assuranceLevel.medium": "中",
"wallet.transaction.confirmations": "確認",
"wallet.transaction.conversion.rate": "コンバージョン率",
"wallet.transaction.fee": "手数料",
"wallet.transaction.export.dialog.exportButton.label": "出力",
"wallet.transaction.export.dialog.infoText1": "ウォレット内の全トランザクション歴がファイルに出力されます。",
"wallet.transaction.export.dialog.title": "トランザクション歴をファイルに出力する",
"wallet.transaction.export.exportIcon.tooltip": "ファイルに出力する",
"wallet.transaction.fee": "手数料",
"wallet.transaction.received": "{currency} 受信済",
"wallet.transaction.sent": "{currency} 送信済",
"wallet.transaction.state.failed": "処理に失敗しました",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@
"wallet.transaction.assuranceLevel.medium": "중간",
"wallet.transaction.confirmations": "확인",
"wallet.transaction.conversion.rate": "환율",
"wallet.transaction.fee": "수수료",
"wallet.transaction.export.dialog.exportButton.label": "출력",
"wallet.transaction.export.dialog.infoText1": "지갑의 전체 거래내역이 파일로 출력됩니다",
"wallet.transaction.export.dialog.title": "거래내역을 파일로 출력",
"wallet.transaction.export.exportIcon.tooltip": "파일로 출력",
"wallet.transaction.fee": "수수료",
"wallet.transaction.received": "{currency} 받음",
"wallet.transaction.sent": "{currency} 보냄",
"wallet.transaction.state.failed": "거래 실패",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@
"wallet.transaction.assuranceLevel.medium": "средний",
"wallet.transaction.confirmations": "подтверждения",
"wallet.transaction.conversion.rate": "Обменный курс",
"wallet.transaction.fee": "Комиссия",
"wallet.transaction.export.dialog.exportButton.label": "Экспорт",
"wallet.transaction.export.dialog.infoText1": "Вся история транзакций в Вашем кошельке будет экспортирована в файл.",
"wallet.transaction.export.dialog.title": "Экспорт транзакций в файл",
"wallet.transaction.export.exportIcon.tooltip": "Экспорт в файл",
"wallet.transaction.fee": "Комиссия",
"wallet.transaction.received": "{currency} получено",
"wallet.transaction.sent": "{currency} отправлено",
"wallet.transaction.state.failed": "Не удалось провести транзакцию",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/terms-of-use/ada/ja-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

## 3. ユーザーの表明

ユーザーは、当社に対し、(a)ユーザーが自然人である場合には、ユーザーが18歳を超えていること【AMT:18歳は含まれないことを念のためご確認ください。】、(b)ユーザーは本規約を締結し、本規約に基づくユーザーの義務を履行する権限および権能を有していること、(c)ユーザーが当社に提供する情報はすべて真実、正確かつ完全であること、(d)ユーザーはユーザーによる本ソフトウェアへのアクセス、本ソフトウェアの利用または本ソフトウェアのインストールに関して関係法域のすべての法令を遵守すること、(e)ユーザーは本規約のすべての条項(第4条に定める規定を含みますが、これに限られません。)を遵守すること、ならびに(f)ユーザーは本ソフトウェアへのアクセス、本ソフトウェアの利用または本ソフトウェアのインストールに必要な正確かつ完全な情報を提供しており、今後も提供することを表明し、保証します。
ユーザーは、当社に対し、(a)ユーザーが自然人である場合には、ユーザーが18歳を超えていること、(b)ユーザーは本規約を締結し、本規約に基づくユーザーの義務を履行する権限および権能を有していること、(c)ユーザーが当社に提供する情報はすべて真実、正確かつ完全であること、(d)ユーザーはユーザーによる本ソフトウェアへのアクセス、本ソフトウェアの利用または本ソフトウェアのインストールに関して関係法域のすべての法令を遵守すること、(e)ユーザーは本規約のすべての条項(第4条に定める規定を含みますが、これに限られません。)を遵守すること、ならびに(f)ユーザーは本ソフトウェアへのアクセス、本ソフトウェアの利用または本ソフトウェアのインストールに必要な正確かつ完全な情報を提供しており、今後も提供することを表明し、保証します。

## 4. 禁止される利用

Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@
"wallet.transaction.assuranceLevel.medium": "中",
"wallet.transaction.confirmations": "确认",
"wallet.transaction.conversion.rate": "汇价",
"wallet.transaction.fee": "费用",
"wallet.transaction.export.dialog.exportButton.label": "输出",
"wallet.transaction.export.dialog.infoText1": "钱包中的所有交易记录将输出到文件中。",
"wallet.transaction.export.dialog.title": "输出交易记录至文件",
"wallet.transaction.export.exportIcon.tooltip": "输出文件",
"wallet.transaction.fee": "费用",
"wallet.transaction.received": "已接收 {currency}",
"wallet.transaction.sent": "已发送 {currency}",
"wallet.transaction.state.failed": "交易失败",
Expand Down
6 changes: 1 addition & 5 deletions app/i18n/locales/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,13 @@
"wallet.transaction.assuranceLevel.high": "高",
"wallet.transaction.assuranceLevel.low": "低",
"wallet.transaction.assuranceLevel.medium": "適中",
"wallet.transaction.export.dialog.exportButton.label": "輸出",
"wallet.transaction.export.dialog.infoText1": "錢包中的所有交易記錄將輸出到文件中。",
"wallet.transaction.export.dialog.title": "輸出交易記錄至文件",
"wallet.transaction.export.exportIcon.tooltip": "輸出文件",
"wallet.transaction.confirmations": "確認",
"wallet.transaction.conversion.rate": "匯率",
"wallet.transaction.fee": "費用",
"wallet.transaction.export.dialog.exportButton.label": "輸出",
"wallet.transaction.export.dialog.infoText1": "錢包中的所有交易記錄將輸出到文件中",
"wallet.transaction.export.dialog.title": "輸出交易記錄至文件",
"wallet.transaction.export.exportIcon.tooltip": "輸出文件",
"wallet.transaction.fee": "費用",
"wallet.transaction.received": "已收到 {currency}",
"wallet.transaction.sent": "已傳送 {currency}",
"wallet.transaction.state.failed": "交易失敗",
Expand Down
2 changes: 1 addition & 1 deletion chrome/manifest.development.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.0",
"version": "1.2.1",
"name": "yoroi",
"manifest_version": 2,
"description": "[dev] Cardano ADA wallet",
Expand Down
2 changes: 1 addition & 1 deletion chrome/manifest.mainnet.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.0",
"version": "1.2.1",
"name": "Yoroi",
"manifest_version": 2,
"description": "A simple, secure and fast Cardano ADA wallet.",
Expand Down
4 changes: 2 additions & 2 deletions chrome/manifest.staging.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "1.2.0",
"version_name": "st-1.2.0",
"version": "1.2.1",
"version_name": "st-1.2.1",
"name": "Yoroi Staging",
"manifest_version": 2,
"description": "[staging] Cardano ADA wallet",
Expand Down
4 changes: 2 additions & 2 deletions features/settings-ui.feature
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ Feature: Wallet UI Settings
When I navigate to the general settings screen
And I open General Settings language selection dropdown
And I select Japanese language
Then I should see Japanese language as selected
Then The Japanese language should be selected
When I refresh the page
Then I should see Japanese language as selected
Then The Japanese language should be selected

@it-3
Scenario: Yoroi Settings Screen / Terms of Use in Default English(IT-3)
Expand Down
57 changes: 56 additions & 1 deletion features/step_definitions/common-steps.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,77 @@
// @flow

import { BeforeAll, Given, After, AfterAll } from 'cucumber';
import { Before, BeforeAll, Given, After, AfterAll, setDefinitionFunctionWrapper } from 'cucumber';
import { getMockServer, closeMockServer } from '../support/mockServer';
import { buildFeatureData, getFeatureData, getFakeAddresses } from '../support/mockDataBuilder';
import i18nHelper from '../support/helpers/i18n-helpers';

const { promisify } = require('util');
const fs = require('fs');
const rimraf = require('rimraf');

const screenshotsDir = './screenshots/';

/** We need to keep track of our progress in testing to give unique names to screenshots */
const testProgress = {
scenarioName: '',
lineNum: 0, // we need this to differentiate scenarios with multiple "examples"
step: 0
};

BeforeAll(() => {
rimraf.sync(screenshotsDir);
fs.mkdirSync(screenshotsDir);

getMockServer({});
});

AfterAll(() => {
closeMockServer();
});

Before((scenario) => {
// cleanup scenario name so it is folder-name friendly
testProgress.scenarioName = scenario.pickle.name.replace(/[^0-9a-z_ ]/gi, '');
testProgress.lineNum = scenario.sourceLocation.line;
testProgress.step = 0;
});


After(async function () {
await this.driver.quit();
});

const writeFile = promisify(fs.writeFile);

/** Wrap every step to take screenshots for UI-based testing */
setDefinitionFunctionWrapper((fn, _, pattern) => {
if (!pattern) {
return fn;
}
return async function (...args) {
const ret = await fn.apply(this, args);

// Regex patterns contain non-ascii characters.
// We want to remove this to get a filename-friendly string
const cleanString = pattern.toString().replace(/[^0-9a-z_ ]/gi, '');

if (cleanString.includes('I should see')) {
// path logic
const dir = `${screenshotsDir}/${testProgress.scenarioName}`;
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
const path = `${dir}/${testProgress.step}_${testProgress.lineNum}-${cleanString}.png`;

const screenshot = await this.driver.takeScreenshot();
await writeFile(path, screenshot, 'base64');
}

testProgress.step += 1;
return ret;
};
});

Given(/^I am testing "([^"]*)"$/, feature => {
buildFeatureData(feature);
});
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/general-settings-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Then(/^I should see secondary menu (.*) item disabled$/, async function (buttonN
await this.waitUntilText(buttonSelector, label);
});

Then(/^I should see Japanese language as selected$/, async function () {
Then(/^The Japanese language should be selected$/, async function () {
this.driver.wait(async () => {
const activeLanguage = await i18n.getActiveLanguage(this.driver);
return activeLanguage === 'ja-JP';
Expand Down
3 changes: 2 additions & 1 deletion js-cardano-wasm-build
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash

RUST_TOOLCHAIN="$(cat rust-toolchain)"
RUST_TOOLCHAIN="1.32.0"

set +e
pushd wallet-wasm
rustup install ${RUST_TOOLCHAIN} && \
rustup target add --toolchain ${RUST_TOOLCHAIN} wasm32-unknown-unknown && \
cargo +${RUST_TOOLCHAIN} build --target wasm32-unknown-unknown --release --verbose && \
popd && \
Expand Down
Loading