From f6979933de1fa73a369f3e73abd4019cbcb65446 Mon Sep 17 00:00:00 2001 From: Nishant Arora Date: Thu, 13 Oct 2022 13:13:50 -0600 Subject: [PATCH] (fix): Follow Up to 310 - Adding more details to failed trustless test (#312) --- src/Trustless.ts | 12 ++++++++---- src/index.html | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Trustless.ts b/src/Trustless.ts index 27e44e60..159046bc 100644 --- a/src/Trustless.ts +++ b/src/Trustless.ts @@ -30,12 +30,16 @@ class Trustless extends CheckBase implements Checkable { } )) - if (!trustlessResponseTypesTests.includes(false)) { + const failedTests = TRUSTLESS_RESPONSE_TYPES.filter((_result, idx) => !trustlessResponseTypesTests[idx]) + + if (failedTests.length === 0) { this.tag.win() } else { - log.debug('The response type did not match the expected type') - this.onerror() - throw new Error(`URL '${gatewayAndHash} does not support Trustless`) + const errorMsg = `URL '${gatewayAndHash} does not support the following Trustless response types: [` + + `${failedTests.join(', ')}]` + + log.debug(errorMsg) + throw new Error(errorMsg) } } catch (err) { log.error(err) diff --git a/src/index.html b/src/index.html index 674c8f35..f9bdda41 100644 --- a/src/index.html +++ b/src/index.html @@ -56,7 +56,7 @@

Public Gateways

Online
CORS
Origin
-
Trustless
+
Block/CAR
Country
ΔT