Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Remove all libcore codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
gre committed Mar 24, 2022
1 parent ac0792f commit 83071ab
Show file tree
Hide file tree
Showing 138 changed files with 64 additions and 10,291 deletions.
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/
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
5 changes: 0 additions & 5 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ Usage: ledger-live getTransactionStatus # Prepare a transaction and returns 'Tra
--fees <String> : how much fees
-f, --format <json> : how to display the data
Usage: ledger-live libcoreReset
Usage: ledger-live libcoreSetPassword
--password <String> : the new password
Usage: ledger-live liveData # utility for Ledger Live app.json file
--device <String> : provide a specific HID path of a device
--xpub <String> : use an xpub (alternatively to --device)
Expand Down
5 changes: 0 additions & 5 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,7 +34,6 @@
"@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/logs": "6.10.0",
"@walletconnect/client": "^1.7.1",
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.

4 changes: 0 additions & 4 deletions cli/src/commands-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ 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 Down Expand Up @@ -83,8 +81,6 @@ export default {
getAccountNetworkInfo,
getAddress,
getTransactionStatus,
libcoreReset,
libcoreSetPassword,
liveData,
makeCompoundSummary,
managerListApps,
Expand Down
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",
});
7 changes: 0 additions & 7 deletions cli/src/live-common-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@ checkLibs({
Transport,
connect,
});
import implementLibcore from "@ledgerhq/live-common/lib/libcore/platforms/nodejs";

type BluetoothTransport = any;

implementLibcore({
lib: () => require("@ledgerhq/ledger-core"),
// eslint-disable-line global-require
dbPath: process.env.LIBCORE_DB_PATH || "./dbdata",
});

let idCounter = 0;
const mockTransports = {};
const recordStores = {};
Expand Down
3 changes: 1 addition & 2 deletions cli/src/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ const implTypePerFamily = {
};
const possibleImpls = {
js: 1,
libcore: 1,
mock: 1,
};
export const inferCurrency = <
Expand Down Expand Up @@ -294,7 +293,7 @@ export function scan(arg: ScanCommonOpts): Observable<Account> {
const type =
findAndEat((s) => possibleImpls[s]) ||
implTypePerFamily[currency.family] ||
"libcore";
"js";
const version = findAndEat((s) => s.match(/^\d+$/)) || "1";
const derivationMode = asDerivationMode(
findAndEat((s) => {
Expand Down
Loading

0 comments on commit 83071ab

Please sign in to comment.