Skip to content

Commit

Permalink
Merge pull request #103 from Beans-BV/feature/general-fixes
Browse files Browse the repository at this point in the history
General fixes
  • Loading branch information
christian-rogobete authored Oct 4, 2024
2 parents a3a8558 + 6a0ad66 commit 0e803ff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
11 changes: 4 additions & 7 deletions lib/src/sep/0011/txrep.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import 'dart:convert';
import 'dart:typed_data';

import 'package:decimal/decimal.dart';
import 'package:stellar_flutter_sdk/stellar_flutter_sdk.dart';

Expand Down Expand Up @@ -151,7 +152,8 @@ class TxRep {
}

MuxedAccount? mux = MuxedAccount.fromAccountId(sourceAccountId);
Account sourceAccount = Account(mux!.ed25519AccountId, sequenceNumber - BigInt.one,
Account sourceAccount = Account(
mux!.ed25519AccountId, sequenceNumber - BigInt.one,
muxedAccountMed25519Id: mux.id);
TransactionBuilder txBuilder = TransactionBuilder(sourceAccount);
txBuilder.addPreconditions(_getPreconditions(map, prefix));
Expand Down Expand Up @@ -297,7 +299,7 @@ class TxRep {
if (_removeComment(map['${precondPrefix}minSeqNum._present']) == 'true' &&
map['${precondPrefix}minSeqNum'] != null) {
BigInt? minSeqNum =
BigInt.tryParse(_removeComment(map['${precondPrefix}minSeqNum'])!);
BigInt.tryParse(_removeComment(map['${precondPrefix}minSeqNum'])!);
if (minSeqNum == null) {
throw Exception('invalid ${precondPrefix}minSeqNum');
}
Expand Down Expand Up @@ -3464,11 +3466,6 @@ class TxRep {
_addLine('$prefix.nonce_key.nonce',
value.nonce_key!.nonce.int64.toString(), lines);
break;
case XdrSCValType.SCV_LEDGER_KEY_NONCE:
_addLine('$prefix.type', 'SCV_LEDGER_KEY_NONCE', lines);
_addLine('$prefix.nonce_key.nonce',
value.nonce_key!.nonce.int64.toString(), lines);
break;
case XdrSCValType.SCV_CONTRACT_INSTANCE:
_addLine('$prefix.type', 'SCV_CONTRACT_INSTANCE', lines);
var executable = value.instance!.executable;
Expand Down
16 changes: 10 additions & 6 deletions lib/src/soroban/soroban_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ class SorobanServer {
set httpOverrides(bool setOverrides) {
if (!kIsWeb && setOverrides) {
dio.Dio dioOverrides = dio.Dio();
(dioOverrides.httpClientAdapter as IOHttpClientAdapter)
.onHttpClientCreate = (IO.HttpClient client) {
client.badCertificateCallback =
(IO.X509Certificate cert, String host, int port) => true;
return client;
};
final adapter = dioOverrides.httpClientAdapter;
if (adapter is IOHttpClientAdapter) {
adapter.createHttpClient = () {
final client = IO.HttpClient();
client.badCertificateCallback = (cert, host, port) {
return true;
};
return client;
};
}
_dio = dioOverrides;
}
}
Expand Down
3 changes: 1 addition & 2 deletions lib/src/stellar_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ class StellarSDK {
throw SubmitTransactionTimeoutResponseException.fromJson(
json.decode(response.body));
default:
throw SubmitTransactionUnknownResponseException(
response.statusCode, response.body);
throw UnknownResponse(response.statusCode, response.body);
}
return submitTransactionResponse;
}).catchError((onError) {
Expand Down

0 comments on commit 0e803ff

Please sign in to comment.