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

package genesis

import (
	"encoding/json"
	"math/big"

	"github.com/celo-org/celo-blockchain/common/decimal/bigintstr"
)

var _ = (*DoubleSigningSlasherParametersMarshaling)(nil)

// MarshalJSON marshals as JSON.
func (d DoubleSigningSlasherParameters) MarshalJSON() ([]byte, error) {
	type DoubleSigningSlasherParameters struct {
		Penalty *bigintstr.BigIntStr `json:"penalty"`
		Reward  *bigintstr.BigIntStr `json:"reward"`
	}
	var enc DoubleSigningSlasherParameters
	enc.Penalty = (*bigintstr.BigIntStr)(d.Penalty)
	enc.Reward = (*bigintstr.BigIntStr)(d.Reward)
	return json.Marshal(&enc)
}

// UnmarshalJSON unmarshals from JSON.
func (d *DoubleSigningSlasherParameters) UnmarshalJSON(input []byte) error {
	type DoubleSigningSlasherParameters struct {
		Penalty *bigintstr.BigIntStr `json:"penalty"`
		Reward  *bigintstr.BigIntStr `json:"reward"`
	}
	var dec DoubleSigningSlasherParameters
	if err := json.Unmarshal(input, &dec); err != nil {
		return err
	}
	if dec.Penalty != nil {
		d.Penalty = (*big.Int)(dec.Penalty)
	}
	if dec.Reward != nil {
		d.Reward = (*big.Int)(dec.Reward)
	}
	return nil
}
