diff --git a/src/main/java/com/sparrowwallet/drongo/protocol/Sha256Hash.java b/src/main/java/com/sparrowwallet/drongo/protocol/Sha256Hash.java index 11c0269..ce3650d 100644 --- a/src/main/java/com/sparrowwallet/drongo/protocol/Sha256Hash.java +++ b/src/main/java/com/sparrowwallet/drongo/protocol/Sha256Hash.java @@ -61,6 +61,18 @@ public class Sha256Hash implements Comparable { return wrap(Utils.hexToBytes(hexString)); } + /** + * Duplicate method with default name for deserialization mappers. + * + * @param hexString a hash value represented as a hex string + * @return a new instance + * @throws IllegalArgumentException if the given string is not a valid + * hex string, or if it does not represent exactly 32 bytes + */ + public static Sha256Hash fromString(String hexString) { + return wrap(hexString); + } + /** * Creates a new instance that wraps the given hash value, but with byte order reversed. *