diff --git a/ui/tx/TxInternals.tsx b/ui/tx/TxInternals.tsx index 3f0396c155..2542ff96fc 100644 --- a/ui/tx/TxInternals.tsx +++ b/ui/tx/TxInternals.tsx @@ -3,6 +3,7 @@ import React from 'react'; import type { InternalTransaction } from 'types/api/internalTransaction'; +import compareBns from 'lib/bigint/compareBns'; // import { apos } from 'lib/html-entities'; import { INTERNAL_TX } from 'stubs/internalTx'; import { generateListStub } from 'stubs/utils'; @@ -31,23 +32,20 @@ const getNextSortValue = (getNextSortValueShared).bind(undefine const sortFn = (sort: Sort | undefined) => (a: InternalTransaction, b: InternalTransaction) => { switch (sort) { case 'value-desc': { - const result = a.value > b.value ? -1 : 1; - return a.value === b.value ? 0 : result; + return compareBns(b.value, a.value); } case 'value-asc': { - const result = a.value > b.value ? 1 : -1; - return a.value === b.value ? 0 : result; + return compareBns(a.value, b.value); } case 'gas-limit-desc': { - const result = a.gas_limit > b.gas_limit ? -1 : 1; - return a.gas_limit === b.gas_limit ? 0 : result; + return compareBns(b.gas_limit, a.gas_limit); } case 'gas-limit-asc': { - const result = a.gas_limit > b.gas_limit ? 1 : -1; - return a.gas_limit === b.gas_limit ? 0 : result; + return compareBns(a.gas_limit, b.gas_limit); + } default: