mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-06 05:45:48 +00:00
import from lodash/
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable complexity -- verifies 19 tx types hence a lot of checks needed */
|
/* eslint-disable complexity -- verifies 19 tx types hence a lot of checks needed */
|
||||||
/* eslint-disable max-lines-per-function -- need to work with a lot of Tx verifications */
|
/* eslint-disable max-lines-per-function -- need to work with a lot of Tx verifications */
|
||||||
|
|
||||||
import _ from 'lodash'
|
import isEqual from 'lodash/isEqual'
|
||||||
import { encode, decode } from 'ripple-binary-codec'
|
import { encode, decode } from 'ripple-binary-codec'
|
||||||
|
|
||||||
import { ValidationError } from '../../errors'
|
import { ValidationError } from '../../errors'
|
||||||
@@ -164,7 +164,7 @@ export function validate(transaction: Record<string, unknown>): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!_.isEqual(
|
!isEqual(
|
||||||
decode(encode(tx)),
|
decode(encode(tx)),
|
||||||
omitBy(tx, (value) => value == null),
|
omitBy(tx, (value) => value == null),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import BigNumber from 'bignumber.js'
|
import BigNumber from 'bignumber.js'
|
||||||
import _ from 'lodash'
|
import groupBy from 'lodash/groupBy'
|
||||||
|
|
||||||
import { Amount, IssuedCurrencyAmount } from '../models/common'
|
import { Amount, IssuedCurrencyAmount } from '../models/common'
|
||||||
import TransactionMetadata, { Node } from '../models/transactions/metadata'
|
import TransactionMetadata, { Node } from '../models/transactions/metadata'
|
||||||
@@ -66,7 +66,7 @@ function normalizeNodes(metadata: TransactionMetadata): NormalizedNode[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function groupByAccount(balanceChanges: BalanceChange[]): BalanceChanges[] {
|
function groupByAccount(balanceChanges: BalanceChange[]): BalanceChanges[] {
|
||||||
const grouped = _.groupBy(balanceChanges, (node) => node.account)
|
const grouped = groupBy(balanceChanges, (node) => node.account)
|
||||||
return Object.entries(grouped).map(([account, items]) => {
|
return Object.entries(grouped).map(([account, items]) => {
|
||||||
return { account, balances: items.map((item) => item.balance) }
|
return { account, balances: items.map((item) => item.balance) }
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { assert } from 'chai'
|
import { assert } from 'chai'
|
||||||
import _ from 'lodash'
|
|
||||||
|
|
||||||
import { ServerInfoResponse } from '../src'
|
import { ServerInfoResponse } from '../src'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { assert } from 'chai'
|
import { assert } from 'chai'
|
||||||
import _ from 'lodash'
|
|
||||||
|
|
||||||
import { Client } from 'xrpl-local'
|
import { Client } from 'xrpl-local'
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
import net from 'net'
|
import net from 'net'
|
||||||
|
|
||||||
import { assert } from 'chai'
|
import { assert } from 'chai'
|
||||||
import _ from 'lodash'
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Client,
|
Client,
|
||||||
|
|||||||
Reference in New Issue
Block a user