Skip to content

Commit

Permalink
fix: parsing execution index
Browse files Browse the repository at this point in the history
  • Loading branch information
gitsimon committed Apr 15, 2024
1 parent 9e33054 commit 1f24013
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Project.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
object Project {
const val group = "com.github.acurast"
const val version = "0.1.19"
const val version = "0.1.20"
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,20 @@ public enum class ExecutionSpecifierKind(public val id: Byte) : ToU8a {

public data class ExecutionSpecifier(
public val kind: ExecutionSpecifierKind,
public val index: BigInteger? = null,
public val index: ULong? = null,
) {
public companion object {
public fun read(buffer: ByteBuffer): ExecutionSpecifier {
return when(ExecutionSpecifierKind.read(buffer)) {
ExecutionSpecifierKind.All -> ExecutionSpecifier(
kind = ExecutionSpecifierKind.All,
)
ExecutionSpecifierKind.Index -> ExecutionSpecifier(
kind = ExecutionSpecifierKind.Index,
index = buffer.readCompactInteger()
)
ExecutionSpecifierKind.Index -> {
ExecutionSpecifier(
kind = ExecutionSpecifierKind.Index,
index = buffer.readU64()
)
}
}
}
}
Expand Down

0 comments on commit 1f24013

Please sign in to comment.