public class DifficultyTest {
    @Test
    public void targetTest() {
        assertTrue(getTarget(454983370).toString(16).equals("1e7eca000000000000000000000000000000000000000000000000"));
    }

    @Test
    public void compactTargetTest() {
        assertTrue(getEncodedDifficulty(getTarget(454983370)) == 454983370);
        assertTrue(getEncodedDifficulty(new BigInteger("ffff0000000000000000000000000000000000000000000000000000", 16)) == 486604799);