github.com/aidoskuneen/adk-node@v0.0.0-20220315131952-2e32567cb7f4/eth/catalyst/api_types.go (about)

     1  // Copyright 2021 The adkgo Authors
     2  // This file is part of the adkgo library (adapted for adkgo from go--ethereum v1.10.8).
     3  //
     4  // the adkgo library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // the adkgo library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the adkgo library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  package catalyst
    18  
    19  import (
    20  	"github.com/aidoskuneen/adk-node/common"
    21  	"github.com/aidoskuneen/adk-node/common/hexutil"
    22  )
    23  
    24  //go:generate go run github.com/fjl/gencodec -type assembleBlockParams -field-override assembleBlockParamsMarshaling -out gen_blockparams.go
    25  
    26  // Structure described at https://hackmd.io/T9x2mMA4S7us8tJwEB3FDQ
    27  type assembleBlockParams struct {
    28  	ParentHash common.Hash `json:"parentHash"    gencodec:"required"`
    29  	Timestamp  uint64      `json:"timestamp"     gencodec:"required"`
    30  }
    31  
    32  // JSON type overrides for assembleBlockParams.
    33  type assembleBlockParamsMarshaling struct {
    34  	Timestamp hexutil.Uint64
    35  }
    36  
    37  //go:generate go run github.com/fjl/gencodec -type executableData -field-override executableDataMarshaling -out gen_ed.go
    38  
    39  // Structure described at https://notes.ethereum.org/@n0ble/rayonism-the-merge-spec#Parameters1
    40  type executableData struct {
    41  	BlockHash    common.Hash    `json:"blockHash"     gencodec:"required"`
    42  	ParentHash   common.Hash    `json:"parentHash"    gencodec:"required"`
    43  	Miner        common.Address `json:"miner"         gencodec:"required"`
    44  	StateRoot    common.Hash    `json:"stateRoot"     gencodec:"required"`
    45  	Number       uint64         `json:"number"        gencodec:"required"`
    46  	GasLimit     uint64         `json:"gasLimit"      gencodec:"required"`
    47  	GasUsed      uint64         `json:"gasUsed"       gencodec:"required"`
    48  	Timestamp    uint64         `json:"timestamp"     gencodec:"required"`
    49  	ReceiptRoot  common.Hash    `json:"receiptsRoot"  gencodec:"required"`
    50  	LogsBloom    []byte         `json:"logsBloom"     gencodec:"required"`
    51  	Transactions [][]byte       `json:"transactions"  gencodec:"required"`
    52  }
    53  
    54  // JSON type overrides for executableData.
    55  type executableDataMarshaling struct {
    56  	Number       hexutil.Uint64
    57  	GasLimit     hexutil.Uint64
    58  	GasUsed      hexutil.Uint64
    59  	Timestamp    hexutil.Uint64
    60  	LogsBloom    hexutil.Bytes
    61  	Transactions []hexutil.Bytes
    62  }
    63  
    64  type newBlockResponse struct {
    65  	Valid bool `json:"valid"`
    66  }
    67  
    68  type genericResponse struct {
    69  	Success bool `json:"success"`
    70  }