Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Allow invalid ss58 to be handled upstream
  • Loading branch information
jacogr committed Oct 23, 2020
commit 3c8e62edf7d4c07c458e2aa46a28630c50cd99f5
17 changes: 7 additions & 10 deletions packages/types/src/generic/MultiAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ export default class MultiAddress extends Enum {

private static _decodeMultiAddress (value?: unknown): unknown {
if (isString(value)) {
const u8a = decodeAddress(value.toString());

return u8aConcat(
new Uint8Array(
u8a.length <= 8
? 1
: 0
),
u8a
);
try {
const u8a = decodeAddress(value.toString());

return u8aConcat(new Uint8Array(u8a.length <= 8 ? 1 : 0), u8a);
} catch (error) {
// ignore, not a valid ss58 address
}
}

return value;
Expand Down