diff --git a/packages/type-params/src/decode/value/bytes.ts b/packages/type-params/src/decode/value/bytes.ts index ba29800010..314be1fb7e 100644 --- a/packages/type-params/src/decode/value/bytes.ts +++ b/packages/type-params/src/decode/value/bytes.ts @@ -9,9 +9,8 @@ import u8aToBn from '@polkadot/util/u8a/toBn'; export default function bytes (input: Uint8Array | null): Param$Decoded { if (input === null) { return { - length: 0, - value: new Uint8Array() - }; + length: 0 + } as Param$Decoded; } const length = u8aToBn(input.subarray(0, 4), true).toNumber(); diff --git a/packages/type-params/src/decode/value/code.ts b/packages/type-params/src/decode/value/code.ts index 6b11039cf0..049272f7bb 100644 --- a/packages/type-params/src/decode/value/code.ts +++ b/packages/type-params/src/decode/value/code.ts @@ -9,9 +9,8 @@ import u8aToBn from '@polkadot/util/u8a/toBn'; export default function code (input: Uint8Array | null): Param$Decoded { if (input === null) { return { - length: 0, - value: new Uint8Array() - }; + length: 0 + } as Param$Decoded; } const length = u8aToBn(input.subarray(0, 4), true).toNumber() + 4; diff --git a/packages/type-params/src/decode/value/string.ts b/packages/type-params/src/decode/value/string.ts index 9aace790dc..23b1d73d6c 100644 --- a/packages/type-params/src/decode/value/string.ts +++ b/packages/type-params/src/decode/value/string.ts @@ -10,9 +10,8 @@ import u8aToUtf8 from '@polkadot/util/u8a/toUtf8'; export default function string (input: Uint8Array | null): Param$Decoded { if (input === null) { return { - length: 0, - value: '' - }; + length: 0 + } as Param$Decoded; } const length = u8aToBn(input.subarray(0, 4), true).toNumber(); diff --git a/packages/type-params/src/decode/value/u8a.ts b/packages/type-params/src/decode/value/u8a.ts index d094df6dc2..7ea561dd35 100644 --- a/packages/type-params/src/decode/value/u8a.ts +++ b/packages/type-params/src/decode/value/u8a.ts @@ -7,9 +7,8 @@ import { Param$Decoded } from '../../types'; export default function u8a (input: Uint8Array | null, bitLength: 256 | 512, offset: number): Param$Decoded { if (input === null) { return { - length: 0, - value: new Uint8Array() - }; + length: 0 + } as Param$Decoded; } const length = (bitLength / 8) + offset;