use of tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.ForkInfo in project web3signer by ConsenSys.
the class Eth2RequestUtils method createSyncCommitteeMessageRequest.
private static Eth2SigningRequestBody createSyncCommitteeMessageRequest() {
final ForkInfo forkInfo = forkInfo();
final Bytes signingRoot;
try {
signingRoot = signingRootFromSyncCommitteeUtils(slot, utils -> utils.getSyncCommitteeMessageSigningRoot(beaconBlockRoot, altairSpec.computeEpochAtSlot(slot), forkInfo.asInternalForkInfo())).get();
} catch (final InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
final SyncCommitteeMessage syncCommitteeMessage = new SyncCommitteeMessage(beaconBlockRoot, slot);
return new Eth2SigningRequestBody(ArtifactType.SYNC_COMMITTEE_MESSAGE, signingRoot, forkInfo, null, null, null, null, null, null, null, null, syncCommitteeMessage, null, null);
}
use of tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.ForkInfo in project web3signer by ConsenSys.
the class Eth2RequestUtils method forkInfo.
public static ForkInfo forkInfo(long epoch) {
final Fork fork = new Fork(Bytes4.fromHexString("0x00000001"), Bytes4.fromHexString("0x00000001"), UInt64.valueOf(epoch));
final Bytes32 genesisValidatorsRoot = Bytes32.fromHexString(GENESIS_VALIDATORS_ROOT);
return new ForkInfo(fork, genesisValidatorsRoot);
}
use of tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.ForkInfo in project web3signer by ConsenSys.
the class Eth2RequestUtils method createRandaoReveal.
private static Eth2SigningRequestBody createRandaoReveal() {
final ForkInfo forkInfo = forkInfo();
final RandaoReveal randaoReveal = new RandaoReveal(UInt64.valueOf(3));
final Bytes signingRoot = signingRootUtil.signingRootForRandaoReveal(randaoReveal.getEpoch(), forkInfo.asInternalForkInfo());
return new Eth2SigningRequestBody(ArtifactType.RANDAO_REVEAL, signingRoot, forkInfo, null, null, null, null, null, null, randaoReveal, null, null, null, null);
}
use of tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.ForkInfo in project web3signer by ConsenSys.
the class Eth2RequestUtils method createVoluntaryExit.
private static Eth2SigningRequestBody createVoluntaryExit() {
final ForkInfo forkInfo = forkInfo();
final VoluntaryExit voluntaryExit = new VoluntaryExit(UInt64.valueOf(119), UInt64.ZERO);
final Bytes signingRoot = signingRootUtil.signingRootForSignVoluntaryExit(voluntaryExit.asInternalVoluntaryExit(), forkInfo.asInternalForkInfo());
return new Eth2SigningRequestBody(ArtifactType.VOLUNTARY_EXIT, signingRoot, forkInfo, null, null, null, null, null, voluntaryExit, null, null, null, null, null);
}
use of tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.ForkInfo in project web3signer by ConsenSys.
the class Eth2RequestUtils method forkInfo.
public static ForkInfo forkInfo() {
final Fork fork = new Fork(Bytes4.fromHexString("0x00000001"), Bytes4.fromHexString("0x00000001"), UInt64.valueOf(1));
final Bytes32 genesisValidatorsRoot = Bytes32.fromHexString(GENESIS_VALIDATORS_ROOT);
return new ForkInfo(fork, genesisValidatorsRoot);
}
Aggregations