Skip to content

Commit

Permalink
contracts: sr25519 test improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
CedarMist committed Dec 6, 2024
1 parent 9c211d8 commit 473caf8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contracts/test/signing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@ describe('Signing', function () {
const result = await se.testVerify(6, sigSigner, CONTEXT, msg, sig);
expect(result).eq(true);

// Test key generation
// Test key generation on-chian matches JS implementation
const generatedKey = await se.testKeygen(6, secretSeed);
expect(hexlify(getBytes(generatedKey.secretKey).slice(0,64))).eq(hexlify(secretKey));
expect(generatedKey.publicKey).eq(hexlify(publicKey));

// 64 byte secret, appended with 32 byte public key
expect(getBytes(generatedKey.publicKey).length).eq(32);
expect(getBytes(generatedKey.secretKey).length).eq(96);
Expand Down

0 comments on commit 473caf8

Please sign in to comment.