Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
fix: make return types non-nullable (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-tbd authored Jun 7, 2024
1 parent bd54813 commit 4f12240
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/src/http_client/tbdex_http_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TbdexHttpClient {
_client = client;
}

static Future<Exchange?> getExchange(
static Future<Exchange> getExchange(
BearerDid did,
String pfiDid,
String exchangeId,
Expand Down Expand Up @@ -73,7 +73,7 @@ class TbdexHttpClient {
return exchange;
}

static Future<List<String>?> listExchanges(
static Future<List<String>> listExchanges(
BearerDid did,
String pfiDid,
) async {
Expand Down Expand Up @@ -115,7 +115,7 @@ class TbdexHttpClient {
return exchanges;
}

static Future<List<Offering>?> listOfferings(
static Future<List<Offering>> listOfferings(
String pfiDid, {
GetOfferingsFilter? filter,
}) async {
Expand Down
6 changes: 3 additions & 3 deletions test/http_client/tbdex_http_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void main() async {

final response =
await TbdexHttpClient.getExchange(TestData.aliceDid, pfiDid, '1234');
expect(response?.length, 2);
expect(response.length, 2);

verify(
() => mockHttpClient.get(
Expand All @@ -63,7 +63,7 @@ void main() async {

final response =
await TbdexHttpClient.listExchanges(TestData.aliceDid, pfiDid);
expect(response?.length, 3);
expect(response.length, 3);

verify(
() => mockHttpClient.get(
Expand All @@ -81,7 +81,7 @@ void main() async {
);

final response = await TbdexHttpClient.listOfferings(pfiDid);
expect(response?.length, 1);
expect(response.length, 1);

verify(
() => mockHttpClient.get(Uri.parse('$pfiServiceEndpoint/offerings/')),
Expand Down

0 comments on commit 4f12240

Please sign in to comment.