Skip to content

Commit

Permalink
fix: remove blank strings
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed Jan 12, 2023
1 parent 5ac5342 commit 104b4ea
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions packages/sdk-ts/src/core/modules/tx/eip712/maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,31 +188,11 @@ export const mapValuesToProperValueType = <T extends Record<string, unknown>>(
const sdkDecKeyWithTypeMaps = {
'exchange/MsgIncreasePositionMargin': ['amount'],
}
const nullableStringsMaps = {
'wasmx/MsgExecuteContractCompat': ['funds'],
}

return Object.keys(object).reduce((result, key) => {
const value = object[key]

if (!value) {
// Allow nullable strings in some cases
if (typeof value === 'string') {
const typeInMap = Object.keys(nullableStringsMaps).find(
(key) => key === messageTypeUrl,
)

const nullableStringKeys =
nullableStringsMaps[typeInMap as keyof typeof nullableStringsMaps]

if (nullableStringKeys.includes(key)) {
return {
...result,
[key]: value,
}
}
}

return result
}

Expand Down

0 comments on commit 104b4ea

Please sign in to comment.