Skip to content

Commit

Permalink
Allow announcement deprecation type
Browse files Browse the repository at this point in the history
  • Loading branch information
ligi committed Sep 2, 2020
1 parent 7d234a6 commit 19ba06c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/kotlin/org/ethereum/lists/tokens/TokenChecker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class InvalidSymbol : InvalidTokenException("Symbol must be a string")
class InvalidFileName : InvalidTokenException("Filename must be the address + .json")
class InvalidWebsite : InvalidTokenException("Website invalid")
class InvalidJSON(message: String?) : InvalidTokenException("JSON invalid $message")
class InvalidDeprecationMigrationType : InvalidTokenException("Invalid Deprecation Migration type - currently only auto and instructions: is allowed")
class InvalidDeprecationMigrationType : InvalidTokenException("Invalid Deprecation Migration type - currently only auto, instructions and announcement is allowed")
class InvalidDeprecationTime : InvalidTokenException("Invalid Deprecation Time - Must be ISO8601")

val onChainCheckFile = File("onChainCheck.lst")
Expand Down Expand Up @@ -123,7 +123,9 @@ suspend fun checkTokenFile(file: File, onChainCheck: Boolean = false, chainId: C
token?.deprecation?.let {
val safeMigrationType: String = it.migration_type ?: "auto"
when {
safeMigrationType == "auto" || safeMigrationType.startsWith("instructions:") -> Unit
safeMigrationType == "auto" -> Unit
safeMigrationType.startsWith("instructions:") -> Unit
safeMigrationType.startsWith("announcement:") -> Unit
safeMigrationType.startsWith("newchain:auto:") -> BigInteger(safeMigrationType.replace("newchain:auto:", ""))
else -> throw InvalidDeprecationMigrationType()
}
Expand Down

0 comments on commit 19ba06c

Please sign in to comment.