Skip to content

Commit

Permalink
fix genesis_validators_root and missing @JsonCreator on BeaconStateMe…
Browse files Browse the repository at this point in the history
…rge, ExecutionPayload and ExecutionPayloadHeader
  • Loading branch information
tbenr committed Nov 4, 2021
1 parent 178c81d commit 866d70a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public abstract class BeaconState implements State {
@Schema(type = "string", format = "uint64")
public final UInt64 genesis_time;

@Schema(type = "string", format = "byte", description = DESCRIPTION_BYTES32)
public final Bytes32 genesis_validators_root;

@Schema(type = "string", format = "uint64")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

package tech.pegasys.teku.api.schema.merge;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Objects;
Expand All @@ -37,6 +38,7 @@ public class BeaconStateMerge extends BeaconStateAltair {
@JsonProperty("latest_execution_payload_header")
public final ExecutionPayloadHeader latestExecutionPayloadHeader;

@JsonCreator
public BeaconStateMerge(
@JsonProperty("genesis_time") final UInt64 genesisTime,
@JsonProperty("genesis_validators_root") final Bytes32 genesisValidatorsRoot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

package tech.pegasys.teku.api.schema.merge;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
import io.swagger.v3.oas.annotations.media.ArraySchema;
Expand All @@ -37,6 +38,7 @@ public class ExecutionPayload extends ExecutionPayloadCommon {
@ArraySchema(schema = @Schema(type = "string", format = "byte"))
public final List<Bytes> transactions;

@JsonCreator
public ExecutionPayload(
@JsonProperty("parent_hash") Bytes32 parentHash,
@JsonProperty("coinbase") Bytes20 coinbase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import static tech.pegasys.teku.api.schema.SchemaConstants.DESCRIPTION_BYTES32;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
import io.swagger.v3.oas.annotations.media.Schema;
Expand All @@ -37,6 +38,7 @@ public class ExecutionPayloadHeader extends ExecutionPayloadCommon {
description = DESCRIPTION_BYTES32)
public final Bytes32 transactionsRoot;

@JsonCreator
public ExecutionPayloadHeader(
@JsonProperty("parent_hash") Bytes32 parentHash,
@JsonProperty("coinbase") Bytes20 coinbase,
Expand Down

0 comments on commit 866d70a

Please sign in to comment.