Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1924 from LedgerHQ/release/v22.0.3
Browse files Browse the repository at this point in the history
Release/v22.0.3
  • Loading branch information
lambertkevin authored Apr 29, 2022
2 parents 3ed551b + a1c73d9 commit 6fafc8d
Show file tree
Hide file tree
Showing 7 changed files with 297 additions and 150 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/bot-staging-explorer-btc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Bot Staging Explorer 'Bitcoin'
on:
schedule:
- cron: 0 8,12,16 * * 1-5

workflow_dispatch:
inputs:
ref:
description: "Which ref (branch or tag) to pull from ?"
required: false
default: master

jobs:
start-runner:
name: "start ec2 instance (Linux)"
if: ${{ always() }}
uses: ledgerhq/actions/.github/workflows/start-linux-runner.yml@main
secrets:
CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}

stop-runner:
name: "stop ec2 instance (Linux)"
needs: [start-runner, run-bot]
uses: ledgerhq/actions/.github/workflows/stop-linux-runner.yml@main
if: ${{ always() }}
with:
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
secrets:
CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}

run-bot:
needs: [start-runner]
runs-on: ${{ needs.start-runner.outputs.label }}
steps:
- name: prepare runner
run: |
sudo growpart /dev/nvme0n1 1
sudo resize2fs /dev/nvme0n1p1
- uses: actions/checkout@v3
with:
ref: ${{github.event.inputs.ref}}
- name: Retrieving coin apps
uses: actions/checkout@v2
with:
repository: LedgerHQ/coin-apps
token: ${{ secrets.PAT }}
path: coin-apps
- uses: actions/setup-node@master
with:
node-version: 14.x
- name: install yarn
run: npm i -g yarn
- name: pull docker image
run: docker pull ghcr.io/ledgerhq/speculos
- name: kill apt-get
run: sudo killall -w apt-get apt || echo OK
- name: Install linux deps
run: sudo apt-get install -y libusb-1.0-0-dev jq
- name: Install dependencies
run: |
yarn global add yalc
yarn --frozen-lockfile
yarn ci-setup-cli
- name: BOT
env:
SHOW_LEGACY_NEW_ACCOUNT: "1"
DEBUG_HTTP_RESPONSE: "1"
SEED: ${{ secrets.SEED4 }}
BOT_REPORT_FOLDER: botreport
VERBOSE_FILE: botreport/logs.txt
GITHUB_SHA: ${GITHUB_SHA}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_WORKFLOW: ${{ github.workflow }}
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
SLACK_CHANNEL: explorer-bot-stg
BOT_FILTER_FAMILY: bitcoin
EXPLORER: https://explorers.api-01.live.ledger-stg.com
run: mkdir botreport; COINAPPS=$PWD/coin-apps yarn ci-test-bot
timeout-minutes: 120
- name: Run coverage
if: failure() || success()
run: CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} npx codecov
- name: upload logs
if: failure() || success()
uses: actions/upload-artifact@v1
with:
name: botreport
path: botreport/
90 changes: 90 additions & 0 deletions .github/workflows/bot-staging-explorer-eth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Bot Staging Explorer 'Ethereum'
on:
schedule:
- cron: 0 8,12,16 * * 1-5

workflow_dispatch:
inputs:
ref:
description: "Which ref (branch or tag) to pull from ?"
required: false
default: master

jobs:
start-runner:
name: "start ec2 instance (Linux)"
if: ${{ always() }}
uses: ledgerhq/actions/.github/workflows/start-linux-runner.yml@main
secrets:
CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}

stop-runner:
name: "stop ec2 instance (Linux)"
needs: [start-runner, run-bot]
uses: ledgerhq/actions/.github/workflows/stop-linux-runner.yml@main
if: ${{ always() }}
with:
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
secrets:
CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}

run-bot:
needs: [start-runner]
runs-on: ${{ needs.start-runner.outputs.label }}
steps:
- name: prepare runner
run: |
sudo growpart /dev/nvme0n1 1
sudo resize2fs /dev/nvme0n1p1
- uses: actions/checkout@v3
with:
ref: ${{github.event.inputs.ref}}
- name: Retrieving coin apps
uses: actions/checkout@v2
with:
repository: LedgerHQ/coin-apps
token: ${{ secrets.PAT }}
path: coin-apps
- uses: actions/setup-node@master
with:
node-version: 14.x
- name: install yarn
run: npm i -g yarn
- name: pull docker image
run: docker pull ghcr.io/ledgerhq/speculos
- name: kill apt-get
run: sudo killall -w apt-get apt || echo OK
- name: Install linux deps
run: sudo apt-get install -y libusb-1.0-0-dev jq
- name: Install dependencies
run: |
yarn global add yalc
yarn --frozen-lockfile
yarn ci-setup-cli
- name: BOT
env:
SHOW_LEGACY_NEW_ACCOUNT: "1"
DEBUG_HTTP_RESPONSE: "1"
SEED: ${{ secrets.SEED2 }}
BOT_REPORT_FOLDER: botreport
VERBOSE_FILE: botreport/logs.txt
GITHUB_SHA: ${GITHUB_SHA}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_WORKFLOW: ${{ github.workflow }}
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
SLACK_CHANNEL: explorer-bot-stg
BOT_FILTER_FAMILY: ethereum
EXPLORER: https://explorers.api-01.live.ledger-stg.com
run: mkdir botreport; COINAPPS=$PWD/coin-apps yarn ci-test-bot
timeout-minutes: 120
- name: Run coverage
if: failure() || success()
run: CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} npx codecov
- name: upload logs
if: failure() || success()
uses: actions/upload-artifact@v1
with:
name: botreport
path: botreport/
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "git",
"url": "https://github.com/LedgerHQ/ledger-live-common"
},
"version": "22.0.2",
"version": "22.0.3",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"license": "Apache-2.0",
Expand Down Expand Up @@ -52,24 +52,24 @@
"@ethereumjs/common": "^2.6.2",
"@ethereumjs/tx": "^3.5.0",
"@ledgerhq/compressjs": "1.3.2",
"@ledgerhq/cryptoassets": "6.28.0",
"@ledgerhq/devices": "6.24.1",
"@ledgerhq/cryptoassets": "6.28.1",
"@ledgerhq/devices": "6.27.1",
"@ledgerhq/errors": "6.10.0",
"@ledgerhq/hw-app-algorand": "6.24.1",
"@ledgerhq/hw-app-btc": "6.24.1",
"@ledgerhq/hw-app-cosmos": "6.24.1",
"@ledgerhq/hw-app-eth": "6.27.0",
"@ledgerhq/hw-app-polkadot": "6.24.1",
"@ledgerhq/hw-app-solana": "^6.27.0",
"@ledgerhq/hw-app-str": "6.24.1",
"@ledgerhq/hw-app-tezos": "6.24.1",
"@ledgerhq/hw-app-trx": "6.24.1",
"@ledgerhq/hw-app-xrp": "6.24.1",
"@ledgerhq/hw-transport": "6.24.1",
"@ledgerhq/hw-transport-mocker": "6.24.1",
"@ledgerhq/hw-transport-node-speculos": "6.24.1",
"@ledgerhq/hw-app-algorand": "6.27.1",
"@ledgerhq/hw-app-btc": "6.27.1",
"@ledgerhq/hw-app-cosmos": "6.27.1",
"@ledgerhq/hw-app-eth": "6.28.1",
"@ledgerhq/hw-app-polkadot": "6.27.1",
"@ledgerhq/hw-app-solana": "^6.27.1",
"@ledgerhq/hw-app-str": "6.27.1",
"@ledgerhq/hw-app-tezos": "6.27.1",
"@ledgerhq/hw-app-trx": "6.27.1",
"@ledgerhq/hw-app-xrp": "6.27.1",
"@ledgerhq/hw-transport": "6.27.1",
"@ledgerhq/hw-transport-mocker": "6.27.1",
"@ledgerhq/hw-transport-node-speculos": "6.27.1",
"@ledgerhq/json-bignumber": "^1.1.0",
"@ledgerhq/live-app-sdk": "^0.2.0",
"@ledgerhq/live-app-sdk": "^0.6.1",
"@ledgerhq/logs": "6.10.0",
"@polkadot/types": "7.8.1",
"@polkadot/types-known": "7.8.1",
Expand Down
2 changes: 1 addition & 1 deletion src/apps/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function shouldUpgrade(
const appVersionsRequired = {
Cosmos: ">= 2.14",
Algorand: ">= 1.2.9",
Polkadot: ">= 11.9170.0",
Polkadot: ">= 12.9180.0",
Elrond: ">= 1.0.11",
Ethereum: ">= 1.9.17",
Solana: ">= 1.2.0",
Expand Down
2 changes: 2 additions & 0 deletions src/families/ethereum/nft.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ describe("OpenSea lazy minting bs", () => {
// -2 off-chain & -3 on-chain -> 0 on-chain (3 off-chain)
// +1 on-chain -> 1 on-chain (and 3 off-chain)

const prevOperations = ops.slice(0);
const nfts = nftsFromOperations(ops);
expect(prevOperations).toEqual(ops); // ensure preserved order of operations
expect(nfts[0].amount.toNumber()).toBe(1);
});
});
4 changes: 3 additions & 1 deletion src/nft/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { API, apiForCurrency } from "../api/Ethereum";

export const nftsFromOperations = (ops: Operation[]): ProtoNFT[] => {
const nftsMap = ops
.slice(0)
// make sure we have the operation in chronological order (older first)
.sort((a, b) => a.date.getTime() - b.date.getTime())
// if ops are Operations get the prop nftOperations, else ops are considered nftOperations already
Expand Down Expand Up @@ -67,7 +68,8 @@ export const nftsFromOperations = (ops: Operation[]): ProtoNFT[] => {
return acc;
}, {});

return Object.values(nftsMap);
// We reverse the array to make it from latest to oldest again
return Object.values(nftsMap).reverse();
};

/**
Expand Down
Loading

1 comment on commit 6fafc8d

@vercel
Copy link

@vercel vercel bot commented on 6fafc8d Apr 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.