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

Commit

Permalink
Remove all libcore codebase (#1831)
Browse files Browse the repository at this point in the history
* Remove all libcore codebase

* trigger some bot (commit to revert before merging this PR)

* lint

* remove useless cli test run

* fix type issue

* cli update

* Revert "trigger some bot (commit to revert before merging this PR)"

This reverts commit add2667.

* update cli/README

* fix merge

* Cosmos js (#1832)

Document Nano app limitations + minor fix on reward amounts

* Modularize the all.libcore.tests (#1834)

* Additional cleanup on bitcoin implem

* LIVE-1873

Co-authored-by: wa-aal <[email protected]>
Co-authored-by: haammar-ledger <[email protected]>
  • Loading branch information
3 people authored and lambertkevin committed Apr 8, 2022
1 parent 0b46df3 commit 70170a0
Show file tree
Hide file tree
Showing 165 changed files with 21,240 additions and 25,306 deletions.
3 changes: 0 additions & 3 deletions .circleci.disabled/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,3 @@ jobs:
paths:
- ~/.cache/yarn
- run: yarn ci-lint
- run:
command: yarn ci-test-cli
no_output_timeout: 1h
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
src/data/icons
src/data/flags

src/libcore/types/*.js
src/families/*/types.js
src/libcore/platforms/*.js
src/generated
src/load/tokens/
mobile-test-app/
6 changes: 0 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ jobs:
yarn global add yalc
yarn --frozen-lockfile --network-timeout 100000
yarn ci-setup-cli
- name: Run CLI tests
run: yarn ci-test-cli
timeout-minutes: 60
cli:
strategy:
Expand All @@ -163,6 +160,3 @@ jobs:
yarn global add yalc
yarn --frozen-lockfile --network-timeout 100000
yarn ci-setup-cli
- name: Run CLI tests
run: yarn ci-test-cli
timeout-minutes: 60
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
libcoredb/

dbdata
tmp

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,16 @@ The stack is pretty standard for a ES6 and FlowType library. The notable depende
- [Countervalues logic](./docs/countervalues.md)
- Coin integration specifics
- [Introduction](./docs/ci-intro.md)
- Bridge implementations, where to start? (JS, Libcore, Mock)
- Bridge implementations, where to start? (JS, Mock)
- Implementing the hardware wallet logic of a new coin
- [The account derivation (BIP44 and exceptions)](./docs/derivation.md)
- Advanced
- [api/socket `createDeviceSocket` and script runner](./docs/socket.md)
- env.js: live-common configuration system
- Serialization and reconciliation
- libcore typing and wrapping
- cross.js and "LiveQR" protocol
- cache.js helpers
- Tokens management and ERC20
- [Developing with lib-ledger-core bindings](./docs/adding-libcore-bindings.md)

### Developing with Ledger Live Common

Expand Down
380 changes: 293 additions & 87 deletions cli/README.md

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
"build": "tsc --project src/tsconfig.json",
"prepublishOnly": "rm -rf lib && tsc --project src/tsconfig.json",
"watch": "tsc --watch --project src/tsconfig.json",
"test-e2e": "./scripts/tests.sh",
"test": "yarn run test-e2e",
"testOne": "./scripts/testOne.sh",
"createTest": "./scripts/createTest.sh",
"type-check": "tsc --noEmit"
},
"peerDependencies": {
Expand All @@ -38,8 +34,7 @@
"@ledgerhq/hw-transport-mocker": "6.24.1",
"@ledgerhq/hw-transport-node-hid": "6.24.1",
"@ledgerhq/hw-transport-node-speculos": "6.24.1",
"@ledgerhq/ledger-core": "6.14.5",
"@ledgerhq/live-common": "^21.34.0",
"@ledgerhq/live-common": "https://github.com/LedgerHQ/ledger-live-common.git#082c946830a332f764f3c95c0eb9c0572b493825",
"@ledgerhq/logs": "6.10.0",
"@walletconnect/client": "^1.7.1",
"asciichart": "^1.5.25",
Expand Down
18 changes: 0 additions & 18 deletions cli/scripts/createTest.sh

This file was deleted.

3 changes: 0 additions & 3 deletions cli/scripts/test.template/test.sh

This file was deleted.

67 changes: 0 additions & 67 deletions cli/scripts/testOne.sh

This file was deleted.

3 changes: 0 additions & 3 deletions cli/scripts/tests.sh

This file was deleted.

8 changes: 0 additions & 8 deletions cli/src/commands-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ import generateAppJsonFromDataset from "./commands/generateAppJsonFromDataset";
import generateTestScanAccounts from "./commands/generateTestScanAccounts";
import generateTestTransaction from "./commands/generateTestTransaction";
import genuineCheck from "./commands/genuineCheck";
import getAccountNetworkInfo from "./commands/getAccountNetworkInfo";
import getAddress from "./commands/getAddress";
import getTransactionStatus from "./commands/getTransactionStatus";
import libcoreReset from "./commands/libcoreReset";
import libcoreSetPassword from "./commands/libcoreSetPassword";
import liveData from "./commands/liveData";
import makeCompoundSummary from "./commands/makeCompoundSummary";
import managerListApps from "./commands/managerListApps";
Expand All @@ -48,7 +45,6 @@ import sync from "./commands/sync";
import testDetectOpCollision from "./commands/testDetectOpCollision";
import testGetTrustedInputFromTxHash from "./commands/testGetTrustedInputFromTxHash";
import user from "./commands/user";
import validRecipient from "./commands/validRecipient";
import version from "./commands/version";
import walletconnect from "./commands/walletconnect";

Expand Down Expand Up @@ -80,11 +76,8 @@ export default {
generateTestScanAccounts,
generateTestTransaction,
genuineCheck,
getAccountNetworkInfo,
getAddress,
getTransactionStatus,
libcoreReset,
libcoreSetPassword,
liveData,
makeCompoundSummary,
managerListApps,
Expand All @@ -103,7 +96,6 @@ export default {
testDetectOpCollision,
testGetTrustedInputFromTxHash,
user,
validRecipient,
version,
walletconnect,
};
40 changes: 0 additions & 40 deletions cli/src/commands/getAccountNetworkInfo.ts

This file was deleted.

8 changes: 0 additions & 8 deletions cli/src/commands/libcoreReset.ts

This file was deleted.

21 changes: 0 additions & 21 deletions cli/src/commands/libcoreSetPassword.ts

This file was deleted.

46 changes: 0 additions & 46 deletions cli/src/commands/validRecipient.ts

This file was deleted.

11 changes: 1 addition & 10 deletions cli/src/commands/version.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* eslint-disable global-require, @typescript-eslint/no-var-requires */
import { from, of, concat, Observable } from "rxjs";
import { map } from "rxjs/operators";
import { withLibcore } from "@ledgerhq/live-common/lib/libcore/access";
import { of, concat, Observable } from "rxjs";

export default {
args: [],
Expand All @@ -11,13 +9,6 @@ export default {
of(
"@ledgerhq/live-common: " +
require("@ledgerhq/live-common/package.json").version
),
of(
"@ledgerhq/ledger-core: " +
require("@ledgerhq/ledger-core/package.json").version
),
from(withLibcore((core) => core.LedgerCore.getStringVersion())).pipe(
map((v) => "libcore: " + v)
)
),
};
13 changes: 2 additions & 11 deletions cli/src/live-common-setup-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import winston from "winston";
import { EnvName, setEnvUnsafe } from "@ledgerhq/live-common/lib/env";
import simple from "@ledgerhq/live-common/lib/logs/simple";
import { listen } from "@ledgerhq/logs";
import implementLibcore from "@ledgerhq/live-common/lib/libcore/platforms/nodejs";
import { setSupportedCurrencies } from "@ledgerhq/live-common/lib/currencies";
import { setPlatformVersion } from "@ledgerhq/live-common/lib/platform/version";

Expand Down Expand Up @@ -106,14 +105,11 @@ listen((log) => {
const { type } = log;
let level = "info";

if (type === "libcore-call" || type === "libcore-result") {
level = "silly";
} else if (
if (
type === "apdu" ||
type === "hw" ||
type === "speculos" ||
type.includes("debug") ||
type.startsWith("libcore")
type.includes("debug")
) {
level = "debug";
} else if (type.includes("warn")) {
Expand All @@ -128,8 +124,3 @@ listen((log) => {
// @ts-ignore
logger.log(level, log);
});
implementLibcore({
lib: () => require("@ledgerhq/ledger-core"),
// eslint-disable-line global-require
dbPath: process.env.LIBCORE_DB_PATH || "./dbdata",
});
Loading

0 comments on commit 70170a0

Please sign in to comment.