Skip to content

Commit

Permalink
Catch all unexpected errors from token parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
oskin1 committed Nov 7, 2022
1 parent 44c1acb commit 185d070
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val commonSettings = Seq(
scalacOptions ++= commonScalacOptions,
scalaVersion := "2.12.15",
organization := "org.ergoplatform",
version := "9.17.3",
version := "9.17.4",
resolvers += Resolver.sonatypeRepo("public"),
resolvers += Resolver.sonatypeRepo("snapshots"),
libraryDependencies ++= dependencies.Testing ++ dependencies.CompilerPlugins,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object TokenPropsParser {
new TokenPropsParser[TokenPropsEip4] {
private val p = RegistersParser[Either[Throwable, *]]

def parse(registers: Map[RegisterId, HexString]): Option[TokenPropsEip4] = {
def parse(registers: Map[RegisterId, HexString]): Option[TokenPropsEip4] = Try {
def parse(raw: HexString) = p.parse[SCollection[SByte.type]](raw).toOption
val r4 = registers.get(RegisterId.R4)
val r5 = registers.get(RegisterId.R5)
Expand All @@ -39,7 +39,7 @@ object TokenPropsParser {
val (description, decimals) = (descriptionOpt.getOrElse(""), decimalsOpt.getOrElse(0))
TokenPropsEip4(name, description, decimals)
}
}
}.toOption.flatten
}

private def looksLikeUTF8(utf8: Array[Byte]): Boolean = {
Expand Down

0 comments on commit 185d070

Please sign in to comment.