Skip to content

Commit

Permalink
test: fix CryptographyTests (#15529)
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Mazurov <[email protected]>
  • Loading branch information
OlegMazurov authored Sep 17, 2024
1 parent 8786334 commit 855861f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void verifySyncEd25519Only(final int count) {
signatures[i] = ed25519SignaturePool.next();
final SignatureComponents components = extractComponents(signatures[i]);
assertTrue(cryptography.verifySync(
components.data(), components.publicKey(), components.signatureBytes(), SignatureType.ED25519));
components.data(), components.signatureBytes(), components.publicKey(), SignatureType.ED25519));
}
}

Expand All @@ -129,8 +129,8 @@ void verifySyncEcdsaSecp256k1Only(final int count) {
assertTrue(
cryptography.verifySync(
components.data(),
components.publicKey(),
components.signatureBytes(),
components.publicKey(),
SignatureType.ECDSA_SECP256K1),
"Signature should be valid");
}
Expand All @@ -145,8 +145,8 @@ void verifySyncInvalidEcdsaSecp256k1() {
assertFalse(
cryptography.verifySync(
components.data(),
Arrays.copyOfRange(components.publicKey(), 0, components.publicKey().length - 1),
components.signatureBytes(),
Arrays.copyOfRange(components.publicKey(), 0, components.publicKey().length - 1),
SignatureType.ECDSA_SECP256K1),
"Fails for invalid signature");
}
Expand All @@ -160,8 +160,8 @@ void verifySyncInvalidEd25519() {
assertFalse(
cryptography.verifySync(
components.data(),
Arrays.copyOfRange(components.publicKey(), 0, components.publicKey().length - 1),
components.signatureBytes(),
Arrays.copyOfRange(components.publicKey(), 0, components.publicKey().length - 1),
SignatureType.ED25519),
"Fails for invalid signature");
}
Expand Down Expand Up @@ -195,7 +195,7 @@ private SignatureComponents extractComponents(final TransactionSignature signatu
.position(signature.getSignatureOffset())
.get(signatureBytes);

return new SignatureComponents(data, signatureBytes, publicKey);
return new SignatureComponents(data, publicKey, signatureBytes);
}

private void checkMessages(final Message... messages) throws ExecutionException, InterruptedException {
Expand Down

0 comments on commit 855861f

Please sign in to comment.