use of snowblossom.lib.NetworkParamsProd in project snowblossom by snowblossomcoin.
the class IceLeaf method main.
public static void main(String[] args) throws Exception {
Globals.addCryptoProvider();
new IceLeaf(new NetworkParamsProd(), null);
}
use of snowblossom.lib.NetworkParamsProd in project snowblossom by snowblossomcoin.
the class AddressUtilTest method testAddressConversions.
@Test
public void testAddressConversions() throws ValidationException {
ArrayList<NetworkParams> plist = new ArrayList<NetworkParams>();
plist.add(new NetworkParamsProd());
plist.add(new NetworkParamsTestnet());
plist.add(new NetworkParamsRegtest());
byte[] buff = new byte[Globals.ADDRESS_SPEC_HASH_LEN];
Random rnd = new Random();
HashSet<String> addresses = new HashSet<>();
for (int i = 0; i < 1000; i++) {
if (i > 0) {
rnd.nextBytes(buff);
}
AddressSpecHash spec = new AddressSpecHash(buff);
for (NetworkParams p : plist) {
String addr = spec.toAddressString(p);
Assert.assertFalse(addresses.contains(addr));
addresses.add(addr);
System.out.println("Address: " + addr);
AddressSpecHash dec = new AddressSpecHash(addr, p);
Assert.assertEquals(spec, dec);
int colon = addr.indexOf(":");
String without = addr.substring(colon + 1);
AddressSpecHash dec2 = new AddressSpecHash(without, p);
Assert.assertEquals(spec, dec2);
}
}
}
use of snowblossom.lib.NetworkParamsProd in project snowblossom by snowblossomcoin.
the class PowUtilTest method testReward.
@Test
public void testReward() {
NetworkParams params = new NetworkParamsProd();
int n = 4 * 365 * 144;
long reward = 50000000;
for (int b = 1; b < 10; b++) {
Assert.assertEquals(reward, PowUtil.getBlockReward(params, n * b - 1));
reward /= 2;
Assert.assertEquals(reward, PowUtil.getBlockReward(params, n * b));
}
}
Aggregations