Getting started with unit tests
This commit is contained in:
@@ -489,11 +489,11 @@ public object Secp256k1Native : Secp256k1 {
|
||||
totalSigners: Int,
|
||||
ids33: Array<ByteArray>
|
||||
): Triple<Array<ByteArray>, Array<ByteArray>, ByteArray> {
|
||||
require(seed32.size == 32)
|
||||
require(threshold > 0)
|
||||
require(threshold <= totalSigners)
|
||||
require(ids33.size == totalSigners)
|
||||
ids33.forEach { require(it.size == 33) }
|
||||
require(seed32.size == 32, { "seed size should be 32" })
|
||||
require(threshold > 1, { "threshold cannot be less then 1" })
|
||||
require(threshold <= totalSigners, { "threshold($threshold) cannot be greater then totalSigners ($totalSigners)" })
|
||||
require(ids33.size == totalSigners, { "ids33 size need to be the same as totalSigners size" })
|
||||
ids33.forEach { require(it.size == 33, { "id33 size must be 33" }) }
|
||||
|
||||
memScoped {
|
||||
val nShares = allocArray<secp256k1_frost_share>(ids33.size)
|
||||
@@ -543,7 +543,7 @@ public object Secp256k1Native : Secp256k1 {
|
||||
require(publicKey.size == 33 || publicKey.size == 65)
|
||||
}
|
||||
}
|
||||
require(threshold > 0)
|
||||
require(threshold > 1)
|
||||
require(threshold <= totalShareCount)
|
||||
require(id33.size == 33)
|
||||
|
||||
@@ -587,7 +587,7 @@ public object Secp256k1Native : Secp256k1 {
|
||||
share: ByteArray,
|
||||
vssCommitment: Array<ByteArray>
|
||||
): Int {
|
||||
require(threshold > 0)
|
||||
require(threshold > 1)
|
||||
require(id33.size == 33)
|
||||
require(share.size == Secp256k1.FROST_SHARE_SIZE)
|
||||
|
||||
@@ -617,7 +617,7 @@ public object Secp256k1Native : Secp256k1 {
|
||||
vssCommitments: Array<Array<ByteArray>>,
|
||||
totalSignersCount: Int
|
||||
): ByteArray {
|
||||
require(threshold > 0)
|
||||
require(threshold > 1)
|
||||
require(threshold <= totalSignersCount)
|
||||
require(id33.size == 33)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user