// Code generated by github.com/fjl/gencodec. DO NOT EDIT.

package types

import (
	"encoding/json"

	"github.com/erigontech/erigon/common/hexutil"
	"github.com/erigontech/erigon/common/math"
)

// MarshalJSON marshals as JSON.
func (a AuRaSeal) MarshalJSON() ([]byte, error) {
	type AuRaSeal struct {
		AuthorityRound struct {
			Step      math.HexOrDecimal64 "json:\"step\""
			Signature hexutil.Bytes       "json:\"signature\""
		} `json:"authorityRound"`
	}
	var enc AuRaSeal
	enc.AuthorityRound = a.AuthorityRound
	return json.Marshal(&enc)
}

// UnmarshalJSON unmarshals from JSON.
func (a *AuRaSeal) UnmarshalJSON(input []byte) error {
	type AuRaSeal struct {
		AuthorityRound *struct {
			Step      math.HexOrDecimal64 "json:\"step\""
			Signature hexutil.Bytes       "json:\"signature\""
		} `json:"authorityRound"`
	}
	var dec AuRaSeal
	if err := json.Unmarshal(input, &dec); err != nil {
		return err
	}
	if dec.AuthorityRound != nil {
		a.AuthorityRound = *dec.AuthorityRound
	}
	return nil
}
