Skip to content

Commit

Permalink
Update TypedData in line with SNIP-12 (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
DelevoXDG authored Mar 18, 2024
1 parent 245d48b commit 569c64f
Show file tree
Hide file tree
Showing 18 changed files with 1,270 additions and 300 deletions.
3 changes: 3 additions & 0 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ dependencies {
// Use the Kotlin JDK 8 standard library.
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.20")

// Use the Kotlin reflection library.
implementation(kotlin("reflect"))

// Use the JUnit test library.
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.0")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ enum class HashMethod {
override fun hash(first: Felt, second: Felt): Felt {
return StarknetCurve.pedersen(first, second)
}
override fun hash(values: List<Felt>): Felt {
return StarknetCurve.pedersenOnElements(values)
}
},
POSEIDON {
override fun hash(first: Felt, second: Felt): Felt {
return Poseidon.poseidonHash(first, second)
}
override fun hash(values: List<Felt>): Felt {
return Poseidon.poseidonHash(values)
}
}, ;

abstract fun hash(first: Felt, second: Felt): Felt
abstract fun hash(values: List<Felt>): Felt
}
Loading

0 comments on commit 569c64f

Please sign in to comment.