Skip to content

Commit

Permalink
tests unsupported hash versions
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Florentine <justin+github@florentine.us>
  • Loading branch information
jflo committed Jul 19, 2023
1 parent 31d7413 commit 60b9a17
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,20 @@

package org.hyperledger.besu.datatypes;

import static org.junit.jupiter.api.Assertions.assertThrows;

import org.apache.tuweni.bytes.Bytes32;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertThrows;

class VersionedHashTest {

@Test
public void throwsOnUnsupportedHashType() {
assertThrows(IllegalArgumentException.class, () -> new VersionedHash((byte) 0, Hash.ZERO));
}

@Test
public void throwsOnParsingUnsupportedHashType() {
assertThrows(IllegalArgumentException.class, () -> new VersionedHash(Bytes32.ZERO));
}
@Test
public void throwsOnUnsupportedHashType() {
assertThrows(IllegalArgumentException.class, () -> new VersionedHash((byte) 0, Hash.ZERO));
}

}
@Test
public void throwsOnParsingUnsupportedHashType() {
assertThrows(IllegalArgumentException.class, () -> new VersionedHash(Bytes32.ZERO));
}
}

0 comments on commit 60b9a17

Please sign in to comment.