Skip to content

Commit

Permalink
chore: Fixes compile issues on develop from protobufs (#13244)
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech>
Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@swirldslabs.com>
Co-authored-by: Neeharika-Sompalli <neeharika.sompalli@swirldslabs.com>
Co-authored-by: Neeharika Sompalli <52669918+Neeharika-Sompalli@users.noreply.github.com>
  • Loading branch information
3 people committed May 14, 2024
1 parent e1c1665 commit ea0b875
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ public final class PbjConverter {
case INVALID_SERVICE_ENDPOINT -> ResponseCodeEnum.INVALID_SERVICE_ENDPOINT;
case INVALID_GOSSIP_CAE_CERTIFICATE -> ResponseCodeEnum.INVALID_GOSSIP_CAE_CERTIFICATE;
case INVALID_GRPC_CERTIFICATE -> ResponseCodeEnum.INVALID_GRPC_CERTIFICATE;
case INVALID_MAX_AUTO_ASSOCIATIONS -> ResponseCodeEnum.INVALID_MAX_AUTO_ASSOCIATIONS;
case UNRECOGNIZED -> throw new RuntimeException("UNRECOGNIZED Response code!");
};
}
Expand Down Expand Up @@ -1337,6 +1338,8 @@ public static com.hederahashgraph.api.proto.java.ResponseCodeEnum fromPbj(@NonNu
.INVALID_GOSSIP_CAE_CERTIFICATE;
case INVALID_GRPC_CERTIFICATE -> com.hederahashgraph.api.proto.java.ResponseCodeEnum
.INVALID_GRPC_CERTIFICATE;
case INVALID_MAX_AUTO_ASSOCIATIONS -> com.hederahashgraph.api.proto.java.ResponseCodeEnum
.INVALID_MAX_AUTO_ASSOCIATIONS;
// case UNRECOGNIZED -> throw new RuntimeException("UNRECOGNIZED Response code!");
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void validDeterministicKeysTest() {
final PublicKey signaturePublicKey = address.getSigPublicKey();
final KeysAndCerts privateKeys = builderA.getPrivateKeys(id);

final byte[] data = randotron.randomByteArray(64);
final byte[] data = randotron.nextByteArray(64);
final com.swirlds.common.crypto.Signature signature = new PlatformSigner(privateKeys).sign(data);

assertTrue(CryptoStatic.verifySignature(data, signature.getSignatureBytes(), signaturePublicKey));
Expand All @@ -121,7 +121,7 @@ void validDeterministicKeysTest() {
assertFalse(CryptoStatic.verifySignature(data, signature.getSignatureBytes(), wrongPublicKey));

// Sanity check: validating against the wrong data should fail
final byte[] wrongData = randotron.randomByteArray(64);
final byte[] wrongData = randotron.nextByteArray(64);
assertFalse(CryptoStatic.verifySignature(wrongData, signature.getSignatureBytes(), signaturePublicKey));

// Sanity check: validating with a modified signature should fail
Expand Down

0 comments on commit ea0b875

Please sign in to comment.