From 4b625849a732b0c97b919ccfb168f087fa5ce46b Mon Sep 17 00:00:00 2001 From: William Swanson Date: Wed, 30 Aug 2023 12:51:32 -0700 Subject: [PATCH] Support 0x prefixes in legacy memos --- src/common/upgradeMemos.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/upgradeMemos.ts b/src/common/upgradeMemos.ts index e464da271..4f3514c90 100644 --- a/src/common/upgradeMemos.ts +++ b/src/common/upgradeMemos.ts @@ -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,