Skip to content

Commit

Permalink
Add toString to VersionedHash (#5610)
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
  • Loading branch information
Gabriel-Trintinalia authored and jflo committed Jun 21, 2023
1 parent f8bc598 commit 7a95757
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonValue;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;

Expand Down Expand Up @@ -70,4 +71,10 @@ public int hashCode() {

public static final VersionedHash DEFAULT_VERSIONED_HASH =
new VersionedHash((byte) 0x01, Hash.wrap(Bytes32.wrap(Bytes.repeat((byte) 42, 32))));

@JsonValue
@Override
public String toString() {
return this.toBytes().toHexString();
}
}

0 comments on commit 7a95757

Please sign in to comment.