@Test public void shouldConvertToInternalObject() { BeaconState beaconState = new BeaconState(beaconStateInternal); assertThat(beaconState.asInternalBeaconState()).isEqualTo(beaconStateInternal); }
public tech.pegasys.teku.datastructures.state.BeaconState asInternalBeaconState() { return tech.pegasys.teku.datastructures.state.BeaconState.create( genesis_time, genesis_validators_root, slot, fork.asInternalFork(), latest_block_header.asInternalBeaconBlockHeader(), SSZVector.createMutable(block_roots, Bytes32.class), SSZVector.createMutable(state_roots, Bytes32.class), SSZList.createMutable(historical_roots, HISTORICAL_ROOTS_LIMIT, Bytes32.class), eth1_data.asInternalEth1Data(), SSZList.createMutable( eth1_data_votes.stream().map(Eth1Data::asInternalEth1Data).collect(Collectors.toList()), EPOCHS_PER_ETH1_VOTING_PERIOD, tech.pegasys.teku.datastructures.blocks.Eth1Data.class), eth1_deposit_index, SSZList.createMutable( validators.stream().map(Validator::asInternalValidator).collect(Collectors.toList()), Constants.VALIDATOR_REGISTRY_LIMIT, tech.pegasys.teku.datastructures.state.Validator.class), SSZList.createMutable(balances, VALIDATOR_REGISTRY_LIMIT, UInt64.class), SSZVector.createMutable(randao_mixes, Bytes32.class), SSZVector.createMutable(slashings, UInt64.class), SSZList.createMutable( previous_epoch_attestations.stream() .map(PendingAttestation::asInternalPendingAttestation) .collect(Collectors.toList()), MAX_ATTESTATIONS, tech.pegasys.teku.datastructures.state.PendingAttestation.class), SSZList.createMutable( current_epoch_attestations.stream() .map(PendingAttestation::asInternalPendingAttestation) .collect(Collectors.toList()), MAX_ATTESTATIONS, tech.pegasys.teku.datastructures.state.PendingAttestation.class), justification_bits, previous_justified_checkpoint.asInternalCheckpoint(), current_justified_checkpoint.asInternalCheckpoint(), finalized_checkpoint.asInternalCheckpoint()); }
BeaconState { public tech.pegasys.teku.datastructures.state.BeaconState asInternalBeaconState() { return tech.pegasys.teku.datastructures.state.BeaconState.create( genesis_time, genesis_validators_root, slot, fork.asInternalFork(), latest_block_header.asInternalBeaconBlockHeader(), SSZVector.createMutable(block_roots, Bytes32.class), SSZVector.createMutable(state_roots, Bytes32.class), SSZList.createMutable(historical_roots, HISTORICAL_ROOTS_LIMIT, Bytes32.class), eth1_data.asInternalEth1Data(), SSZList.createMutable( eth1_data_votes.stream().map(Eth1Data::asInternalEth1Data).collect(Collectors.toList()), EPOCHS_PER_ETH1_VOTING_PERIOD, tech.pegasys.teku.datastructures.blocks.Eth1Data.class), eth1_deposit_index, SSZList.createMutable( validators.stream().map(Validator::asInternalValidator).collect(Collectors.toList()), Constants.VALIDATOR_REGISTRY_LIMIT, tech.pegasys.teku.datastructures.state.Validator.class), SSZList.createMutable(balances, VALIDATOR_REGISTRY_LIMIT, UInt64.class), SSZVector.createMutable(randao_mixes, Bytes32.class), SSZVector.createMutable(slashings, UInt64.class), SSZList.createMutable( previous_epoch_attestations.stream() .map(PendingAttestation::asInternalPendingAttestation) .collect(Collectors.toList()), MAX_ATTESTATIONS, tech.pegasys.teku.datastructures.state.PendingAttestation.class), SSZList.createMutable( current_epoch_attestations.stream() .map(PendingAttestation::asInternalPendingAttestation) .collect(Collectors.toList()), MAX_ATTESTATIONS, tech.pegasys.teku.datastructures.state.PendingAttestation.class), justification_bits, previous_justified_checkpoint.asInternalCheckpoint(), current_justified_checkpoint.asInternalCheckpoint(), finalized_checkpoint.asInternalCheckpoint()); } }
BeaconState { public tech.pegasys.teku.datastructures.state.BeaconState asInternalBeaconState() { return tech.pegasys.teku.datastructures.state.BeaconState.create( genesis_time, genesis_validators_root, slot, fork.asInternalFork(), latest_block_header.asInternalBeaconBlockHeader(), SSZVector.createMutable(block_roots, Bytes32.class), SSZVector.createMutable(state_roots, Bytes32.class), SSZList.createMutable(historical_roots, HISTORICAL_ROOTS_LIMIT, Bytes32.class), eth1_data.asInternalEth1Data(), SSZList.createMutable( eth1_data_votes.stream().map(Eth1Data::asInternalEth1Data).collect(Collectors.toList()), EPOCHS_PER_ETH1_VOTING_PERIOD, tech.pegasys.teku.datastructures.blocks.Eth1Data.class), eth1_deposit_index, SSZList.createMutable( validators.stream().map(Validator::asInternalValidator).collect(Collectors.toList()), Constants.VALIDATOR_REGISTRY_LIMIT, tech.pegasys.teku.datastructures.state.Validator.class), SSZList.createMutable(balances, VALIDATOR_REGISTRY_LIMIT, UInt64.class), SSZVector.createMutable(randao_mixes, Bytes32.class), SSZVector.createMutable(slashings, UInt64.class), SSZList.createMutable( previous_epoch_attestations.stream() .map(PendingAttestation::asInternalPendingAttestation) .collect(Collectors.toList()), MAX_ATTESTATIONS, tech.pegasys.teku.datastructures.state.PendingAttestation.class), SSZList.createMutable( current_epoch_attestations.stream() .map(PendingAttestation::asInternalPendingAttestation) .collect(Collectors.toList()), MAX_ATTESTATIONS, tech.pegasys.teku.datastructures.state.PendingAttestation.class), justification_bits, previous_justified_checkpoint.asInternalCheckpoint(), current_justified_checkpoint.asInternalCheckpoint(), finalized_checkpoint.asInternalCheckpoint()); } @JsonCreator  BeaconState(
      @JsonProperty("genesis_time") final UInt64 genesis_time,
      @JsonProperty("genesis_validators_root") final Bytes32 genesis_validators_root,
      @JsonProperty("slot") final UInt64 slot,
      @JsonProperty("fork") final Fork fork,
      @JsonProperty("latest_block_header") final BeaconBlockHeader latest_block_header,
      @JsonProperty("block_roots") final List<Bytes32> block_roots,
      @JsonProperty("state_roots") final List<Bytes32> state_roots,
      @JsonProperty("historical_roots") final List<Bytes32> historical_roots,
      @JsonProperty("eth1_data") final Eth1Data eth1_data,
      @JsonProperty("eth1_data_votes") final List<Eth1Data> eth1_data_votes,
      @JsonProperty("eth1_deposit_index") final UInt64 eth1_deposit_index,
      @JsonProperty("validators") final List<Validator> validators,
      @JsonProperty("balances") final List<UInt64> balances,
      @JsonProperty("randao_mixes") final List<Bytes32> randao_mixes,
      @JsonProperty("slashings") final List<UInt64> slashings,
      @JsonProperty("previous_epoch_attestations")
          final List<PendingAttestation> previous_epoch_attestations,
      @JsonProperty("current_epoch_attestations")
          final List<PendingAttestation> current_epoch_attestations,
      @JsonProperty("justification_bits") final Bitvector justification_bits,
      @JsonProperty("previous_justified_checkpoint") final Checkpoint previous_justified_checkpoint,
      @JsonProperty("current_justified_checkpoint") final Checkpoint current_justified_checkpoint,
      @JsonProperty("finalized_checkpoint") final Checkpoint finalized_checkpoint);  BeaconState(final BeaconBlockAndState blockAndState);  BeaconState(final tech.pegasys.teku.datastructures.state.BeaconState beaconState); }
BeaconState { public tech.pegasys.teku.datastructures.state.BeaconState asInternalBeaconState() { return tech.pegasys.teku.datastructures.state.BeaconState.create( genesis_time, genesis_validators_root, slot, fork.asInternalFork(), latest_block_header.asInternalBeaconBlockHeader(), SSZVector.createMutable(block_roots, Bytes32.class), SSZVector.createMutable(state_roots, Bytes32.class), SSZList.createMutable(historical_roots, HISTORICAL_ROOTS_LIMIT, Bytes32.class), eth1_data.asInternalEth1Data(), SSZList.createMutable( eth1_data_votes.stream().map(Eth1Data::asInternalEth1Data).collect(Collectors.toList()), EPOCHS_PER_ETH1_VOTING_PERIOD, tech.pegasys.teku.datastructures.blocks.Eth1Data.class), eth1_deposit_index, SSZList.createMutable( validators.stream().map(Validator::asInternalValidator).collect(Collectors.toList()), Constants.VALIDATOR_REGISTRY_LIMIT, tech.pegasys.teku.datastructures.state.Validator.class), SSZList.createMutable(balances, VALIDATOR_REGISTRY_LIMIT, UInt64.class), SSZVector.createMutable(randao_mixes, Bytes32.class), SSZVector.createMutable(slashings, UInt64.class), SSZList.createMutable( previous_epoch_attestations.stream() .map(PendingAttestation::asInternalPendingAttestation) .collect(Collectors.toList()), MAX_ATTESTATIONS, tech.pegasys.teku.datastructures.state.PendingAttestation.class), SSZList.createMutable( current_epoch_attestations.stream() .map(PendingAttestation::asInternalPendingAttestation) .collect(Collectors.toList()), MAX_ATTESTATIONS, tech.pegasys.teku.datastructures.state.PendingAttestation.class), justification_bits, previous_justified_checkpoint.asInternalCheckpoint(), current_justified_checkpoint.asInternalCheckpoint(), finalized_checkpoint.asInternalCheckpoint()); } @JsonCreator  BeaconState(
      @JsonProperty("genesis_time") final UInt64 genesis_time,
      @JsonProperty("genesis_validators_root") final Bytes32 genesis_validators_root,
      @JsonProperty("slot") final UInt64 slot,
      @JsonProperty("fork") final Fork fork,
      @JsonProperty("latest_block_header") final BeaconBlockHeader latest_block_header,
      @JsonProperty("block_roots") final List<Bytes32> block_roots,
      @JsonProperty("state_roots") final List<Bytes32> state_roots,
      @JsonProperty("historical_roots") final List<Bytes32> historical_roots,
      @JsonProperty("eth1_data") final Eth1Data eth1_data,
      @JsonProperty("eth1_data_votes") final List<Eth1Data> eth1_data_votes,
      @JsonProperty("eth1_deposit_index") final UInt64 eth1_deposit_index,
      @JsonProperty("validators") final List<Validator> validators,
      @JsonProperty("balances") final List<UInt64> balances,
      @JsonProperty("randao_mixes") final List<Bytes32> randao_mixes,
      @JsonProperty("slashings") final List<UInt64> slashings,
      @JsonProperty("previous_epoch_attestations")
          final List<PendingAttestation> previous_epoch_attestations,
      @JsonProperty("current_epoch_attestations")
          final List<PendingAttestation> current_epoch_attestations,
      @JsonProperty("justification_bits") final Bitvector justification_bits,
      @JsonProperty("previous_justified_checkpoint") final Checkpoint previous_justified_checkpoint,
      @JsonProperty("current_justified_checkpoint") final Checkpoint current_justified_checkpoint,
      @JsonProperty("finalized_checkpoint") final Checkpoint finalized_checkpoint);  BeaconState(final BeaconBlockAndState blockAndState);  BeaconState(final tech.pegasys.teku.datastructures.state.BeaconState beaconState); tech.pegasys.teku.datastructures.state.BeaconState asInternalBeaconState(); }
BeaconState { public tech.pegasys.teku.datastructures.state.BeaconState asInternalBeaconState() { return tech.pegasys.teku.datastructures.state.BeaconState.create( genesis_time, genesis_validators_root, slot, fork.asInternalFork(), latest_block_header.asInternalBeaconBlockHeader(), SSZVector.createMutable(block_roots, Bytes32.class), SSZVector.createMutable(state_roots, Bytes32.class), SSZList.createMutable(historical_roots, HISTORICAL_ROOTS_LIMIT, Bytes32.class), eth1_data.asInternalEth1Data(), SSZList.createMutable( eth1_data_votes.stream().map(Eth1Data::asInternalEth1Data).collect(Collectors.toList()), EPOCHS_PER_ETH1_VOTING_PERIOD, tech.pegasys.teku.datastructures.blocks.Eth1Data.class), eth1_deposit_index, SSZList.createMutable( validators.stream().map(Validator::asInternalValidator).collect(Collectors.toList()), Constants.VALIDATOR_REGISTRY_LIMIT, tech.pegasys.teku.datastructures.state.Validator.class), SSZList.createMutable(balances, VALIDATOR_REGISTRY_LIMIT, UInt64.class), SSZVector.createMutable(randao_mixes, Bytes32.class), SSZVector.createMutable(slashings, UInt64.class), SSZList.createMutable( previous_epoch_attestations.stream() .map(PendingAttestation::asInternalPendingAttestation) .collect(Collectors.toList()), MAX_ATTESTATIONS, tech.pegasys.teku.datastructures.state.PendingAttestation.class), SSZList.createMutable( current_epoch_attestations.stream() .map(PendingAttestation::asInternalPendingAttestation) .collect(Collectors.toList()), MAX_ATTESTATIONS, tech.pegasys.teku.datastructures.state.PendingAttestation.class), justification_bits, previous_justified_checkpoint.asInternalCheckpoint(), current_justified_checkpoint.asInternalCheckpoint(), finalized_checkpoint.asInternalCheckpoint()); } @JsonCreator  BeaconState(
      @JsonProperty("genesis_time") final UInt64 genesis_time,
      @JsonProperty("genesis_validators_root") final Bytes32 genesis_validators_root,
      @JsonProperty("slot") final UInt64 slot,
      @JsonProperty("fork") final Fork fork,
      @JsonProperty("latest_block_header") final BeaconBlockHeader latest_block_header,
      @JsonProperty("block_roots") final List<Bytes32> block_roots,
      @JsonProperty("state_roots") final List<Bytes32> state_roots,
      @JsonProperty("historical_roots") final List<Bytes32> historical_roots,
      @JsonProperty("eth1_data") final Eth1Data eth1_data,
      @JsonProperty("eth1_data_votes") final List<Eth1Data> eth1_data_votes,
      @JsonProperty("eth1_deposit_index") final UInt64 eth1_deposit_index,
      @JsonProperty("validators") final List<Validator> validators,
      @JsonProperty("balances") final List<UInt64> balances,
      @JsonProperty("randao_mixes") final List<Bytes32> randao_mixes,
      @JsonProperty("slashings") final List<UInt64> slashings,
      @JsonProperty("previous_epoch_attestations")
          final List<PendingAttestation> previous_epoch_attestations,
      @JsonProperty("current_epoch_attestations")
          final List<PendingAttestation> current_epoch_attestations,
      @JsonProperty("justification_bits") final Bitvector justification_bits,
      @JsonProperty("previous_justified_checkpoint") final Checkpoint previous_justified_checkpoint,
      @JsonProperty("current_justified_checkpoint") final Checkpoint current_justified_checkpoint,
      @JsonProperty("finalized_checkpoint") final Checkpoint finalized_checkpoint);  BeaconState(final BeaconBlockAndState blockAndState);  BeaconState(final tech.pegasys.teku.datastructures.state.BeaconState beaconState); tech.pegasys.teku.datastructures.state.BeaconState asInternalBeaconState(); @Schema(type = "string", format = "uint64")
  final UInt64 genesis_time; final Bytes32 genesis_validators_root; @Schema(type = "string", format = "uint64")
  final UInt64 slot; final Fork fork; final BeaconBlockHeader latest_block_header; @ArraySchema(
      schema = @Schema(type = "string", format = "byte", description = DESCRIPTION_BYTES32))
  final List<Bytes32> block_roots; @ArraySchema(
      schema = @Schema(type = "string", format = "byte", description = DESCRIPTION_BYTES32))
  final List<Bytes32> state_roots; @ArraySchema(
      schema = @Schema(type = "string", format = "byte", description = DESCRIPTION_BYTES32))
  final List<Bytes32> historical_roots; final Eth1Data eth1_data; final List<Eth1Data> eth1_data_votes; @Schema(type = "string", format = "uint64")
  final UInt64 eth1_deposit_index; final List<Validator> validators; @ArraySchema(schema = @Schema(type = "string", format = "uint64"))
  final List<UInt64> balances; @ArraySchema(
      schema = @Schema(type = "string", format = "byte", description = DESCRIPTION_BYTES32))
  final List<Bytes32> randao_mixes; @ArraySchema(schema = @Schema(type = "string", format = "uint64"))
  final List<UInt64> slashings; final List<PendingAttestation> previous_epoch_attestations; final List<PendingAttestation> current_epoch_attestations; @Schema(type = "string", format = "byte", description = DESCRIPTION_BYTES_SSZ)
  final Bitvector justification_bits; final Checkpoint previous_justified_checkpoint; final Checkpoint current_justified_checkpoint; final Checkpoint finalized_checkpoint; }