Don't use sun.security.krb5.Confounder.bytes. (#230)

* Don't rely on sun.security.krb5.Confounder.bytes.

It's not reflected as part of the JDK platform and makes IDEs cranky.

* Use a better SecureRandom factory.

* spotless
Danno Ferrin 6 years ago committed by GitHub
parent 0efd078689
commit c86193b423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/db/GenesisBlockMismatchTest.java

@ -13,8 +13,8 @@
package tech.pegasys.pantheon.ethereum.db; package tech.pegasys.pantheon.ethereum.db;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
import static sun.security.krb5.Confounder.bytes;
import tech.pegasys.pantheon.crypto.SecureRandomProvider;
import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.Address;
import tech.pegasys.pantheon.ethereum.core.Block; import tech.pegasys.pantheon.ethereum.core.Block;
import tech.pegasys.pantheon.ethereum.core.BlockBody; import tech.pegasys.pantheon.ethereum.core.BlockBody;
@ -30,11 +30,19 @@ import tech.pegasys.pantheon.util.bytes.Bytes32;
import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.bytes.BytesValue;
import tech.pegasys.pantheon.util.uint.UInt256; import tech.pegasys.pantheon.util.uint.UInt256;
import java.security.SecureRandom;
import java.util.Collections; import java.util.Collections;
import org.junit.Test; import org.junit.Test;
public class GenesisBlockMismatchTest { public class GenesisBlockMismatchTest {
private static final SecureRandom srand = SecureRandomProvider.publicSecureRandom();
private static byte[] bytes(final int len) {
final byte[] bytes = new byte[len];
srand.nextBytes(bytes);
return bytes;
}
@Test @Test
public void suppliedGenesisBlockMismatchStoredChainDataException() { public void suppliedGenesisBlockMismatchStoredChainDataException() {

Loading…
Cancel
Save