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

Commit

Permalink
Bump live-common
Browse files Browse the repository at this point in the history
  • Loading branch information
gre committed Apr 2, 2019
1 parent ee77ea9 commit a339a2c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -43,7 +43,7 @@
"@ledgerhq/hw-app-xrp": "4.48.0",
"@ledgerhq/hw-transport": "4.48.0",
"@ledgerhq/hw-transport-http": "4.48.0",
"@ledgerhq/live-common": "4.36.1",
"@ledgerhq/live-common": "4.38.1",
"@ledgerhq/react-native-hid": "4.48.0",
"@ledgerhq/react-native-hw-transport-ble": "4.48.0",
"@ledgerhq/react-native-ledger-core": "^0.5.2-rc",
Expand Down
10 changes: 5 additions & 5 deletions src/bridge/RNLibcoreAccountBridge.js
Expand Up @@ -12,9 +12,9 @@ import libcoreSignAndBroadcast from "@ledgerhq/live-common/lib/libcore/signAndBr
import { makeLRUCache } from "@ledgerhq/live-common/lib/cache";

export type Transaction = {
amount: BigNumber,
amount: BigNumber | string,
recipient: string,
feePerByte: ?BigNumber,
feePerByte: ?(BigNumber | string),
networkInfo: ?{ feeItems: FeeItems },
};

Expand Down Expand Up @@ -68,7 +68,7 @@ const editTransactionAmount = (account, t, amount) => ({
amount,
});

const getTransactionAmount = (a, t) => t.amount;
const getTransactionAmount = (a, t) => BigNumber(t.amount);

const editTransactionRecipient = (account, t, recipient) => ({
...t,
Expand Down Expand Up @@ -141,9 +141,9 @@ const checkValidTransaction = async (a, t) =>
: getFees(a, t).then(() => null);

const getTotalSpent = async (a, t) =>
t.amount.isZero()
BigNumber(t.amount).isZero()
? Promise.resolve(BigNumber(0))
: getFees(a, t).then(totalFees => t.amount.plus(totalFees || 0));
: getFees(a, t).then(totalFees => BigNumber(t.amount).plus(totalFees || 0));

const getMaxAmount = async (a, t) =>
getFees(a, t).then(totalFees => a.balance.minus(totalFees || 0));
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Expand Up @@ -5,7 +5,7 @@ import "./polyfill";
import "./live-common-setup";
import "./implement-react-native-libcore";
import React, { Fragment, Component } from "react";
import { StyleSheet, View, Text } from "react-native";
import { StyleSheet, View, Text, NativeModules } from "react-native";
import SplashScreen from "react-native-splash-screen";
import logger from "./logger";
import { exportSelector as settingsExportSelector } from "./reducers/settings";
Expand All @@ -29,6 +29,8 @@ import HookAnalytics from "./analytics/HookAnalytics";
import HookSentry from "./components/HookSentry";
import AppContainer from "./navigators";

console.log(NativeModules)

// useScreens();
const styles = StyleSheet.create({
root: {
Expand Down
2 changes: 2 additions & 0 deletions src/logic/accountModel.js
Expand Up @@ -31,6 +31,7 @@ const accountModel: DataModel<AccountRaw, Account> = createDataModel({
pendingOperations,
lastSyncDate,
balance,
tokenAccounts,
...acc
} = rawAccount;
const currency = getCryptoCurrencyById(currencyId);
Expand Down Expand Up @@ -62,6 +63,7 @@ const accountModel: DataModel<AccountRaw, Account> = createDataModel({
unit,
lastSyncDate,
balance,
tokenAccounts,
...acc
}: Account): AccountRaw => {
const convertOperation = ({ date, value, fee, ...op }) => ({
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -800,10 +800,10 @@
"@ledgerhq/errors" "^4.48.0"
events "^3.0.0"

"@ledgerhq/live-common@4.36.1":
version "4.36.1"
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-4.36.1.tgz#fc77a8064d10c9adc0d16d467d616b6f73e180ae"
integrity sha512-lwr/LsF3NTMFwtbkMSbQRFytpPEej2e79QVabGUUtU/oAxHcZuSzUGDcoj5J25V5POnLyzmAQdlA4ls7YSLOcQ==
"@ledgerhq/live-common@4.38.1":
version "4.38.1"
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-4.38.1.tgz#63b0ec60ecd1a44b7c1ecbe5b9d03845629723ca"
integrity sha512-H/PYqM+fhT/gxARqNsIGRoVZTn1ocG3e33ydbygHM5RAFNkK8Mj3LRUN6aPm0Ic6UkbxGnp/wCuU6LCi0nxTYg==
dependencies:
"@ledgerhq/errors" "^4.48.0"
"@ledgerhq/hw-app-btc" "^4.48.0"
Expand Down

0 comments on commit a339a2c

Please sign in to comment.