From b909c72cb91d5488de8b9efb8a1b58d1efdc47cd Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 4 Jun 2024 18:32:12 -0500 Subject: [PATCH] add and use transactionVersion property for peercoin TODO add versions for the rest of the coins --- lib/wallets/crypto_currency/coins/peercoin.dart | 3 +++ .../interfaces/electrumx_currency_interface.dart | 2 +- .../wallet/wallet_mixin_interfaces/electrumx_interface.dart | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/wallets/crypto_currency/coins/peercoin.dart b/lib/wallets/crypto_currency/coins/peercoin.dart index 0edc1cbfa..dec4ab846 100644 --- a/lib/wallets/crypto_currency/coins/peercoin.dart +++ b/lib/wallets/crypto_currency/coins/peercoin.dart @@ -254,4 +254,7 @@ class Peercoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { ); } } + + @override + int get transactionVersion => 3; } diff --git a/lib/wallets/crypto_currency/interfaces/electrumx_currency_interface.dart b/lib/wallets/crypto_currency/interfaces/electrumx_currency_interface.dart index 4dd224aed..30ddf7c70 100644 --- a/lib/wallets/crypto_currency/interfaces/electrumx_currency_interface.dart +++ b/lib/wallets/crypto_currency/interfaces/electrumx_currency_interface.dart @@ -1,5 +1,5 @@ import '../intermediate/bip39_hd_currency.dart'; mixin ElectrumXCurrencyInterface on Bip39HDCurrency { - // + int get transactionVersion; } diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart index eda467a6a..f6ca3ab71 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart @@ -4,6 +4,7 @@ import 'dart:typed_data'; import 'package:coinlib_flutter/coinlib_flutter.dart' as coinlib; import 'package:isar/isar.dart'; + import '../../../electrumx_rpc/cached_electrumx_client.dart'; import '../../../electrumx_rpc/client_manager.dart'; import '../../../electrumx_rpc/electrumx_client.dart'; @@ -651,7 +652,7 @@ mixin ElectrumXInterface final List prevOuts = []; coinlib.Transaction clTx = coinlib.Transaction( - version: 1, // TODO: check if we can use 3 (as is default in coinlib) + version: cryptoCurrency.transactionVersion, inputs: [], outputs: [], );