format for latest standard
This commit is contained in:
parent
4108efd9c7
commit
c2af183911
77 changed files with 1697 additions and 1693 deletions
32
lib/tx.js
32
lib/tx.js
|
|
@ -13,7 +13,7 @@ function process (tx, pi) {
|
|||
|
||||
function post (tx, pi) {
|
||||
return process(tx, pi)
|
||||
.then(_.set('dirty', false))
|
||||
.then(_.set('dirty', false))
|
||||
}
|
||||
|
||||
function massage (tx) {
|
||||
|
|
@ -24,17 +24,17 @@ function massage (tx) {
|
|||
|
||||
const mapBN = r => {
|
||||
const update = r.direction === 'cashIn'
|
||||
? {
|
||||
cryptoAtoms: BN(r.cryptoAtoms),
|
||||
fiat: BN(r.fiat),
|
||||
cashInFee: BN(r.cashInFee),
|
||||
cashInFeeCrypto: BN(r.cashInFeeCrypto),
|
||||
minimumTx: BN(r.minimumTx)
|
||||
}
|
||||
: {
|
||||
cryptoAtoms: BN(r.cryptoAtoms),
|
||||
fiat: BN(r.fiat)
|
||||
}
|
||||
? {
|
||||
cryptoAtoms: BN(r.cryptoAtoms),
|
||||
fiat: BN(r.fiat),
|
||||
cashInFee: BN(r.cashInFee),
|
||||
cashInFeeCrypto: BN(r.cashInFeeCrypto),
|
||||
minimumTx: BN(r.minimumTx)
|
||||
}
|
||||
: {
|
||||
cryptoAtoms: BN(r.cryptoAtoms),
|
||||
fiat: BN(r.fiat)
|
||||
}
|
||||
|
||||
return _.assign(r, update)
|
||||
}
|
||||
|
|
@ -51,10 +51,10 @@ function cancel (txId) {
|
|||
]
|
||||
|
||||
return Promise.all(promises)
|
||||
.then(r => {
|
||||
if (_.some(r)) return
|
||||
throw new Error('No such transaction')
|
||||
})
|
||||
.then(r => {
|
||||
if (_.some(r)) return
|
||||
throw new Error('No such transaction')
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {post, cancel}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue