diff --git a/src/hooks/api/escrow/use-get-account-staking-data.tsx b/src/hooks/api/escrow/use-get-account-staking-data.tsx index 707f5af633..f8b6f405bf 100644 --- a/src/hooks/api/escrow/use-get-account-staking-data.tsx +++ b/src/hooks/api/escrow/use-get-account-staking-data.tsx @@ -26,7 +26,7 @@ type AccountStakingData = { amount: MonetaryAmount; apy: Big; }; - // limit: MonetaryAmount; + limit: MonetaryAmount; }; const getUnlockData = (stakeEndBlock: number, currentBlockNumber: number): AccountUnlockStakingData => { @@ -49,18 +49,13 @@ const getAccountStakingData = async (accountId: AccountId): Promise { diff --git a/src/test/mocks/@interlay/interbtc-api/parachain/api.ts b/src/test/mocks/@interlay/interbtc-api/parachain/api.ts index adb2e3dff3..4f707e4595 100644 --- a/src/test/mocks/@interlay/interbtc-api/parachain/api.ts +++ b/src/test/mocks/@interlay/interbtc-api/parachain/api.ts @@ -1,8 +1,11 @@ +import { newMonetaryAmount } from '@interlay/interbtc-api'; import { ApiPromise } from '@polkadot/api'; import { Text, TypeRegistry } from '@polkadot/types'; import { Registry } from '@polkadot/types/types'; import Big from 'big.js'; +import { GOVERNANCE_TOKEN } from '@/config/relay-chains'; + import { EXTRINSIC } from '../extrinsic'; const REGISTRY = ({ chainDecimals: [], chainSS58: 0, chainTokens: [] } as unknown) as Registry; @@ -23,7 +26,8 @@ const DATA = { VESTING_SCHEDULES }; const MODULE = { vestingSchedules: jest.fn().mockReturnValue(VESTING_SCHEDULES.EMPTY), claimVesting: jest.fn().mockReturnValue(EXTRINSIC), - batchAll: jest.fn().mockReturnValue(EXTRINSIC) + batchAll: jest.fn().mockReturnValue(EXTRINSIC), + freeStakable: jest.fn().mockResolvedValue(newMonetaryAmount(10000000000000, GOVERNANCE_TOKEN, true)) }; // maps module to ApiPromise @@ -34,6 +38,9 @@ const PROMISE: Partial> = { system: { chain: jest.fn().mockReturnValue(SYSTEM_CHAIN), chainType: jest.fn().mockReturnValue(CHAIN_TYPE) + }, + escrow: { + freeStakable: MODULE.freeStakable } }, query: {