Skip to content

fix: Parse protobuf encoded keys for contract#226

Closed
manishdait wants to merge 2 commits intoOpenElements:mainfrom
manishdait:fix/key-handling
Closed

fix: Parse protobuf encoded keys for contract#226
manishdait wants to merge 2 commits intoOpenElements:mainfrom
manishdait:fix/key-handling

Conversation

@manishdait
Copy link
Contributor

While debugging the logs in https://github.com/OpenElements/hiero-enterprise-java/actions/runs/22081032269/job/63806078906?pr=224#step:7:538

failure is happening in MirrorNodeJsonConverterImpl.toContract() at:

PublicKey adminKey =
    node.get("admin_key").isNull()
        ? null
        : PublicKey.fromString(node.get("admin_key").get("key").asText());

// while mirror node response retrns:
"admin_key": {
  "_type": "ProtobufEncoded",
  "key": "0a03189908"
}

_type = "ProtobufEncoded" is a serialized protobuf Key message. however, PublicKey.fromString() expects DER / raw Ed25519 / raw ECDSA formats. Passing protobuf serialized bytes causes parsing to fail internally causes the stacktrace.

This PR fix the parsing of admin_key in toContract() for ProtobufEncoded key types.

Signed-off-by: Manish Dait <daitmanish88@gmail.com>
@manishdait manishdait marked this pull request as ready for review March 3, 2026 11:56
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
@manishdait
Copy link
Contributor Author

closing as repo get migrated

@manishdait manishdait closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant