// 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 _ = (*LockedgoldRequirementsMarshaling)(nil)

// MarshalJSON marshals as JSON.
func (l LockedGoldRequirements) MarshalJSON() ([]byte, error) {
	type LockedGoldRequirements struct {
		Value    *bigintstr.BigIntStr `json:"value"`
		Duration uint64               `json:"duration"`
	}
	var enc LockedGoldRequirements
	enc.Value = (*bigintstr.BigIntStr)(l.Value)
	enc.Duration = l.Duration
	return json.Marshal(&enc)
}

// UnmarshalJSON unmarshals from JSON.
func (l *LockedGoldRequirements) UnmarshalJSON(input []byte) error {
	type LockedGoldRequirements struct {
		Value    *bigintstr.BigIntStr `json:"value"`
		Duration *uint64              `json:"duration"`
	}
	var dec LockedGoldRequirements
	if err := json.Unmarshal(input, &dec); err != nil {
		return err
	}
	if dec.Value != nil {
		l.Value = (*big.Int)(dec.Value)
	}
	if dec.Duration != nil {
		l.Duration = *dec.Duration
	}
	return nil
}
