Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Transactions signing #14

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#FVM sdk ignore
# Flutter Version Management
.fvm/flutter_sdk
.fvm/versions
.fvm/version
.fvm/release
.fvmrc

# Miscellaneous
*.class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CreateWalletDrawerPageCubit extends Cubit<ACreateWalletDrawerPageState> {
emit(CreateWalletDrawerPageLoadingState());
await Future<void>.delayed(const Duration(milliseconds: 500));
Mnemonic mnemonic = Mnemonic.random();
Wallet wallet = Wallet.derive(mnemonic: mnemonic);
Wallet wallet = await Wallet.derive(mnemonic: mnemonic);

emit(CreateWalletDrawerPageLoadedState(mnemonic: mnemonic, wallet: wallet));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import 'package:miro/shared/models/transactions/signed_transaction_model.dart';
import 'package:miro/shared/models/transactions/unsigned_tx_model.dart';
import 'package:miro/shared/models/wallet/wallet.dart';
import 'package:miro/shared/utils/logger/app_logger.dart';
import 'package:miro/shared/utils/transactions/tx_utils.dart';

class TxProcessCubit<T extends AMsgFormModel> extends Cubit<ATxProcessState> {
final AuthCubit authCubit = globalLocator<AuthCubit>();
Expand Down Expand Up @@ -128,8 +127,6 @@ class TxProcessCubit<T extends AMsgFormModel> extends Cubit<ATxProcessState> {
if (wallet == null) {
throw Exception('Wallet cannot be null when signing transaction');
}
SignedTxModel signedTxModel = TxUtils.sign(unsignedTxModel: unsignedTxModel, wallet: wallet);
await Future<void>.delayed(const Duration(milliseconds: 100));
return signedTxModel;
return unsignedTxModel.sign(wallet);
}
}
6 changes: 3 additions & 3 deletions lib/infra/dto/api_kira/broadcast/request/broadcast_req.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:cryptography_utils/cryptography_utils.dart';
import 'package:equatable/equatable.dart';
import 'package:miro/infra/dto/api_kira/broadcast/request/transaction/tx.dart';

class BroadcastReq extends Equatable {
final Tx tx;
final CosmosTx tx;
final String mode;

const BroadcastReq({
Expand All @@ -12,7 +12,7 @@ class BroadcastReq extends Equatable {

Map<String, dynamic> toJson() {
return <String, dynamic>{
'tx': tx.toJson(),
'tx': tx.toProtoJson(),
'mode': mode,
};
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading