Browse Source

Prettier

gre-patch-1
Gaëtan Renaudeau 6 years ago
parent
commit
ee2631f028
No known key found for this signature in database GPG Key ID: 7B66B85F042E5451
  1. 1
      .prettierignore
  2. 3
      src/bridge/RippleJSBridge.js
  3. 16
      test-e2e/sync/sync-accounts.spec.js
  4. 6
      test-e2e/sync/wait-sync.js

1
.prettierignore

@ -1 +1,2 @@
package.json package.json
test-e2e/**/*.json

3
src/bridge/RippleJSBridge.js

@ -261,12 +261,11 @@ const recipientIsNew = async (endpointConfig, recipient) => {
} }
const cacheRecipientsNew = {} const cacheRecipientsNew = {}
const cachedRecipientIsNew= (endpointConfig, recipient) => { const cachedRecipientIsNew = (endpointConfig, recipient) => {
if (recipient in cacheRecipientsNew) return cacheRecipientsNew[recipient] if (recipient in cacheRecipientsNew) return cacheRecipientsNew[recipient]
return (cacheRecipientsNew[recipient] = recipientIsNew(endpointConfig, recipient)) return (cacheRecipientsNew[recipient] = recipientIsNew(endpointConfig, recipient))
} }
const RippleJSBridge: WalletBridge<Transaction> = { const RippleJSBridge: WalletBridge<Transaction> = {
scanAccountsOnDevice: (currency, deviceId) => scanAccountsOnDevice: (currency, deviceId) =>
Observable.create(o => { Observable.create(o => {

16
test-e2e/sync/sync-accounts.spec.js

@ -46,15 +46,13 @@ function getSanitized(filePath) {
const data = require(`${filePath}`) // eslint-disable-line import/no-dynamic-require const data = require(`${filePath}`) // eslint-disable-line import/no-dynamic-require
const accounts = data.data.accounts.map(a => a.data) const accounts = data.data.accounts.map(a => a.data)
accounts.sort(ACCOUNT_SORT) accounts.sort(ACCOUNT_SORT)
return accounts return accounts.map(a => pick(a, ACCOUNTS_FIELDS)).map(a => {
.map(a => pick(a, ACCOUNTS_FIELDS)) a.operations.sort(OP_SORT)
.map(a => { return {
a.operations.sort(OP_SORT) ...a,
return { operations: a.operations.map(o => pick(o, OPS_FIELDS)),
...a, }
operations: a.operations.map(o => pick(o, OPS_FIELDS)), })
}
})
} }
function getOpHash(op) { function getOpHash(op) {

6
test-e2e/sync/wait-sync.js

@ -27,7 +27,11 @@ async function waitForSync() {
const areAllSync = mapped.every(account => { const areAllSync = mapped.every(account => {
const diff = now - new Date(account.lastSyncDate).getTime() const diff = now - new Date(account.lastSyncDate).getTime()
if (diff <= MIN_TIME_DIFF) return true if (diff <= MIN_TIME_DIFF) return true
console.log(`[${account.name}] synced ${moment(account.lastSyncDate).fromNow()} (${moment(account.lastSyncDate).format('YYYY-MM-DD HH:mm:ss')})`) console.log(
`[${account.name}] synced ${moment(account.lastSyncDate).fromNow()} (${moment(
account.lastSyncDate,
).format('YYYY-MM-DD HH:mm:ss')})`,
)
return false return false
}) })
return areAllSync return areAllSync

Loading…
Cancel
Save