use of tech.pegasys.teku.spec.SpecVersion in project teku by ConsenSys.
the class SigningRootUtil method signingRootForSignAttestationData.
public Bytes signingRootForSignAttestationData(final AttestationData attestationData, final ForkInfo forkInfo) {
final SpecVersion specVersion = spec.atSlot(attestationData.getSlot());
final Bytes32 domain = spec.getDomain(Domain.BEACON_ATTESTER, attestationData.getTarget().getEpoch(), forkInfo.getFork(), forkInfo.getGenesisValidatorsRoot());
return specVersion.miscHelpers().computeSigningRoot(attestationData, domain);
}
use of tech.pegasys.teku.spec.SpecVersion in project teku by ConsenSys.
the class SigningRootUtil method signingRootForSignAggregationSlot.
public Bytes signingRootForSignAggregationSlot(final UInt64 slot, final ForkInfo forkInfo) {
final SpecVersion specVersion = spec.atSlot(slot);
final Bytes32 domain = spec.getDomain(Domain.SELECTION_PROOF, spec.computeEpochAtSlot(slot), forkInfo.getFork(), forkInfo.getGenesisValidatorsRoot());
return specVersion.miscHelpers().computeSigningRoot(slot, domain);
}
use of tech.pegasys.teku.spec.SpecVersion in project teku by ConsenSys.
the class SigningRootUtil method signingRootForRandaoReveal.
public Bytes signingRootForRandaoReveal(final UInt64 epoch, final ForkInfo forkInfo) {
final SpecVersion specVersion = spec.atEpoch(epoch);
Bytes32 domain = spec.getDomain(Domain.RANDAO, epoch, forkInfo.getFork(), forkInfo.getGenesisValidatorsRoot());
return specVersion.miscHelpers().computeSigningRoot(epoch, domain);
}
use of tech.pegasys.teku.spec.SpecVersion in project teku by ConsenSys.
the class SigningRootUtil method signingRootForSignVoluntaryExit.
public Bytes signingRootForSignVoluntaryExit(final VoluntaryExit voluntaryExit, final ForkInfo forkInfo) {
final SpecVersion specVersion = spec.atEpoch(voluntaryExit.getEpoch());
final Bytes32 domain = spec.getDomain(Domain.VOLUNTARY_EXIT, voluntaryExit.getEpoch(), forkInfo.getFork(), forkInfo.getGenesisValidatorsRoot());
return specVersion.miscHelpers().computeSigningRoot(voluntaryExit, domain);
}
use of tech.pegasys.teku.spec.SpecVersion in project teku by ConsenSys.
the class BeaconStateTestBuilder method build.
public BeaconState build() {
final SpecVersion specVersion = dataStructureUtil.getSpec().atSlot(slot);
return specVersion.getSchemaDefinitions().getBeaconStateSchema().createEmpty().updated(state -> {
state.setSlot(slot);
state.setFork(fork);
state.getValidators().appendAll(validators);
state.getBalances().appendAllElements(balances);
});
}
Aggregations