use of it.unimi.dsi.fastutil.ints.IntCollection in project teku by ConsenSys.
the class ValidatorApiHandler method getAttestationDuties.
@Override
public SafeFuture<Optional<AttesterDuties>> getAttestationDuties(final UInt64 epoch, final IntCollection validatorIndices) {
if (isSyncActive()) {
return NodeSyncingException.failedFuture();
}
if (epoch.isGreaterThan(combinedChainDataClient.getCurrentEpoch().plus(spec.getSpecConfig(epoch).getMinSeedLookahead() + DUTY_EPOCH_TOLERANCE))) {
return SafeFuture.failedFuture(new IllegalArgumentException(String.format("Attestation duties were requested %s epochs ahead, only 1 epoch in future is supported.", epoch.minus(combinedChainDataClient.getCurrentEpoch()).toString())));
}
final UInt64 slot = spec.getEarliestQueryableSlotForBeaconCommitteeInTargetEpoch(epoch);
LOG.trace("Retrieving attestation duties from epoch {} using state at slot {}", epoch, slot);
return combinedChainDataClient.getStateAtSlotExact(slot).thenApply(optionalState -> optionalState.map(state -> getAttesterDutiesFromIndicesAndState(state, epoch, validatorIndices)));
}
use of it.unimi.dsi.fastutil.ints.IntCollection in project nbt-crafting by Siphalor.
the class MixinRecipeFinder$Filter method method_7422.
/**
* @reason Builds the idToAmountMap but with calls to ingredient matches
* @author Siphalor
*/
@Overwrite
private int[] method_7422() {
owner = NbtCrafting.lastRecipeFinder;
IntCollection ints = new IntAVLTreeSet();
for (int id : owner.idToAmountMap.keySet()) {
for (Ingredient ingredient : ingredients) {
if (ingredient.test(RecipeFinder.getStackFromId(id)))
ints.add(id);
}
}
return ints.toIntArray();
}
Aggregations