Skip to content

Commit

Permalink
fix asChainData helper
Browse files Browse the repository at this point in the history
  • Loading branch information
eshark9312 committed Jul 21, 2023
1 parent b757b1e commit 7cf3349
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/ui/src/mocks/helpers/asChainData.ts
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 7cf3349

Please sign in to comment.