2017-07-11 13:49:14 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								package tests
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								import (
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									"encoding/json"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									"errors"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									"math/big"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									"github.com/ethereum/go-ethereum/common"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									"github.com/ethereum/go-ethereum/common/math"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								var _ = (*stEnvMarshaling)(nil)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-03 15:50:07 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								// MarshalJSON marshals as JSON.
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-11 13:49:14 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								func (s stEnv) MarshalJSON() ([]byte, error) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									type stEnv struct {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Coinbase   common.UnprefixedAddress `json:"currentCoinbase"   gencodec:"required"`
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Difficulty *math.HexOrDecimal256    `json:"currentDifficulty" gencodec:"required"`
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-13 13:47:27 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										GasLimit   math.HexOrDecimal64      `json:"currentGasLimit"   gencodec:"required"`
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-11 13:49:14 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Number     math.HexOrDecimal64      `json:"currentNumber"     gencodec:"required"`
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Timestamp  math.HexOrDecimal64      `json:"currentTimestamp"  gencodec:"required"`
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-07 14:37:56 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										BaseFee    *math.HexOrDecimal256    `json:"currentBaseFee"  gencodec:"optional"`
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-11 13:49:14 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									var enc stEnv
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enc.Coinbase = common.UnprefixedAddress(s.Coinbase)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enc.Difficulty = (*math.HexOrDecimal256)(s.Difficulty)
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-13 13:47:27 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									enc.GasLimit = math.HexOrDecimal64(s.GasLimit)
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-11 13:49:14 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enc.Number = math.HexOrDecimal64(s.Number)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enc.Timestamp = math.HexOrDecimal64(s.Timestamp)
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-07 14:37:56 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									enc.BaseFee = (*math.HexOrDecimal256)(s.BaseFee)
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-11 13:49:14 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									return json.Marshal(&enc)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-03 15:50:07 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								// UnmarshalJSON unmarshals from JSON.
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-11 13:49:14 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								func (s *stEnv) UnmarshalJSON(input []byte) error {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									type stEnv struct {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Coinbase   *common.UnprefixedAddress `json:"currentCoinbase"   gencodec:"required"`
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Difficulty *math.HexOrDecimal256     `json:"currentDifficulty" gencodec:"required"`
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-13 13:47:27 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										GasLimit   *math.HexOrDecimal64      `json:"currentGasLimit"   gencodec:"required"`
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-11 13:49:14 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Number     *math.HexOrDecimal64      `json:"currentNumber"     gencodec:"required"`
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Timestamp  *math.HexOrDecimal64      `json:"currentTimestamp"  gencodec:"required"`
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-07 14:37:56 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										BaseFee    *math.HexOrDecimal256     `json:"currentBaseFee"  gencodec:"optional"`
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-11 13:49:14 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									var dec stEnv
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if err := json.Unmarshal(input, &dec); err != nil {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										return err
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if dec.Coinbase == nil {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										return errors.New("missing required field 'currentCoinbase' for stEnv")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									s.Coinbase = common.Address(*dec.Coinbase)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if dec.Difficulty == nil {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										return errors.New("missing required field 'currentDifficulty' for stEnv")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									s.Difficulty = (*big.Int)(dec.Difficulty)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if dec.GasLimit == nil {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										return errors.New("missing required field 'currentGasLimit' for stEnv")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-13 13:47:27 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									s.GasLimit = uint64(*dec.GasLimit)
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-11 13:49:14 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if dec.Number == nil {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										return errors.New("missing required field 'currentNumber' for stEnv")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									s.Number = uint64(*dec.Number)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if dec.Timestamp == nil {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										return errors.New("missing required field 'currentTimestamp' for stEnv")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									s.Timestamp = uint64(*dec.Timestamp)
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-07 14:37:56 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									if dec.BaseFee != nil {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										s.BaseFee = (*big.Int)(dec.BaseFee)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-11 13:49:14 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									return nil
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 |