From dce2cbe834cfdea3e87a52723d4516b3d5bf7ac2 Mon Sep 17 00:00:00 2001 From: meywood <105049338+meywood@users.noreply.github.com> Date: Wed, 13 Mar 2024 17:45:27 +0000 Subject: [PATCH] issues/219 - Tidy up for code review. --- src/main/java/com/casper/sdk/model/key/PublicKey.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/casper/sdk/model/key/PublicKey.java b/src/main/java/com/casper/sdk/model/key/PublicKey.java index 593987d23..21fc7cb80 100644 --- a/src/main/java/com/casper/sdk/model/key/PublicKey.java +++ b/src/main/java/com/casper/sdk/model/key/PublicKey.java @@ -52,11 +52,10 @@ public static PublicKey fromAbstractPublicKey(final AbstractPublicKey key) { public static PublicKey deserialize(final DeserializerBuffer deser) throws ValueDeserializationException, NoSuchAlgorithmException { // Obtain algorithm tag final AlgorithmTag tag = AlgorithmTag.getByTag(deser.readU8()); - final int len = tag.getLength(); final PublicKey publicKey = new PublicKey(); publicKey.setTag(tag); // Read the required number of bytes for the algorithm length - publicKey.setKey(deser.readByteArray(len)); + publicKey.setKey(deser.readByteArray(tag.getLength())); return publicKey; }