Skip to content

Commit

Permalink
Support 0x prefixes in legacy memos
Browse files Browse the repository at this point in the history
  • Loading branch information
swansontec committed Sep 12, 2023
1 parent d70e460 commit 4b62584
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/common/upgradeMemos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export function upgradeMemos(
}
}

// We need to support 0x prefixes for backwards compatibility:
for (const memo of legacyMemos) {
if (memo.type === 'hex') memo.value = memo.value.replace(/^0x/i, '')
}

// If we don't have modern memos, use the legacy ones:
const out: EdgeSpendInfo = {
...spendInfo,
Expand Down

0 comments on commit 4b62584

Please sign in to comment.