Skip to content

Commit

Permalink
chore: Update PBJ dependency (#11397)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Heinrichs <netopyr@users.noreply.github.com>
  • Loading branch information
netopyr authored and imalygin committed Apr 17, 2024
1 parent f4d7cdb commit 0c75add
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 62 deletions.
2 changes: 1 addition & 1 deletion hedera-dependency-versions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ moduleInfo {
version("com.google.jimfs", "1.2")
version("com.google.protobuf", protobufVersion)
version("com.google.protobuf.util", protobufVersion)
version("com.hedera.pbj.runtime", "0.7.14")
version("com.hedera.pbj.runtime", "0.7.19")
version("com.squareup.javapoet", "1.13.0")
version("com.sun.jna", "5.12.1")
version("dagger", daggerVersion)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import static com.hedera.hapi.node.base.ResponseCodeEnum.TRANSACTION_HAS_UNKNOWN_FIELDS;
import static com.hedera.hapi.node.base.ResponseCodeEnum.TRANSACTION_ID_FIELD_NOT_ALLOWED;
import static com.hedera.hapi.node.base.ResponseCodeEnum.TRANSACTION_OVERSIZE;
import static com.hedera.node.app.workflows.ParseExceptionWorkaround.getParseExceptionCause;
import static java.util.Collections.emptyList;
import static java.util.Objects.requireNonNull;

Expand Down Expand Up @@ -466,11 +465,7 @@ private <T extends Record> T parseStrict(
try {
return codec.parseStrict(data);
} catch (ParseException e) {

// Temporary workaround for unexpected behavior in PBJ. Can be removed if we agree that
// ParseException should not be wrapped.
final var cause = getParseExceptionCause(e);
if (cause instanceof UnknownFieldException) {
if (e.getCause() instanceof UnknownFieldException) {
// We do not allow newer clients to send transactions to older networks.
throw new PreCheckException(TRANSACTION_HAS_UNKNOWN_FIELDS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import static com.hedera.hapi.node.base.ResponseCodeEnum.PAYER_ACCOUNT_NOT_FOUND;
import static com.hedera.hapi.node.base.ResponseType.ANSWER_STATE_PROOF;
import static com.hedera.hapi.node.base.ResponseType.COST_ANSWER_STATE_PROOF;
import static com.hedera.node.app.workflows.ParseExceptionWorkaround.getParseExceptionCause;
import static java.util.Objects.requireNonNull;

import com.hedera.hapi.node.base.AccountID;
Expand Down Expand Up @@ -302,12 +301,7 @@ private Query parseQuery(Bytes requestBuffer) {
try {
return queryParser.parseStrict(requestBuffer.toReadableSequentialData());
} catch (ParseException e) {

// Temporary workaround for unexpected behavior in PBJ. Can be removed if we agree that
// ParseException should not be wrapped.
final var cause = getParseExceptionCause(e);

switch (cause) {
switch (e.getCause()) {
case MalformedProtobufException ex:
break;
case UnknownFieldException ex:
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,6 @@ dependencyResolutionManagement {
version("grpc-proto", "1.45.1")
version("hapi-proto", hapiProtoVersion)

plugin("pbj", "com.hedera.pbj.pbj-compiler").version("0.7.14")
plugin("pbj", "com.hedera.pbj.pbj-compiler").version("0.7.19")
}
}

0 comments on commit 0c75add

Please sign in to comment.