Skip to content

Commit c00ade0

Browse files
fix(abstract-utxo): fix decodeTransaction for base64 input
Base64 is case sensitive, duh! Issue: BTC-1472
1 parent fc8091b commit c00ade0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/abstract-utxo/src/abstractUtxoCoin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,11 @@ export abstract class AbstractUtxoCoin extends BaseCoin {
570570
if (typeof input === 'string') {
571571
for (const format of ['hex', 'base64'] as const) {
572572
const buffer = Buffer.from(input, format);
573-
if (buffer.toString(format) === input.toLowerCase()) {
573+
const bufferToString = buffer.toString(format);
574+
if (
575+
(format === 'base64' && bufferToString === input) ||
576+
(format === 'hex' && bufferToString === input.toLowerCase())
577+
) {
574578
return this.decodeTransaction(buffer);
575579
}
576580
}

0 commit comments

Comments
 (0)