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

Release / 4.15.100 #2938

Merged
merged 65 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
583f863
Started tests for support
cmerloglb Jul 11, 2022
cc097d8
Added validations for email
cmerloglb Jul 14, 2022
49e1717
improve typing for nft metadata
yushih Jul 8, 2022
5e9ce44
Changed requests library for axios for emails
cmerloglb Jul 19, 2022
aa63b78
Merge branch 'develop' into e2e-tests-support
cmerloglb Jul 19, 2022
a886e48
revamped wallet landing page should be transactions
yushih Jul 20, 2022
532ab23
Added new pages
Nebyt Jul 20, 2022
e7845a8
Changes in steps
Nebyt Jul 20, 2022
0eb7797
Added trezorEmulatorController.js
Nebyt Jul 20, 2022
ff94158
Changes in webdriver.js
Nebyt Jul 20, 2022
3e50581
Changes in TestWallets.js
Nebyt Jul 20, 2022
ceab1e2
Changes in windowManager.js
Nebyt Jul 20, 2022
06f834b
Added trezor-emulator.feature
Nebyt Jul 20, 2022
db216e1
Added the option to build without mocking HW wallets
Nebyt Jul 20, 2022
9c9622b
Added the script to build the test app without mocking HW wallets and…
Nebyt Jul 20, 2022
5d6b809
Added CI for the emulator
Nebyt Jul 20, 2022
6b67992
Test improvements
Nebyt Jul 20, 2022
e9bb289
Merge branch 'develop' into denis/trezor_emulator_controller
Nebyt Jul 20, 2022
85d9e11
Fix for the "Converting circular structure to JSON" error
Nebyt Jul 20, 2022
b21d4c4
Merge remote-tracking branch 'origin/denis/trezor_emulator_controller…
Nebyt Jul 20, 2022
9ba59db
Flow fix
Nebyt Jul 20, 2022
275182e
Revert "Added the option to build without mocking HW wallets"
Nebyt Jul 20, 2022
146deba
Useless alias is removed
Nebyt Jul 20, 2022
f299078
Useless build script is removed
Nebyt Jul 20, 2022
fbdcbd0
removed leftovers
Nebyt Jul 20, 2022
a825092
Merge branch 'develop' into denis/trezor_emulator_controller
Nebyt Jul 20, 2022
94c76a0
Added tests for support customer
cmerloglb Jul 20, 2022
4584b0f
Merge branch 'develop' into e2e-test-support-2
cmerloglb Jul 20, 2022
81f8f1f
fix submitted tx status label on revamped tx list
yushih Jul 21, 2022
17f03b9
Workflow fix
Nebyt Jul 21, 2022
98ed662
Merge remote-tracking branch 'origin/denis/trezor_emulator_controller…
Nebyt Jul 21, 2022
a74c99e
Tests improvements
Nebyt Jul 21, 2022
2711ea6
Merge pull request #2921 from Emurgo/denis/trezor_emulator_controller
Nebyt Jul 21, 2022
285f250
Merge branch 'develop' into e2e-test-support-2
Nebyt Jul 21, 2022
65f6ff4
Merge pull request #2923 from Emurgo/e2e-test-support-2
Nebyt Jul 21, 2022
61f8bd0
Merge branch 'develop' into yushi/nft-metadata-typing
yushih Jul 21, 2022
3e48697
default NFT images on assets page
yushih Jul 21, 2022
7006798
Merge pull request #2919 from Emurgo/yushi/wallet-landing-page
yushih Jul 21, 2022
6e29698
Merge branch 'develop' into yushi/nft-metadata-typing
vsubhuman Jul 21, 2022
8ca724f
lint
vsubhuman Jul 22, 2022
e8e70b1
Merge pull request #2918 from Emurgo/yushi/nft-metadata-typing
vsubhuman Jul 22, 2022
3c25d0d
fix the label on the nav bar of the transfer page
yushih Jul 22, 2022
82b5eae
New test build script without mocking the backend
Nebyt Jul 23, 2022
ab428f2
implement getNetWorkId
ozgrakkurt Jul 25, 2022
786949f
Merge pull request #2928 from Emurgo/yushi/fix-transfer-page-navbar
vsubhuman Jul 25, 2022
b324c6d
Merge branch 'develop' into yushi/fix-revamp-submitted-tx-status
vsubhuman Jul 25, 2022
d501168
Removed unused downloads
Nebyt Jul 25, 2022
2afcb27
Little fixes
Nebyt Jul 25, 2022
06aad36
reset revamped hardware wallet send error
yushih Jul 25, 2022
e714fc3
Merge pull request #2932 from Emurgo/denis/trezor_test_fix
vsubhuman Jul 25, 2022
25966fc
Merge pull request #2924 from Emurgo/yushi/fix-revamp-submitted-tx-st…
vsubhuman Jul 25, 2022
cc4dee4
Merge branch 'develop' into yushi/reset-hardware-wallet-send-error
vsubhuman Jul 25, 2022
1eac5c0
Merge pull request #2933 from Emurgo/yushi/reset-hardware-wallet-send…
vsubhuman Jul 25, 2022
b28504b
Merge remote-tracking branch 'origin/develop' into release/4.15
vsubhuman Jul 26, 2022
2c7d90c
Merge pull request #2935 from Emurgo/release/4.15
vsubhuman Jul 26, 2022
b7aaa71
Merge pull request #2936 from Emurgo/production
vsubhuman Jul 26, 2022
ebdf90e
Merge branch 'develop' into denis/new_test_build_script
vsubhuman Jul 26, 2022
5cad1ec
Merge branch 'develop' into ozgur/impl-get-network-id
vsubhuman Jul 26, 2022
76b05f2
lint
vsubhuman Jul 26, 2022
f9c043d
Merge pull request #2930 from Emurgo/ozgur/impl-get-network-id
vsubhuman Jul 26, 2022
cfcc2b3
Merge branch 'develop' into denis/new_test_build_script
vsubhuman Jul 26, 2022
2df94cb
Merge pull request #2929 from Emurgo/denis/new_test_build_script
vsubhuman Jul 26, 2022
39c4eab
Version bump: 4.15.100
vsubhuman Jul 26, 2022
7d645a1
Changed tests env: macos-10.15 -> macos-11
Nebyt Jul 27, 2022
56c43a1
Merge pull request #2939 from Emurgo/denis/fix-dapp-tests-env
vsubhuman Jul 27, 2022
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
9 changes: 6 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ jobs:
- name: tests
run: |
npm run test

E2E_tests_dApp_Chrome:
if: github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check'))
runs-on: macos-10.15
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Forcefully update the Chrome browser
Expand Down Expand Up @@ -96,6 +95,8 @@ jobs:
touch ./reports/cucumberReports.json
- name: Run dapp connector tests
working-directory: ./packages/yoroi-extension
env:
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }}
run: npm run test:run:e2e:dApp:chrome
- name: Archive tests screenshots and logs
if: ${{ failure() }}
Expand All @@ -106,7 +107,7 @@ jobs:

E2E_tests_dApp_FF:
if: github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check') || contains(github.event.review.body, '/run_dapp_ff'))
runs-on: macos-10.15
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Forcefully install Firefox for Developers browser
Expand Down Expand Up @@ -165,6 +166,8 @@ jobs:
touch ./reports/cucumberReports.json
- name: Run dapp connector tests
working-directory: ./packages/yoroi-extension
env:
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }}
run: npm run test:run:e2e:dApp:firefox
- name: Archive tests screenshots and logs
if: ${{ failure() }}
Expand Down
246 changes: 246 additions & 0 deletions .github/workflows/tests_hw_emulators.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
name: Tests with HW emulators

on:
pull_request_review:
types: [ submitted ]

jobs:
Trezor_Model_T_Chrome:
if: github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check'))
runs-on: ubuntu-22.04

steps:
- name: Forcefully update the Chrome browser
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable

- name: Clone the trezor-usr-env
run: |
cd ..
git clone https://github.com/trezor/trezor-user-env.git

- name: Install nix-shell
run: |
sudo apt update
sudo apt -y install nix-bin

- name: Download firmware
working-directory: ../trezor-user-env/src/binaries/firmware/bin/
run: |
sed '/^.*R_LATEST_BUILD.*$/d' download.sh | sed '/^.*trezor_r_master.*$/d' > temp_file.sh
rm download.sh
mv temp_file.sh download.sh
chmod +x download.sh
sudo ./download.sh

- name: Download trezord-go
working-directory: ../trezor-user-env
run: sudo ./src/binaries/trezord-go/bin/download.sh

- name: Copy the v2-master firmware to the root of the project
working-directory: ../trezor-user-env
run: cp -rf src/binaries/firmware/bin/trezor-emu-core-v2-master ./

- name: Copy the trezord-go-v2.0.31 to the root of the project
working-directory: ../trezor-user-env
run: cp -rf src/binaries/trezord-go/bin/trezord-go-v2.0.31 ./

- name: Create the logs folder in the root of the trezor-user-env
working-directory: ../trezor-user-env
run: mkdir logs

- name: Run the trezor user environment
working-directory: ../trezor-user-env
run: sudo docker run -p 9001:9001 -p 9002:9002 -p 21326:21326 -p 127.0.0.1:21325:21326 -p 21324:21324 -v logs:/trezor-user-env/logs/screens -v trezor-emu-core-v2-master:/trezor-user-env/src/binaries/firmware/bin/user_downloaded -v trezord-go-v2.0.31:/trezor-user-env/src/binaries/trezord-go/bin -d emurgornd/trezor-user-env:latest

- uses: actions/checkout@v3

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache extension node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v3
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: Cache connector node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v3
env:
cache-name: cache-yoroi-connector-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-ergo-connector/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-node-${{ steps.nvm.outputs.NVMRC }}-${{ hashFiles('packages/yoroi-ergo-connector/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: npm install
run: |
. install-all.sh

- name: Build the test version using emulators
working-directory: ./packages/yoroi-extension
run: npm run test:build

- name: Create the report's folder
working-directory: ./packages/yoroi-extension
run: |
mkdir reports
touch ./reports/cucumberReports.json

- name: Run tests
working-directory: ./packages/yoroi-extension
run: xvfb-run -a -e /dev/stdout -s "-screen 0 1920x1080x24" npm run test:run:e2e:trezor:chrome

- name: Archive tests screenshots and logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: testRunsData
path: ./packages/yoroi-extension/testRunsData

Trezor_Model_T_Firefox:
if: github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check'))
runs-on: ubuntu-22.04

steps:
- name: Install Firefox Developer Edition
run: |
wget -c "https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-US" -O - | sudo tar -xj -C /opt
sudo rm -rf /opt/firefoxdev
sudo mv /opt/firefox /opt/firefoxdev

- name: Set up env variable for FF
run: echo "FIREFOX_DEV=/opt/firefoxdev/firefox-bin" >> $GITHUB_ENV

- name: Clone the trezor-usr-env
run: |
cd ..
git clone https://github.com/trezor/trezor-user-env.git

- name: Install nix-shell
run: |
sudo apt update
sudo apt -y install nix-bin

- name: Download firmware
working-directory: ../trezor-user-env/src/binaries/firmware/bin/
run: |
sed '/^.*R_LATEST_BUILD.*$/d' download.sh | sed '/^.*trezor_r_master.*$/d' > temp_file.sh
rm download.sh
mv temp_file.sh download.sh
chmod +x download.sh
sudo ./download.sh

- name: Download trezord-go
working-directory: ../trezor-user-env
run: sudo ./src/binaries/trezord-go/bin/download.sh

- name: Copy the v2-master firmware to the root of the project
working-directory: ../trezor-user-env
run: cp -rf src/binaries/firmware/bin/trezor-emu-core-v2-master ./

- name: Copy the trezord-go-v2.0.31 to the root of the project
working-directory: ../trezor-user-env
run: cp -rf src/binaries/trezord-go/bin/trezord-go-v2.0.31 ./

- name: Create the logs folder in the root of the trezor-user-env
working-directory: ../trezor-user-env
run: mkdir logs

- name: Run the trezor user environment
working-directory: ../trezor-user-env
run: sudo docker run -p 9001:9001 -p 9002:9002 -p 21326:21326 -p 127.0.0.1:21325:21326 -p 21324:21324 -v logs:/trezor-user-env/logs/screens -v trezor-emu-core-v2-master:/trezor-user-env/src/binaries/firmware/bin/user_downloaded -v trezord-go-v2.0.31:/trezor-user-env/src/binaries/trezord-go/bin -d emurgornd/trezor-user-env:latest

- uses: actions/checkout@v3

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache extension node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v3
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: Cache connector node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v3
env:
cache-name: cache-yoroi-connector-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-ergo-connector/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-node-${{ steps.nvm.outputs.NVMRC }}-${{ hashFiles('packages/yoroi-ergo-connector/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: npm install
run: |
. install-all.sh

- name: Build the test version using emulators
working-directory: ./packages/yoroi-extension
run: npm run test:build

- name: Create the report's folder
working-directory: ./packages/yoroi-extension
run: |
mkdir reports
touch ./reports/cucumberReports.json

- name: Run tests with the trezor emulator
working-directory: ./packages/yoroi-extension
run: xvfb-run -a -e /dev/stdout -s "-screen 0 1920x1080x24" npm run test:run:e2e:trezor:firefox

- name: Archive tests screenshots and logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: testRunsData
path: ./packages/yoroi-extension/testRunsData
3 changes: 3 additions & 0 deletions packages/yoroi-ergo-connector/example-cardano/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ <h1 class="display-4 text-center">Cardano dApp Example</h1>
<div class="col-6 mb-4">
<button id="is-enabled" class="btn btn-light w-100" >Is Enabled</button>
</div>
<div class="col-6 mb-4">
<button id="get-network-id" class="btn btn-light w-100" >Get Network Id</button>
</div>
<div class="col-6 mb-4">
<button id="get-balance" class="btn btn-light w-100" >Get Account Balance</button>
</div>
Expand Down
13 changes: 13 additions & 0 deletions packages/yoroi-ergo-connector/example-cardano/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const signData = document.querySelector('#sign-data');
const alertEl = document.querySelector('#alert');
const spinner = document.querySelector('#spinner');
const getNFTs = document.getElementById('nfts');
const getNetworkId = document.getElementById('get-network-id');

let accessGranted = false;
let cardanoApi;
Expand Down Expand Up @@ -178,6 +179,18 @@ isEnabledBtn.addEventListener('click', () => {
});
});

getNetworkId.addEventListener('click', () => {
if (!accessGranted) {
alertError('Should request access first');
} else {
toggleSpinner('show');
cardanoApi.getNetworkId().then(networkId => {
console.log('[getNetworkId]', networkId);
toggleSpinner('hide');
});
}
});

getAccountBalance.addEventListener('click', () => {
if (!accessGranted) {
alertError('Should request access first');
Expand Down
3 changes: 1 addition & 2 deletions packages/yoroi-ergo-connector/src/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ class CardanoAPI {
})

getNetworkId() {
// TODO
throw new Error('Not implemented yet');
return this._cardano_rpc_call("get_network_id", []);
}

getBalance(token_id = '*') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,26 @@ export const AddressMappingSchema: {|
}
};

export type NFTMetadata = {|
name: string,
image: string | Array<string>,
mediaType?: ?string,
description: ?(string | Array<string>),
files?: ?Array<{|
name?: ?string,
mediaType?: ?string,
src?: ?(string | Array<string>),
|}>
|};

export type CardanoAssetMintMetadata = {|
// transaction_metadatum_label: 721 for NFTs
// See CIP 721
// https://github.com/cardano-foundation/CIPs/blob/8b1f2f0900d81d6233e9805442c2b42aa1779d2d/CIP-NFTMetadataStandard.md
[key: string]: {|
version?: ?string,
[policyID: string]: {|
[assetNameHex: string]: any
[assetNameHex: string]: NFTMetadata
|}
|}
|}
Expand Down Expand Up @@ -512,7 +524,7 @@ export type TokenMetadata = {|
// empty string for ADA
+assetName: string,
...CommonMetadata,
+assetMintMetadata?: ?Array<CardanoAssetMintMetadata | any> | any
+assetMintMetadata?: Array<CardanoAssetMintMetadata>
|};

export type TokenInsert = {|
Expand Down
Loading