Skip to content

Commit

Permalink
chore: Force transaction version 3
Browse files Browse the repository at this point in the history
  • Loading branch information
redDwarf03 committed Jan 14, 2025
1 parent 21a739a commit 74b5bc2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
8 changes: 2 additions & 6 deletions lib/application/contracts/archethic_contract.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -45,9 +47,6 @@ class ArchethicContract
return aedappfm.Result.guard(
() async {
final apiService = aedappfm.sl.get<ApiService>();
final blockchainTxVersion = int.parse(
(await apiService.getBlockchainVersion()).version.transaction,
);

final storageNoncePublicKey =
await apiService.getStorageNoncePublicKey();
Expand Down Expand Up @@ -148,9 +147,6 @@ class ArchethicContract
return aedappfm.Result.guard(
() async {
final apiService = aedappfm.sl.get<ApiService>();
final blockchainTxVersion = int.parse(
(await apiService.getBlockchainVersion()).version.transaction,
);

final infoResult = await getInfo(apiService, htlcAddress);

Expand Down
8 changes: 4 additions & 4 deletions lib/application/contracts/archethic_contract_chargeable.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();

Expand Down Expand Up @@ -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,
Expand Down
15 changes: 4 additions & 11 deletions lib/application/contracts/archethic_contract_signed.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();

Expand Down Expand Up @@ -83,11 +87,6 @@ class ArchethicContractSigned with aedappfm.TransactionMixin {
return aedappfm.Result.guard(
() async {
Transaction? transactionTransfer;
final blockchainTxVersion = int.parse(
(await aedappfm.sl.get<ApiService>().getBlockchainVersion())
.version
.transaction,
);
final recipient = Recipient(
address: poolAddress.toUpperCase(),
action: 'request_secret_hash',
Expand Down Expand Up @@ -166,12 +165,6 @@ class ArchethicContractSigned with aedappfm.TransactionMixin {
) async {
return aedappfm.Result.guard(
() async {
final blockchainTxVersion = int.parse(
(await aedappfm.sl.get<ApiService>().getBlockchainVersion())
.version
.transaction,
);

var transaction = Transaction(
type: 'transfer',
version: blockchainTxVersion,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 74b5bc2

Please sign in to comment.