use of co.rsk.peg.BridgeStorageProvider in project rskj by rsksmart.
the class RetiringFederationTest method buildInitializer.
private BridgeStorageProviderInitializer buildInitializer(boolean present) {
final int minFederators = 10;
final int maxFederators = 16;
return (BridgeStorageProvider provider, Repository repository, int executionIndex) -> {
if (present) {
int numFederators = Helper.randomInRange(minFederators, maxFederators);
List<BtcECKey> federatorKeys = new ArrayList<>();
for (int i = 0; i < numFederators; i++) {
federatorKeys.add(new BtcECKey());
}
retiringFederation = new Federation(federatorKeys, Instant.ofEpochMilli(new Random().nextLong()), Helper.randomInRange(1, 10), networkParameters);
provider.setNewFederation(bridgeConstants.getGenesisFederation());
provider.setOldFederation(retiringFederation);
} else {
retiringFederation = null;
}
};
}
Aggregations