Object values return undefined
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user