diff --git a/lib/application/contracts/archethic_contract.dart b/lib/application/contracts/archethic_contract.dart index da1d06a7..2c4703f7 100644 --- a/lib/application/contracts/archethic_contract.dart +++ b/lib/application/contracts/archethic_contract.dart @@ -16,6 +16,8 @@ import 'package:decimal/decimal.dart'; import 'package:flutter_gen/gen_l10n/localizations.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +const blockchainTxVersion = 3; + class ArchethicContract with aedappfm.TransactionMixin, ArchethicBridgeProcessMixin { ArchethicContract(); @@ -45,9 +47,6 @@ class ArchethicContract return aedappfm.Result.guard( () async { final apiService = aedappfm.sl.get(); - final blockchainTxVersion = int.parse( - (await apiService.getBlockchainVersion()).version.transaction, - ); final storageNoncePublicKey = await apiService.getStorageNoncePublicKey(); @@ -148,9 +147,6 @@ class ArchethicContract return aedappfm.Result.guard( () async { final apiService = aedappfm.sl.get(); - final blockchainTxVersion = int.parse( - (await apiService.getBlockchainVersion()).version.transaction, - ); final infoResult = await getInfo(apiService, htlcAddress); diff --git a/lib/application/contracts/archethic_contract_chargeable.dart b/lib/application/contracts/archethic_contract_chargeable.dart index 56ee9d18..f07d3b30 100644 --- a/lib/application/contracts/archethic_contract_chargeable.dart +++ b/lib/application/contracts/archethic_contract_chargeable.dart @@ -1,4 +1,6 @@ /// SPDX-License-Identifier: AGPL-3.0-or-later +// ignore_for_file: avoid_redundant_argument_values + import 'dart:async'; import 'package:aebridge/application/contracts/archethic_contract.dart'; @@ -11,6 +13,8 @@ import 'package:archethic_wallet_client/archethic_wallet_client.dart' as awc; import 'package:flutter_gen/gen_l10n/localizations.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +const blockchainTxVersion = 3; + class ArchethicContractChargeable with aedappfm.TransactionMixin { ArchethicContractChargeable(); @@ -131,10 +135,6 @@ class ArchethicContractChargeable with aedappfm.TransactionMixin { } } - final blockchainTxVersion = int.parse( - (await apiService.getBlockchainVersion()).version.transaction, - ); - var transaction = Transaction( type: 'transfer', version: blockchainTxVersion, diff --git a/lib/application/contracts/archethic_contract_signed.dart b/lib/application/contracts/archethic_contract_signed.dart index 0c463091..bbb9eaa2 100644 --- a/lib/application/contracts/archethic_contract_signed.dart +++ b/lib/application/contracts/archethic_contract_signed.dart @@ -1,4 +1,6 @@ /// SPDX-License-Identifier: AGPL-3.0-or-later +// ignore_for_file: avoid_redundant_argument_values + import 'dart:async'; import 'package:aebridge/application/contracts/archethic_contract.dart'; @@ -11,6 +13,8 @@ import 'package:archethic_wallet_client/archethic_wallet_client.dart' as awc; import 'package:flutter_gen/gen_l10n/localizations.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +const blockchainTxVersion = 3; + class ArchethicContractSigned with aedappfm.TransactionMixin { ArchethicContractSigned(); @@ -83,11 +87,6 @@ class ArchethicContractSigned with aedappfm.TransactionMixin { return aedappfm.Result.guard( () async { Transaction? transactionTransfer; - final blockchainTxVersion = int.parse( - (await aedappfm.sl.get().getBlockchainVersion()) - .version - .transaction, - ); final recipient = Recipient( address: poolAddress.toUpperCase(), action: 'request_secret_hash', @@ -166,12 +165,6 @@ class ArchethicContractSigned with aedappfm.TransactionMixin { ) async { return aedappfm.Result.guard( () async { - final blockchainTxVersion = int.parse( - (await aedappfm.sl.get().getBlockchainVersion()) - .version - .transaction, - ); - var transaction = Transaction( type: 'transfer', version: blockchainTxVersion, diff --git a/pubspec.yaml b/pubspec.yaml index 6c81a1f3..e7bd89d5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: aebridge description: Enable interoperability and facilitate the transfer of data and assets between the two blockchains. publish_to: "none" -version: 3.3.8+118 +version: 3.3.9+119 environment: sdk: ">=3.3.0 <4.0.0"