diff --git a/src/main/java/com/casper/sdk/model/deploy/executabledeploy/StoredVersionedContractByHash.java b/src/main/java/com/casper/sdk/model/deploy/executabledeploy/StoredVersionedContractByHash.java index 365c7686..c99dbc4f 100644 --- a/src/main/java/com/casper/sdk/model/deploy/executabledeploy/StoredVersionedContractByHash.java +++ b/src/main/java/com/casper/sdk/model/deploy/executabledeploy/StoredVersionedContractByHash.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import dev.oak3.sbs4j.SerializerBuffer; import lombok.*; +import org.bouncycastle.util.encoders.Hex; import java.util.List; @@ -41,6 +42,6 @@ public byte getOrder() { @Override protected void serializeCustom(final SerializerBuffer ser) { - ser.writeString(getHash()); + ser.writeByteArray(Hex.decode(getHash())); } } diff --git a/src/test/java/com/casper/sdk/model/deploy/executabledeploy/StoredVersionedContractByHashTest.java b/src/test/java/com/casper/sdk/model/deploy/executabledeploy/StoredVersionedContractByHashTest.java index b58f1de3..82437482 100644 --- a/src/test/java/com/casper/sdk/model/deploy/executabledeploy/StoredVersionedContractByHashTest.java +++ b/src/test/java/com/casper/sdk/model/deploy/executabledeploy/StoredVersionedContractByHashTest.java @@ -59,7 +59,7 @@ void serializeStoredVersionedContractByHashTest() throws Exception { final SerializerBuffer serializerBuffer = new SerializerBuffer(); versionedContractByHash.serialize(serializerBuffer, Target.BYTE); - final String expectedBytes = "0340000000393231373364343937343463373930643437653530643031316438396531623561333365643264396661653864393435393332353232346438663938663365350101000000080000007472616e7366657202000000030000006f6e650400000001000000010300000074776f040000000200000001"; + final String expectedBytes = "0392173d49744c790d47e50d011d89e1b5a33ed2d9fae8d9459325224d8f98f3e50101000000080000007472616e7366657202000000030000006f6e650400000001000000010300000074776f040000000200000001"; final String actual = Hex.encode(serializerBuffer.toByteArray()); assertThat(actual, is(expectedBytes)); }