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

General fixes #103

Merged
merged 3 commits into from
Oct 4, 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
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