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": "^4.24.0",
"@ledgerhq/hw-transport-node-hid": "4.24.0", "@ledgerhq/hw-transport-node-hid": "4.24.0",
"@ledgerhq/ledger-core": "2.0.0-rc.8", "@ledgerhq/ledger-core": "2.0.0-rc.8",
"@ledgerhq/live-common": "4.1.3", "@ledgerhq/live-common": "4.3.0",
"animated": "^0.2.2", "animated": "^0.2.2",
"async": "^2.6.1", "async": "^2.6.1",
"axios": "^0.18.0", "axios": "^0.18.0",
@ -74,7 +74,7 @@
"qs": "^6.5.1", "qs": "^6.5.1",
"raven": "^2.5.0", "raven": "^2.5.0",
"raven-js": "^3.24.2", "raven-js": "^3.24.2",
"react": "^16.4.1", "react": "^16.6.1",
"react-dom": "^16.4.1", "react-dom": "^16.4.1",
"react-i18next": "^7.7.0", "react-i18next": "^7.7.0",
"react-key-handler": "^1.0.1", "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 value = BigNumber(tx.value)
const fee = BigNumber(tx.gas_price * tx.gas_used) const fee = BigNumber(tx.gas_price * tx.gas_used)
if (sending) { if (sending) {
ops.push({ const op: $Exact<Operation> = {
id: `${account.id}-${tx.hash}-OUT`, id: `${account.id}-${tx.hash}-OUT`,
hash: tx.hash, hash: tx.hash,
type: 'OUT', type: 'OUT',
@ -85,10 +85,12 @@ const txToOps = (account: Account) => (tx: Tx): Operation[] => {
senders: [tx.from], senders: [tx.from],
recipients: [tx.to], recipients: [tx.to],
date: new Date(tx.received_at), date: new Date(tx.received_at),
}) extra: {},
}
ops.push(op)
} }
if (receiving) { if (receiving) {
ops.push({ const op: $Exact<Operation> = {
id: `${account.id}-${tx.hash}-IN`, id: `${account.id}-${tx.hash}-IN`,
hash: tx.hash, hash: tx.hash,
type: 'IN', type: 'IN',
@ -100,7 +102,9 @@ const txToOps = (account: Account) => (tx: Tx): Operation[] => {
senders: [tx.from], senders: [tx.from],
recipients: [tx.to], recipients: [tx.to],
date: new Date(new Date(tx.received_at) + 1), // hack: make the IN appear after the OUT in history. 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 return ops
} }
@ -169,7 +173,7 @@ const signAndBroadcast = async ({
const hash = await api.broadcastTransaction(transaction) const hash = await api.broadcastTransaction(transaction)
onOperationBroadcasted({ const op: $Exact<Operation> = {
id: `${a.id}-${hash}-OUT`, id: `${a.id}-${hash}-OUT`,
hash, hash,
type: 'OUT', type: 'OUT',
@ -182,7 +186,10 @@ const signAndBroadcast = async ({
recipients: [t.recipient], recipients: [t.recipient],
transactionSequenceNumber: nonce, transactionSequenceNumber: nonce,
date: new Date(), 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) const hash = computeBinaryTransactionHash(transaction)
onOperationBroadcasted({ const op: $Exact<Operation> = {
id: `${a.id}-${hash}-OUT`, id: `${a.id}-${hash}-OUT`,
hash, hash,
accountId: a.id, accountId: a.id,
@ -121,7 +121,9 @@ async function signAndBroadcast({ a, t, deviceId, isCancelled, onSigned, onOpera
transactionSequenceNumber: transactionSequenceNumber:
(a.operations.length > 0 ? a.operations[0].transactionSequenceNumber : 0) + (a.operations.length > 0 ? a.operations[0].transactionSequenceNumber : 0) +
a.pendingOperations.length, a.pendingOperations.length,
}) extra: {},
}
onOperationBroadcasted(op)
} }
} finally { } finally {
api.disconnect() api.disconnect()
@ -231,6 +233,7 @@ const txToOperation = (account: Account) => ({
recipients: [destination.address], recipients: [destination.address],
date: new Date(timestamp), date: new Date(timestamp),
transactionSequenceNumber: sequence, transactionSequenceNumber: sequence,
extra: {},
} }
return op return op
} }

6
src/commands/libcoreSignAndBroadcast.js

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

3
src/helpers/libcore.js

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

30
yarn.lock

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

Loading…
Cancel
Save