mirror of
https://github.com/corda/corda.git
synced 2025-06-22 17:09:00 +00:00
contracts, core, node: Use entropyToKeyPair in Generators instead of manually creating keys
This commit is contained in:
@ -5,6 +5,7 @@ import com.r3corda.core.testing.PublicKeyGenerator
|
||||
import com.r3corda.node.utilities.JsonSupport
|
||||
import net.i2p.crypto.eddsa.EdDSAPublicKey
|
||||
import org.junit.runner.RunWith
|
||||
import java.security.PublicKey
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@RunWith(com.pholser.junit.quickcheck.runner.JUnitQuickcheck::class)
|
||||
@ -15,7 +16,7 @@ class JsonSupportTest {
|
||||
}
|
||||
|
||||
@com.pholser.junit.quickcheck.Property
|
||||
fun publicKeySerializingWorks(@com.pholser.junit.quickcheck.From(PublicKeyGenerator::class) publicKey: EdDSAPublicKey) {
|
||||
fun publicKeySerializingWorks(@com.pholser.junit.quickcheck.From(PublicKeyGenerator::class) publicKey: PublicKey) {
|
||||
val serialized = mapper.writeValueAsString(publicKey)
|
||||
val parsedKey = mapper.readValue(serialized, EdDSAPublicKey::class.java)
|
||||
assertEquals(publicKey, parsedKey)
|
||||
|
Reference in New Issue
Block a user