Search in sources :

Example 1 with BeaconBlockBody

use of tech.pegasys.teku.api.schema.BeaconBlockBody in project web3signer by ConsenSys.

the class Eth2RequestUtils method createBlockRequest.

public static Eth2SigningRequestBody createBlockRequest(final UInt64 slot, final Bytes32 stateRoot) {
    final ForkInfo forkInfo = forkInfo();
    final BeaconBlock block = new BeaconBlock(slot, UInt64.valueOf(5), Bytes32.fromHexString("0xb2eedb01adbd02c828d5eec09b4c70cbba12ffffba525ebf48aca33028e8ad89"), stateRoot, new BeaconBlockBody(BLSSignature.fromHexString("0xa686652aed2617da83adebb8a0eceea24bb0d2ccec9cd691a902087f90db16aa5c7b03172a35e874e07e3b60c5b2435c0586b72b08dfe5aee0ed6e5a2922b956aa88ad0235b36dfaa4d2255dfeb7bed60578d982061a72c7549becab19b3c12f"), new Eth1Data(Bytes32.fromHexString("0x6a0f9d6cb0868daa22c365563bb113b05f7568ef9ee65fdfeb49a319eaf708cf"), UInt64.valueOf(8), Bytes32.fromHexString("0x4242424242424242424242424242424242424242424242424242424242424242")), Bytes32.fromHexString("0x74656b752f76302e31322e31302d6465762d6338316361363235000000000000"), emptyList(), emptyList(), emptyList(), emptyList(), emptyList()));
    final Bytes signingRoot = signingRootUtil.signingRootForSignBlock(block.asInternalBeaconBlock(spec), forkInfo.asInternalForkInfo());
    return new Eth2SigningRequestBody(ArtifactType.BLOCK, signingRoot, forkInfo, block, null, null, null, null, null, null, null, null, null, null);
}
Also used : Bytes(org.apache.tuweni.bytes.Bytes) ForkInfo(tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.ForkInfo) BeaconBlock(tech.pegasys.teku.api.schema.BeaconBlock) BeaconBlockBody(tech.pegasys.teku.api.schema.BeaconBlockBody) Eth2SigningRequestBody(tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.Eth2SigningRequestBody) Eth1Data(tech.pegasys.teku.api.schema.Eth1Data)

Aggregations

Bytes (org.apache.tuweni.bytes.Bytes)1 BeaconBlock (tech.pegasys.teku.api.schema.BeaconBlock)1 BeaconBlockBody (tech.pegasys.teku.api.schema.BeaconBlockBody)1 Eth1Data (tech.pegasys.teku.api.schema.Eth1Data)1 Eth2SigningRequestBody (tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.Eth2SigningRequestBody)1 ForkInfo (tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.ForkInfo)1