mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
Allow explorers starting with http:// :-(
it's sad - but can't really force them to use https://
This commit is contained in:
parent
2f42e78adb
commit
9c89bcbd2f
|
@ -262,8 +262,8 @@ fun checkChain(chainFile: File, connectRPC: Boolean) {
|
|||
}
|
||||
|
||||
val url = explorer["url"]
|
||||
if (url == null || url !is String || !url.startsWith("https://")) {
|
||||
throw (ExplorerMustWithHttps())
|
||||
if (url == null || url !is String || !(url.startsWith("https://") || url.startsWith("http://"))) {
|
||||
throw (ExplorerMustWithHttpsOrHttp())
|
||||
}
|
||||
|
||||
if (url.endsWith("/")) {
|
||||
|
|
|
@ -17,7 +17,7 @@ class ShortNameMustNotBeStar: Exception("short name must not be '*'")
|
|||
class UnsupportedNamespace: Exception("So far only the EIP155 namespace is supported")
|
||||
class ExplorersMustBeArray: Exception("explorers must be an array")
|
||||
class ExplorerMustHaveName: Exception("Explorer must have name")
|
||||
class ExplorerMustWithHttps: Exception("Explorer have url starting with https://")
|
||||
class ExplorerMustWithHttpsOrHttp: Exception("Explorer have url starting with https:// or http://")
|
||||
class ExplorerCannotEndInSlash: Exception("Explorer cannot have a slash on the end")
|
||||
class ExplorerStandardMustBeEIP3091OrNone: Exception("explorer standard must be 'none' or 'EIP3091'")
|
||||
class ParentHasInvalidType(type: String?): Exception("Parent has invalid type $type - only L2 or shard allowed")
|
||||
|
|
|
@ -226,12 +226,12 @@ class TheChainChecker {
|
|||
checkChain(getFile("invalid/explorernoname/eip155-1.json"), false)
|
||||
}
|
||||
|
||||
@Test(expected = ExplorerMustWithHttps::class)
|
||||
@Test(expected = ExplorerMustWithHttpsOrHttp::class)
|
||||
fun shouldFailOnInvalidUrl() {
|
||||
checkChain(getFile("invalid/explorerinvalidurl/eip155-1.json"), false)
|
||||
}
|
||||
|
||||
@Test(expected = ExplorerMustWithHttps::class)
|
||||
@Test(expected = ExplorerMustWithHttpsOrHttp::class)
|
||||
fun shouldFailOnMissingURL() {
|
||||
checkChain(getFile("invalid/explorermissingurl/eip155-1.json"), false)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user