From 3753a699ab4a9869e0438c4374d496dbd8bca36d Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Jan 2024 14:10:17 -0600 Subject: [PATCH] fic particl txs --- lib/wallets/wallet/impl/particl_wallet.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/wallets/wallet/impl/particl_wallet.dart b/lib/wallets/wallet/impl/particl_wallet.dart index d0aecf58d..67c08bf1d 100644 --- a/lib/wallets/wallet/impl/particl_wallet.dart +++ b/lib/wallets/wallet/impl/particl_wallet.dart @@ -398,18 +398,18 @@ class ParticlWallet extends Bip39HDWallet final vSize = builtTx.virtualSize(); // Strip trailing 0x00 bytes from hex. - String hexString = builtTx.toHex(); - - // Ensure the string has an even length. + // + // This is done to match the previous particl_wallet implementation. + // TODO: [prio=low] Rework Particl tx construction so as to obviate this. + String hexString = builtTx.toHex(isParticl: true).toString(); if (hexString.length % 2 != 0) { + // Ensure the string has an even length. Logging.instance.log("Hex string has odd length, which is unexpected.", level: LogLevel.Error); throw Exception("Invalid hex string length."); } - - // Strip up trailing '00' bytes. int numStrips = 0; - int maxStrips = 3; // Strip up to 3 (match previous particl_wallet). + int maxStrips = 3; // Strip up to 3 0x00s (match previous particl_wallet). while (hexString.endsWith('00') && hexString.length > 2) { hexString = hexString.substring(0, hexString.length - 2); numStrips++;