Browse Source

Bump react & live-common

gre-patch-1
Gaëtan Renaudeau 6 years ago
parent
commit
9460b838f8
No known key found for this signature in database GPG Key ID: 7B66B85F042E5451
  1. 4
      package.json
  2. 19
      src/bridge/EthereumJSBridge.js
  3. 7
      src/bridge/RippleJSBridge.js
  4. 6
      src/commands/libcoreSignAndBroadcast.js
  5. 3
      src/helpers/libcore.js
  6. 30
      yarn.lock

4
package.json

@ -41,7 +41,7 @@
"@ledgerhq/hw-transport": "^4.24.0",
"@ledgerhq/hw-transport-node-hid": "4.24.0",
"@ledgerhq/ledger-core": "2.0.0-rc.8",
"@ledgerhq/live-common": "4.1.3",
"@ledgerhq/live-common": "4.3.0",
"animated": "^0.2.2",
"async": "^2.6.1",
"axios": "^0.18.0",
@ -74,7 +74,7 @@
"qs": "^6.5.1",
"raven": "^2.5.0",
"raven-js": "^3.24.2",
"react": "^16.4.1",
"react": "^16.6.1",
"react-dom": "^16.4.1",
"react-i18next": "^7.7.0",
"react-key-handler": "^1.0.1",

19
src/bridge/EthereumJSBridge.js

@ -73,7 +73,7 @@ const txToOps = (account: Account) => (tx: Tx): Operation[] => {
const value = BigNumber(tx.value)
const fee = BigNumber(tx.gas_price * tx.gas_used)
if (sending) {
ops.push({
const op: $Exact<Operation> = {
id: `${account.id}-${tx.hash}-OUT`,
hash: tx.hash,
type: 'OUT',
@ -85,10 +85,12 @@ const txToOps = (account: Account) => (tx: Tx): Operation[] => {
senders: [tx.from],
recipients: [tx.to],
date: new Date(tx.received_at),
})
extra: {},
}
ops.push(op)
}
if (receiving) {
ops.push({
const op: $Exact<Operation> = {
id: `${account.id}-${tx.hash}-IN`,
hash: tx.hash,
type: 'IN',
@ -100,7 +102,9 @@ const txToOps = (account: Account) => (tx: Tx): Operation[] => {
senders: [tx.from],
recipients: [tx.to],
date: new Date(new Date(tx.received_at) + 1), // hack: make the IN appear after the OUT in history.
})
extra: {},
}
ops.push(op)
}
return ops
}
@ -169,7 +173,7 @@ const signAndBroadcast = async ({
const hash = await api.broadcastTransaction(transaction)
onOperationBroadcasted({
const op: $Exact<Operation> = {
id: `${a.id}-${hash}-OUT`,
hash,
type: 'OUT',
@ -182,7 +186,10 @@ const signAndBroadcast = async ({
recipients: [t.recipient],
transactionSequenceNumber: nonce,
date: new Date(),
})
extra: {},
}
onOperationBroadcasted(op)
}
}

7
src/bridge/RippleJSBridge.js

@ -105,7 +105,7 @@ async function signAndBroadcast({ a, t, deviceId, isCancelled, onSigned, onOpera
const hash = computeBinaryTransactionHash(transaction)
onOperationBroadcasted({
const op: $Exact<Operation> = {
id: `${a.id}-${hash}-OUT`,
hash,
accountId: a.id,
@ -121,7 +121,9 @@ async function signAndBroadcast({ a, t, deviceId, isCancelled, onSigned, onOpera
transactionSequenceNumber:
(a.operations.length > 0 ? a.operations[0].transactionSequenceNumber : 0) +
a.pendingOperations.length,
})
extra: {},
}
onOperationBroadcasted(op)
}
} finally {
api.disconnect()
@ -231,6 +233,7 @@ const txToOperation = (account: Account) => ({
recipients: [destination.address],
date: new Date(timestamp),
transactionSequenceNumber: sequence,
extra: {},
}
return op
}

6
src/commands/libcoreSignAndBroadcast.js

@ -280,7 +280,7 @@ export async function doSignAndBroadcast({
const fee = libcoreAmountToBigNumber(builded.getFees())
// NB we don't check isCancelled() because the broadcast is not cancellable now!
onOperationBroadcasted({
const op: $Exact<OperationRaw> = {
id: `${xpub}-${txHash}-OUT`,
hash: txHash,
type: 'OUT',
@ -294,7 +294,9 @@ export async function doSignAndBroadcast({
recipients,
accountId,
date: new Date().toISOString(),
})
extra: {},
}
onOperationBroadcasted(op)
}
export default cmd

3
src/helpers/libcore.js

@ -425,7 +425,7 @@ function buildOperationRaw({
core: *,
op: NJSOperation,
xpub: string,
}): OperationRaw {
}): $Exact<OperationRaw> {
const bitcoinLikeOperation = op.asBitcoinLikeOperation()
const bitcoinLikeTransaction = bitcoinLikeOperation.getTransaction()
const hash = bitcoinLikeTransaction.getHash()
@ -459,6 +459,7 @@ function buildOperationRaw({
blockHash: null,
accountId: xpub, // FIXME accountId: xpub !?
date: op.getDate().toISOString(),
extra: {},
}
}

30
yarn.lock

@ -1753,10 +1753,10 @@
bindings "^1.3.0"
nan "^2.6.2"
"@ledgerhq/live-common@4.1.3":
version "4.1.3"
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-4.1.3.tgz#dbd5be04925b11b4bf646520fe01a8959554c561"
integrity sha512-4FZ6th8ZtpC0B20olsyqF9hb0VUhVkLeiO/QyWzKa+bdn7jt4PgOyUdaKbRuoW2w9UKj2qkXgIgBIaZ+l0AlJA==
"@ledgerhq/live-common@4.3.0":
version "4.3.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-4.3.0.tgz#f983cb691642f1372d89e6a9320986141ab31045"
integrity sha512-086MHRLvkPB7qxpzBGm2W1bE3yMbUxwCF2JuEMiQzgTK4fNPYV9mz+qR+qhYYcUXuXZQ2fCnCBYDqUlfo1Wb3g==
dependencies:
"@ledgerhq/hw-app-btc" "^4.24.0"
"@ledgerhq/hw-app-eth" "^4.24.0"
@ -1769,7 +1769,7 @@
node-lzw "^0.3.1"
numeral "^2.0.6"
prando "^3.0.1"
react "^16.4.0"
react "*"
react-i18next "^8.0.7"
react-redux "^5.0.7"
redux "^4.0.0"
@ -13354,15 +13354,15 @@ react-treebeard@^2.1.0:
shallowequal "^0.2.2"
velocity-react "^1.3.1"
react@^16.2.0, react@^16.4.0, react@^16.4.1:
version "16.4.1"
resolved "https://registry.yarnpkg.com/react/-/react-16.4.1.tgz#de51ba5764b5dbcd1f9079037b862bd26b82fe32"
integrity sha512-3GEs0giKp6E0Oh/Y9ZC60CmYgUPnp7voH9fbjWsvXtYFb4EWtgQub0ADSq0sJR0BbHc4FThLLtzlcFaFXIorwg==
react@*, react@^16.6.1, react@^16.2.0:
version "16.6.1"
resolved "https://registry.yarnpkg.com/react/-/react-16.6.1.tgz#ee2aef4f0a09e494594882029821049772f915fe"
integrity sha512-OtawJThYlvRgm9BXK+xTL7BIlDx8vv21j+fbQDjRRUyok6y7NyjlweGorielTahLZHYIdKUoK2Dp9ByVWuMqxw==
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.0"
prop-types "^15.6.2"
scheduler "^0.11.0"
reactcss@^1.2.0:
version "1.2.3"
@ -14261,6 +14261,14 @@ sax@^1.2.4, sax@~1.2.1, sax@~1.2.4:
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
scheduler@^0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.11.0.tgz#def1f1bfa6550cc57981a87106e65e8aea41a6b5"
integrity sha512-MAYbBfmiEHxF0W+c4CxMpEqMYK+rYF584VP/qMKSiHM6lTkBKKYOJaDiSILpJHla6hBOsVd6GucPL46o2Uq3sg==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
schema-utils@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.3.0.tgz#f5877222ce3e931edae039f17eb3716e7137f8cf"

Loading…
Cancel
Save