fix: #1403 format with asset decimals withdrawal limit values (#1603)

This commit is contained in:
m.ray 2022-10-04 11:54:38 +01:00 committed by GitHub
parent d889b8e970
commit 22ebbf746a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -239,7 +239,7 @@ const mockedData = {
quantum: '1',
source: {
contractAddress: '0x8ec701DA58394F5d2c8C2873D31039454D5845C1',
lifetimeLimit: '0',
lifetimeLimit: '1000000000000',
withdrawThreshold: '0',
__typename: 'ERC20',
},
@ -257,7 +257,7 @@ const mockedData = {
source: {
contractAddress: '0xDc335304979D378255015c33AbFf09B60c31EBAb',
lifetimeLimit: '0',
withdrawThreshold: '0',
withdrawThreshold: '100000000',
__typename: 'ERC20',
},
__typename: 'Asset',

View File

@ -1,4 +1,4 @@
import { t } from '@vegaprotocol/react-helpers';
import { addDecimalsFormatNumber, t } from '@vegaprotocol/react-helpers';
import type { Asset } from '@vegaprotocol/react-helpers';
import {
Button,
@ -104,7 +104,10 @@ export const AssetDetailsDialog = ({
{
key: 'withdrawalthreshold',
label: t('Withdrawal threshold'),
value: (asset.node.source as Schema.ERC20).withdrawThreshold,
value: addDecimalsFormatNumber(
(asset.node.source as Schema.ERC20).withdrawThreshold,
asset.node.decimals
),
tooltip: t(
'The maximum allowed per withdraw note: this is a temporary measure for restricted mainnet'
),
@ -112,7 +115,10 @@ export const AssetDetailsDialog = ({
{
key: 'lifetimelimit',
label: t('Lifetime limit'),
value: (asset.node.source as Schema.ERC20).lifetimeLimit,
value: addDecimalsFormatNumber(
(asset.node.source as Schema.ERC20).lifetimeLimit,
asset.node.decimals
),
tooltip: t(
'The lifetime limits deposit per address note: this is a temporary measure for restricted mainnet'
),