@ledgerhq/coin-framework 0.3.2 → 0.3.3-nightly.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @ledgerhq/coin-framework
2
2
 
3
+ ## 0.3.3-nightly.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`817a8dd811`](https://github.com/LedgerHQ/ledger-live/commit/817a8dd8112ff7c4640852ab4e47ea0436df2ec1), [`22491091f7`](https://github.com/LedgerHQ/ledger-live/commit/22491091f7b4e06ee6a0cdf964498aa5b08d6eb0)]:
8
+ - @ledgerhq/cryptoassets@9.6.0-nightly.0
9
+ - @ledgerhq/live-env@0.3.0-nightly.0
10
+
3
11
  ## 0.3.2
4
12
 
5
13
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/coin-framework",
3
- "version": "0.3.2",
3
+ "version": "0.3.3-nightly.0",
4
4
  "description": "Ledger framework for Coin integration",
5
5
  "keywords": [
6
6
  "Ledger",
@@ -61,11 +61,11 @@
61
61
  "prando": "^6.0.1",
62
62
  "rxjs": "^6.6.7",
63
63
  "rxjs-compat": "^6.6.7",
64
- "@ledgerhq/cryptoassets": "^9.5.0",
64
+ "@ledgerhq/cryptoassets": "^9.6.0-nightly.0",
65
65
  "@ledgerhq/devices": "^8.0.2",
66
66
  "@ledgerhq/errors": "^6.12.5",
67
67
  "@ledgerhq/hw-transport": "^6.28.3",
68
- "@ledgerhq/live-env": "^0.2.0",
68
+ "@ledgerhq/live-env": "^0.3.0-nightly.0",
69
69
  "@ledgerhq/live-portfolio": "^0.0.4",
70
70
  "@ledgerhq/live-promise": "^0.0.1",
71
71
  "@ledgerhq/logs": "^6.10.1",
@@ -28,7 +28,10 @@ const appendPendingOp = (ops: Operation[], op: Operation) => {
28
28
  return filtered;
29
29
  };
30
30
 
31
- export const addPendingOperation = (account: Account, operation: Operation) => {
31
+ export const addPendingOperation = (
32
+ account: Account,
33
+ operation: Operation
34
+ ): Account => {
32
35
  const accountCopy = { ...account };
33
36
  const { subOperations } = operation;
34
37
  const { subAccounts } = account;
package/src/bot/specs.ts CHANGED
@@ -13,6 +13,7 @@ import { Account, TransactionCommon } from "@ledgerhq/types-live";
13
13
  import { botTest } from "./bot-test-context";
14
14
  import { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
15
15
  import BigNumber from "bignumber.js";
16
+ import { DeviceModelId } from "@ledgerhq/devices";
16
17
 
17
18
  export { botTest };
18
19
 
@@ -94,10 +95,6 @@ export function deviceActionFlow<T extends TransactionCommon>(
94
95
  description: FlowDesc<T>
95
96
  ): DeviceAction<T, State<T>> {
96
97
  return (arg: DeviceActionArg<T, State<T>>) => {
97
- invariant(
98
- arg.appCandidate.model === "nanoS",
99
- "FIXME: stepper logic is only implemented for Nano S"
100
- );
101
98
  const { transport, event, state, disableStrictStepValueValidation } = arg;
102
99
  let { finalState, stepTitle, stepValue, acc, currentStep } = state || {
103
100
  finalState: false,
@@ -118,13 +115,20 @@ export function deviceActionFlow<T extends TransactionCommon>(
118
115
  currentStep.stepValueTransform || stepValueTransformDefault;
119
116
 
120
117
  if (!ignoreAssertionFailure && !disableStrictStepValueValidation) {
121
- botTest("deviceAction confirm step '" + stepTitle + "'", () =>
118
+ botTest("deviceAction confirm step '" + stepTitle + "'", () => {
122
119
  expect({
123
120
  [stepTitle]: stepValueTransform(stepValue),
124
121
  }).toMatchObject({
125
- [stepTitle]: expectedValue(arg, acc).trim(),
126
- })
127
- );
122
+ // FIXME: OCR of speculos couldn't retrieve S properly
123
+ // Issue on speculos repository : https://github.com/LedgerHQ/speculos/issues/204
124
+ [stepTitle]: expectedValue(arg, acc)
125
+ .replace(
126
+ /S/g,
127
+ arg.appCandidate.model === DeviceModelId.nanoS ? "S" : ""
128
+ )
129
+ .trim(),
130
+ });
131
+ });
128
132
  }
129
133
  }
130
134