From 7cf33498a1f79a90b15e863c477b223dad6fb036 Mon Sep 17 00:00:00 2001 From: eshark9312 Date: Fri, 21 Jul 2023 03:35:47 -0500 Subject: [PATCH] fix asChainData helper --- packages/ui/src/mocks/helpers/asChainData.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/mocks/helpers/asChainData.ts b/packages/ui/src/mocks/helpers/asChainData.ts index 8d7f6b8aa9..3babe651ec 100644 --- a/packages/ui/src/mocks/helpers/asChainData.ts +++ b/packages/ui/src/mocks/helpers/asChainData.ts @@ -1,7 +1,6 @@ +import { createType } from '@joystream/types' import { isFunction, mapValues } from 'lodash' -import { asBN } from '@/common/utils' - export const asChainData = (data: any, key?: string | number): any => { if (key === 'unwrap' && !isFunction(data)) { const unwrappedValue = asChainData(data) @@ -16,10 +15,10 @@ export const asChainData = (data: any, key?: string | number): any => { return data.map(asChainData) case 'Number': - return asBN(data) + return createType('u128', data) case 'String': - return isNaN(data) ? data : asBN(data) + return isNaN(data) ? data : createType('u128', data) default: return data