Skip to content

Commit

Permalink
be explicit about beacon state hardfork type
Browse files Browse the repository at this point in the history
  • Loading branch information
mpjunior92 committed Jan 23, 2024
1 parent 6b01966 commit 3f98ddc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion merkle_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ type Proofs struct {
WithdrawalFields []string `json:"WithdrawalFields"`
}

func parseJSONFile(filePath string) (*beaconStateJSON, error) {
func parseJSONFile(filePath string) (*beaconStateJSONDeneb, error) {
data, err := os.ReadFile(filePath)

if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions proof_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type BalanceUpdateProofs struct {
ValidatorFields []string `json:"ValidatorFields"`
}

type beaconStateJSON struct {
type beaconStateJSONDeneb struct {
GenesisTime string `json:"genesis_time"`
GenesisValidatorsRoot string `json:"genesis_validators_root"`
Slot string `json:"slot"`
Expand Down Expand Up @@ -120,7 +120,7 @@ type beaconStateJSONCapella struct {
}

type beaconStateVersion struct {
Data beaconStateJSON `json:"data"`
Data beaconStateJSONDeneb `json:"data"`
}

type beaconStateVersionCapella struct {
Expand Down Expand Up @@ -248,7 +248,7 @@ func GetWithdrawalFields(w *capella.Withdrawal) []string {
return withdrawalFields
}

func ParseStateJSONFile(filePath string) (*beaconStateJSON, error) {
func ParseStateJSONFile(filePath string) (*beaconStateJSONDeneb, error) {
data, err := ioutil.ReadFile(filePath)

if err != nil {
Expand Down Expand Up @@ -287,7 +287,7 @@ func ParseCapellaStateJSONFile(filePath string) (*beaconStateJSONCapella, error)
}

// nolint:gocyclo
func ParseDenebBeaconStateFromJSON(data beaconStateJSON, s *deneb.BeaconState) error {
func ParseDenebBeaconStateFromJSON(data beaconStateJSONDeneb, s *deneb.BeaconState) error {
var err error

if data.GenesisTime == "" {
Expand Down

0 comments on commit 3f98ddc

Please sign in to comment.