possible workflow tests fix

This commit is contained in:
julian 2022-08-29 15:20:27 -06:00
parent ba576c06eb
commit 6b534a4247

View file

@ -208,9 +208,9 @@ abstract class ChangeNow {
static Future<ChangeNowResponse<Decimal>> getMinimalExchangeAmount({ static Future<ChangeNowResponse<Decimal>> getMinimalExchangeAmount({
required String fromTicker, required String fromTicker,
required String toTicker, required String toTicker,
String apiKey = kChangeNowApiKey, String? apiKey,
}) async { }) async {
Map<String, dynamic>? params = {"api_key": apiKey}; Map<String, dynamic>? params = {"api_key": apiKey ?? kChangeNowApiKey};
final uri = _buildUri("/min-amount/${fromTicker}_$toTicker", params); final uri = _buildUri("/min-amount/${fromTicker}_$toTicker", params);
@ -248,8 +248,9 @@ abstract class ChangeNow {
required String fromTicker, required String fromTicker,
required String toTicker, required String toTicker,
required Decimal fromAmount, required Decimal fromAmount,
String? apiKey,
}) async { }) async {
Map<String, dynamic> params = {"api_key": kChangeNowApiKey}; Map<String, dynamic> params = {"api_key": apiKey ?? kChangeNowApiKey};
final uri = _buildUri( final uri = _buildUri(
"/exchange-amount/${fromAmount.toString()}/${fromTicker}_$toTicker", "/exchange-amount/${fromAmount.toString()}/${fromTicker}_$toTicker",
@ -296,10 +297,10 @@ abstract class ChangeNow {
// to freeze estimated amount that you got in this method. Current estimated // to freeze estimated amount that you got in this method. Current estimated
// amount would be valid until time in field "validUntil" // amount would be valid until time in field "validUntil"
bool useRateId = true, bool useRateId = true,
String apiKey = kChangeNowApiKey, String? apiKey,
}) async { }) async {
Map<String, dynamic> params = { Map<String, dynamic> params = {
"api_key": apiKey, "api_key": apiKey ?? kChangeNowApiKey,
"useRateId": useRateId.toString(), "useRateId": useRateId.toString(),
}; };
@ -343,9 +344,10 @@ abstract class ChangeNow {
/// occasionally. One time per minute is sufficient. /// occasionally. One time per minute is sufficient.
static Future<ChangeNowResponse<List<FixedRateMarket>>> static Future<ChangeNowResponse<List<FixedRateMarket>>>
getAvailableFixedRateMarkets({ getAvailableFixedRateMarkets({
String apiKey = kChangeNowApiKey, String? apiKey,
}) async { }) async {
final uri = _buildUri("/market-info/fixed-rate/$apiKey", null); final uri = _buildUri(
"/market-info/fixed-rate/${apiKey ?? kChangeNowApiKey}", null);
try { try {
// json array is expected here // json array is expected here
@ -413,7 +415,7 @@ abstract class ChangeNow {
String contactEmail = "", String contactEmail = "",
String refundAddress = "", String refundAddress = "",
String refundExtraId = "", String refundExtraId = "",
String apiKey = kChangeNowApiKey, String? apiKey,
}) async { }) async {
final Map<String, String> map = { final Map<String, String> map = {
"from": fromTicker, "from": fromTicker,
@ -428,7 +430,7 @@ abstract class ChangeNow {
"refundExtraId": refundExtraId, "refundExtraId": refundExtraId,
}; };
final uri = _buildUri("/transactions/$apiKey", null); final uri = _buildUri("/transactions/${apiKey ?? kChangeNowApiKey}", null);
try { try {
// simple json object is expected here // simple json object is expected here
@ -476,7 +478,7 @@ abstract class ChangeNow {
String contactEmail = "", String contactEmail = "",
String refundAddress = "", String refundAddress = "",
String refundExtraId = "", String refundExtraId = "",
String apiKey = kChangeNowApiKey, String? apiKey,
}) async { }) async {
final Map<String, String> map = { final Map<String, String> map = {
"from": fromTicker, "from": fromTicker,
@ -492,7 +494,8 @@ abstract class ChangeNow {
"rateId": rateId, "rateId": rateId,
}; };
final uri = _buildUri("/transactions/fixed-rate/$apiKey", null); final uri = _buildUri(
"/transactions/fixed-rate/${apiKey ?? kChangeNowApiKey}", null);
try { try {
// simple json object is expected here // simple json object is expected here
@ -529,9 +532,10 @@ abstract class ChangeNow {
static Future<ChangeNowResponse<ExchangeTransactionStatus>> static Future<ChangeNowResponse<ExchangeTransactionStatus>>
getTransactionStatus({ getTransactionStatus({
required String id, required String id,
String apiKey = kChangeNowApiKey, String? apiKey,
}) async { }) async {
final uri = _buildUri("/transactions/$id/$apiKey", null); final uri =
_buildUri("/transactions/$id/${apiKey ?? kChangeNowApiKey}", null);
try { try {
// simple json object is expected here // simple json object is expected here