Skip to main content

Create test keypairs

The code example provided below showcases the usage of the System Library, which allows generating a set of predefined key pairs for testing purposes. These key pairs are very helpful in the development environment.

src/test/my_test.rell
@test module;

function test_keypairs() {
val alice_keypair = rell.test.keypairs.alice; // bob, trudy, charlie, dave, eve, frank, grace, heidi
print(alice_keypair);

val alice_public_key = alice_keypair.pub;
print(alice_public_key);

val alice_private_key = alice_keypair.priv;
print(alice_private_key);

val bob_pubkey = rell.test.pubkeys.bob;
print(bob_pubkey);

val bob_privkey = rell.test.privkeys.bob;
print(bob_privkey);

val admin_keypair = rell.test.keypair(
priv = x"994E7BDC24B5A3709E8ED2BFA95607121CA4571C6EF6AF07785FCEA4AB2500CC",
pub = x"03D176689A1B7AFB94BFB64F08ED087C40FE06730E8FD77413CD353C986A8EED9C"
);
print(admin_keypair);
}

For a complete code example, refer to the Cookbook repository