types

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 5 Imported by: 55

Documentation

Overview

Code generated by fastssz. DO NOT EDIT. Hash: 4a4ccc60aab5047010a81c0e31ee277b3a78ec9fd135e7c68fae7980ed5234dc

Code generated by fastssz. DO NOT EDIT. Hash: abdfe80a252da5f6c1826d62adf6d099a45d38a3c7706081a1308829e1ee33ab

Index

Constants

This section is empty.

Variables

View Source
var (
	DomainBuilder Domain

	DomainTypeBeaconProposer DomainType = DomainType{0x00, 0x00, 0x00, 0x00}
	DomainTypeAppBuilder     DomainType = DomainType{0x00, 0x00, 0x00, 0x01}
)
View Source
var (
	ErrLength = fmt.Errorf("incorrect byte length")
)

Functions

func ComputeDomain

func ComputeDomain(dt DomainType, forkVersion ForkVersion, genesisValidatorsRoot Root) [32]byte

func ComputeSigningRoot

func ComputeSigningRoot(obj HashTreeRoot, d Domain) ([32]byte, error)

func VerifySignature

func VerifySignature(obj HashTreeRoot, d Domain, pkBytes, sigBytes []byte) (bool, error)

Types

type Address

type Address [20]byte

func HexToAddress

func HexToAddress(s string) (ret Address, err error)

HexToAddress takes a hex string and returns an Address

func (*Address) FromSlice

func (a *Address) FromSlice(x []byte)

func (Address) MarshalText

func (a Address) MarshalText() ([]byte, error)

func (Address) String

func (a Address) String() string

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(input []byte) error

func (*Address) UnmarshalText

func (a *Address) UnmarshalText(input []byte) error

type Attestation

type Attestation struct {
	AggregationBits hexutil.Bytes    `json:"aggregation_bits" ssz:"bitlist" ssz-max:"2048"` // MAX_VALIDATORS_PER_COMMITTEE
	Data            *AttestationData `json:"data"`
	Signature       Signature        `json:"signature" ssz-size:"96"`
}

Attestation https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#attestation

func (*Attestation) HashTreeRoot

func (a *Attestation) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Attestation object

func (*Attestation) HashTreeRootWith

func (a *Attestation) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the Attestation object with a hasher

func (*Attestation) MarshalSSZ

func (a *Attestation) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Attestation object

func (*Attestation) MarshalSSZTo

func (a *Attestation) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Attestation object to a target array

func (*Attestation) SizeSSZ

func (a *Attestation) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Attestation object

func (*Attestation) UnmarshalSSZ

func (a *Attestation) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Attestation object

type AttestationData

type AttestationData struct {
	Slot      uint64      `json:"slot,string"`
	Index     uint64      `json:"index,string"`
	BlockRoot Root        `json:"beacon_block_root" ssz-size:"32"`
	Source    *Checkpoint `json:"source"`
	Target    *Checkpoint `json:"target"`
}

AttestationData https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#attestationdata

func (*AttestationData) HashTreeRoot

func (a *AttestationData) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the AttestationData object

func (*AttestationData) HashTreeRootWith

func (a *AttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the AttestationData object with a hasher

func (*AttestationData) MarshalSSZ

func (a *AttestationData) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the AttestationData object

func (*AttestationData) MarshalSSZTo

func (a *AttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the AttestationData object to a target array

func (*AttestationData) SizeSSZ

func (a *AttestationData) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the AttestationData object

func (*AttestationData) UnmarshalSSZ

func (a *AttestationData) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the AttestationData object

type AttesterSlashing

type AttesterSlashing struct {
	A *IndexedAttestation `json:"attestation_1"`
	B *IndexedAttestation `json:"attestation_2"`
}

AttesterSlashing https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#attesterslashing

func (*AttesterSlashing) HashTreeRoot

func (a *AttesterSlashing) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the AttesterSlashing object

func (*AttesterSlashing) HashTreeRootWith

func (a *AttesterSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the AttesterSlashing object with a hasher

func (*AttesterSlashing) MarshalSSZ

func (a *AttesterSlashing) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the AttesterSlashing object

func (*AttesterSlashing) MarshalSSZTo

func (a *AttesterSlashing) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the AttesterSlashing object to a target array

func (*AttesterSlashing) SizeSSZ

func (a *AttesterSlashing) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the AttesterSlashing object

func (*AttesterSlashing) UnmarshalSSZ

func (a *AttesterSlashing) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the AttesterSlashing object

type BeaconBlockHeader

type BeaconBlockHeader struct {
	Slot          uint64 `json:"slot,string"`
	ProposerIndex uint64 `json:"proposer_index,string"`
	ParentRoot    Root   `json:"parent_root" ssz-size:"32"`
	StateRoot     Root   `json:"state_root" ssz-size:"32"`
	BodyRoot      Root   `json:"body_root" ssz-size:"32"`
}

BeaconBlockHeader https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beaconblockheader

func (*BeaconBlockHeader) HashTreeRoot

func (b *BeaconBlockHeader) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the BeaconBlockHeader object

func (*BeaconBlockHeader) HashTreeRootWith

func (b *BeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the BeaconBlockHeader object with a hasher

func (*BeaconBlockHeader) MarshalSSZ

func (b *BeaconBlockHeader) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the BeaconBlockHeader object

func (*BeaconBlockHeader) MarshalSSZTo

func (b *BeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the BeaconBlockHeader object to a target array

func (*BeaconBlockHeader) SizeSSZ

func (b *BeaconBlockHeader) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockHeader object

func (*BeaconBlockHeader) UnmarshalSSZ

func (b *BeaconBlockHeader) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the BeaconBlockHeader object

type BlindedBeaconBlock

type BlindedBeaconBlock struct {
	Slot          uint64                  `json:"slot,string"`
	ProposerIndex uint64                  `json:"proposer_index,string"`
	ParentRoot    Root                    `json:"parent_root" ssz-size:"32"`
	StateRoot     Root                    `json:"state_root" ssz-size:"32"`
	Body          *BlindedBeaconBlockBody `json:"body"`
}

BlindedBeaconBlock https://github.com/ethereum/beacon-APIs/blob/master/types/bellatrix/block.yaml#L74

func (*BlindedBeaconBlock) HashTreeRoot

func (b *BlindedBeaconBlock) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the BlindedBeaconBlock object

func (*BlindedBeaconBlock) HashTreeRootWith

func (b *BlindedBeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the BlindedBeaconBlock object with a hasher

func (*BlindedBeaconBlock) MarshalSSZ

func (b *BlindedBeaconBlock) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the BlindedBeaconBlock object

func (*BlindedBeaconBlock) MarshalSSZTo

func (b *BlindedBeaconBlock) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the BlindedBeaconBlock object to a target array

func (*BlindedBeaconBlock) SizeSSZ

func (b *BlindedBeaconBlock) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlock object

func (*BlindedBeaconBlock) UnmarshalSSZ

func (b *BlindedBeaconBlock) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the BlindedBeaconBlock object

type BlindedBeaconBlockBody

type BlindedBeaconBlockBody struct {
	RandaoReveal           Signature               `json:"randao_reveal" ssz-size:"96"`
	Eth1Data               *Eth1Data               `json:"eth1_data"`
	Graffiti               Hash                    `json:"graffiti" ssz-size:"32"`
	ProposerSlashings      []*ProposerSlashing     `json:"proposer_slashings" ssz-max:"16"`
	AttesterSlashings      []*AttesterSlashing     `json:"attester_slashings" ssz-max:"2"`
	Attestations           []*Attestation          `json:"attestations" ssz-max:"128"`
	Deposits               []*Deposit              `json:"deposits" ssz-max:"16"`
	VoluntaryExits         []*VoluntaryExit        `json:"voluntary_exits" ssz-max:"16"`
	SyncAggregate          *SyncAggregate          `json:"sync_aggregate"`
	ExecutionPayloadHeader *ExecutionPayloadHeader `json:"execution_payload_header"`
}

BlindedBeaconBlockBody https://github.com/ethereum/beacon-APIs/blob/master/types/bellatrix/block.yaml#L65

func (*BlindedBeaconBlockBody) HashTreeRoot

func (b *BlindedBeaconBlockBody) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the BlindedBeaconBlockBody object

func (*BlindedBeaconBlockBody) HashTreeRootWith

func (b *BlindedBeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the BlindedBeaconBlockBody object with a hasher

func (*BlindedBeaconBlockBody) MarshalSSZ

func (b *BlindedBeaconBlockBody) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the BlindedBeaconBlockBody object

func (*BlindedBeaconBlockBody) MarshalSSZTo

func (b *BlindedBeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the BlindedBeaconBlockBody object to a target array

func (*BlindedBeaconBlockBody) SizeSSZ

func (b *BlindedBeaconBlockBody) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBody object

func (*BlindedBeaconBlockBody) UnmarshalSSZ

func (b *BlindedBeaconBlockBody) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBody object

type Bloom

type Bloom [256]byte

func (*Bloom) FromSlice

func (b *Bloom) FromSlice(x []byte)

func (Bloom) MarshalText

func (b Bloom) MarshalText() ([]byte, error)

func (Bloom) String

func (b Bloom) String() string

func (*Bloom) UnmarshalJSON

func (b *Bloom) UnmarshalJSON(input []byte) error

func (*Bloom) UnmarshalText

func (b *Bloom) UnmarshalText(input []byte) error

type BuilderBid

type BuilderBid struct {
	Header *ExecutionPayloadHeader `json:"header"`
	Value  U256Str                 `json:"value" ssz-size:"32"`
	Pubkey PublicKey               `json:"pubkey" ssz-size:"48"`
}

BuilderBid https://github.com/ethereum/builder-specs/pull/2/files#diff-b37cbf48e8754483e30e7caaadc5defc8c3c6e1aaf3273ee188d787b7c75d993

func (*BuilderBid) HashTreeRoot

func (b *BuilderBid) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the BuilderBid object

func (*BuilderBid) HashTreeRootWith

func (b *BuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the BuilderBid object with a hasher

func (*BuilderBid) MarshalSSZ

func (b *BuilderBid) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the BuilderBid object

func (*BuilderBid) MarshalSSZTo

func (b *BuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the BuilderBid object to a target array

func (*BuilderBid) SizeSSZ

func (b *BuilderBid) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the BuilderBid object

func (*BuilderBid) UnmarshalSSZ

func (b *BuilderBid) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the BuilderBid object

type Checkpoint

type Checkpoint struct {
	Epoch uint64 `json:"epoch,string"`
	Root  Root   `json:"root" ssz-size:"32"`
}

Checkpoint ...

func (*Checkpoint) HashTreeRoot

func (c *Checkpoint) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Checkpoint object

func (*Checkpoint) HashTreeRootWith

func (c *Checkpoint) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the Checkpoint object with a hasher

func (*Checkpoint) MarshalSSZ

func (c *Checkpoint) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Checkpoint object

func (*Checkpoint) MarshalSSZTo

func (c *Checkpoint) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Checkpoint object to a target array

func (*Checkpoint) SizeSSZ

func (c *Checkpoint) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Checkpoint object

func (*Checkpoint) UnmarshalSSZ

func (c *Checkpoint) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Checkpoint object

type CommitteeBits

type CommitteeBits [64]byte

func (*CommitteeBits) FromSlice

func (c *CommitteeBits) FromSlice(x []byte)

func (CommitteeBits) MarshalText

func (c CommitteeBits) MarshalText() ([]byte, error)

func (CommitteeBits) String

func (c CommitteeBits) String() string

func (*CommitteeBits) UnmarshalJSON

func (c *CommitteeBits) UnmarshalJSON(input []byte) error

func (*CommitteeBits) UnmarshalText

func (c *CommitteeBits) UnmarshalText(input []byte) error

type Deposit

type Deposit struct {
	Pubkey                PublicKey `json:"pubkey" ssz-size:"48"`
	WithdrawalCredentials Hash      `json:"withdrawal_credentials" ssz-size:"32"`
	Amount                uint64    `json:"amount,string"`
	Signature             Signature `json:"signature" ssz-size:"96"`
}

Deposit https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#deposit

func (*Deposit) HashTreeRoot

func (d *Deposit) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Deposit object

func (*Deposit) HashTreeRootWith

func (d *Deposit) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the Deposit object with a hasher

func (*Deposit) MarshalSSZ

func (d *Deposit) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Deposit object

func (*Deposit) MarshalSSZTo

func (d *Deposit) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Deposit object to a target array

func (*Deposit) SizeSSZ

func (d *Deposit) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Deposit object

func (*Deposit) UnmarshalSSZ

func (d *Deposit) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Deposit object

type Domain

type Domain [32]byte

type DomainType

type DomainType [4]byte

type Eth1Data

type Eth1Data struct {
	DepositRoot  Root   `json:"deposit_root" ssz-size:"32"`
	DepositCount uint64 `json:"deposit_count,string"`
	BlockHash    Hash   `json:"block_hash" ssz-size:"32"`
}

Eth1Data https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#eth1data

func (*Eth1Data) HashTreeRoot

func (e *Eth1Data) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Eth1Data object

func (*Eth1Data) HashTreeRootWith

func (e *Eth1Data) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the Eth1Data object with a hasher

func (*Eth1Data) MarshalSSZ

func (e *Eth1Data) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Eth1Data object

func (*Eth1Data) MarshalSSZTo

func (e *Eth1Data) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Eth1Data object to a target array

func (*Eth1Data) SizeSSZ

func (e *Eth1Data) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Eth1Data object

func (*Eth1Data) UnmarshalSSZ

func (e *Eth1Data) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Eth1Data object

type ExecutionPayload

type ExecutionPayload struct {
	ParentHash    Hash            `json:"parent_hash" ssz-size:"32"`
	FeeRecipient  Address         `json:"fee_recipient" ssz-size:"20"`
	StateRoot     Root            `json:"state_root" ssz-size:"32"`
	ReceiptsRoot  Root            `json:"receipts_root" ssz-size:"32"`
	LogsBloom     Bloom           `json:"logs_bloom" ssz-size:"256"`
	Random        Hash            `json:"prev_randao" ssz-size:"32"`
	BlockNumber   uint64          `json:"block_number,string"`
	GasLimit      uint64          `json:"gas_limit,string"`
	GasUsed       uint64          `json:"gas_used,string"`
	Timestamp     uint64          `json:"timestamp,string"`
	ExtraData     hexutil.Bytes   `json:"extra_data" ssz-max:"32"`
	BaseFeePerGas U256Str         `json:"base_fee_per_gas" ssz-max:"32"`
	BlockHash     Hash            `json:"block_hash" ssz-size:"32"`
	Transactions  []hexutil.Bytes `json:"transactions" ssz-max:"1048576,1073741824" ssz-size:"?,?"`
}

ExecutionPayload https://github.com/ethereum/consensus-specs/blob/dev/specs/bellatrix/beacon-chain.md#executionpayload

type ExecutionPayloadHeader

type ExecutionPayloadHeader struct {
	ParentHash       Hash      `json:"parent_hash" ssz-size:"32"`
	FeeRecipient     Address   `json:"fee_recipient" ssz-size:"20"`
	StateRoot        Root      `json:"state_root" ssz-size:"32"`
	ReceiptsRoot     Root      `json:"receipts_root" ssz-size:"32"`
	LogsBloom        Bloom     `json:"logs_bloom" ssz-size:"256"`
	Random           Hash      `json:"prev_randao" ssz-size:"32"`
	BlockNumber      uint64    `json:"block_number,string"`
	GasLimit         uint64    `json:"gas_limit,string"`
	GasUsed          uint64    `json:"gas_used,string"`
	Timestamp        uint64    `json:"timestamp,string"`
	ExtraData        ExtraData `json:"extra_data" ssz-max:"32"`
	BaseFeePerGas    U256Str   `json:"base_fee_per_gas" ssz-size:"32"`
	BlockHash        Hash      `json:"block_hash" ssz-size:"32"`
	TransactionsRoot Root      `json:"transactions_root" ssz-size:"32"`
}

ExecutionPayloadHeader https://github.com/ethereum/consensus-specs/blob/dev/specs/bellatrix/beacon-chain.md#executionpayloadheader

func (*ExecutionPayloadHeader) HashTreeRoot

func (e *ExecutionPayloadHeader) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the ExecutionPayloadHeader object

func (*ExecutionPayloadHeader) HashTreeRootWith

func (e *ExecutionPayloadHeader) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the ExecutionPayloadHeader object with a hasher

func (*ExecutionPayloadHeader) MarshalSSZ

func (e *ExecutionPayloadHeader) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the ExecutionPayloadHeader object

func (*ExecutionPayloadHeader) MarshalSSZTo

func (e *ExecutionPayloadHeader) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the ExecutionPayloadHeader object to a target array

func (*ExecutionPayloadHeader) SizeSSZ

func (e *ExecutionPayloadHeader) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeader object

func (*ExecutionPayloadHeader) UnmarshalSSZ

func (e *ExecutionPayloadHeader) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the ExecutionPayloadHeader object

type ExtraData

type ExtraData []byte

func (*ExtraData) FromSlice

func (e *ExtraData) FromSlice(x []byte)

func (ExtraData) MarshalText

func (e ExtraData) MarshalText() ([]byte, error)

func (ExtraData) String

func (e ExtraData) String() string

func (*ExtraData) UnmarshalJSON

func (e *ExtraData) UnmarshalJSON(input []byte) error

func (*ExtraData) UnmarshalText

func (e *ExtraData) UnmarshalText(input []byte) error

type ForkVersion

type ForkVersion [4]byte

type GetHeaderResponse

type GetHeaderResponse struct {
	Version string            `json:"version"`
	Data    *SignedBuilderBid `json:"data"`
}

GetHeaderResponse is the response payload from the getHeader request: https://github.com/ethereum/builder-specs/pull/2/files#diff-c80f52e38c99b1049252a99215450a29fd248d709ffd834a9480c98a233bf32c

type GetPayloadResponse

type GetPayloadResponse struct {
	Version string            `json:"version"`
	Data    *ExecutionPayload `json:"data"`
}

GetPayloadResponse is the response payload from the getPayload request: https://github.com/ethereum/builder-specs/pull/2/files#diff-8446716b376f3ffe88737f9773ce2ff21adc2bc0f2c9a140dcc2e9d632091ba4

type Hash

type Hash [32]byte

func (*Hash) FromSlice

func (h *Hash) FromSlice(x []byte)

func (Hash) MarshalText

func (h Hash) MarshalText() ([]byte, error)

func (Hash) String

func (h Hash) String() string

func (*Hash) UnmarshalJSON

func (h *Hash) UnmarshalJSON(input []byte) error

func (*Hash) UnmarshalText

func (h *Hash) UnmarshalText(input []byte) error

type HashTreeRoot

type HashTreeRoot interface {
	HashTreeRoot() ([32]byte, error)
}

type IndexedAttestation

type IndexedAttestation struct {
	AttestingIndices []uint64         `json:"attesting_indices" ssz-max:"2048"` // MAX_VALIDATORS_PER_COMMITTEE
	Data             *AttestationData `json:"data"`
	Signature        Signature        `json:"signature" ssz-size:"96"`
}

IndexedAttestation https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#indexedattestation

func (*IndexedAttestation) HashTreeRoot

func (i *IndexedAttestation) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the IndexedAttestation object

func (*IndexedAttestation) HashTreeRootWith

func (i *IndexedAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the IndexedAttestation object with a hasher

func (*IndexedAttestation) MarshalSSZ

func (i *IndexedAttestation) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the IndexedAttestation object

func (*IndexedAttestation) MarshalSSZTo

func (i *IndexedAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the IndexedAttestation object to a target array

func (*IndexedAttestation) SizeSSZ

func (i *IndexedAttestation) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the IndexedAttestation object

func (*IndexedAttestation) UnmarshalSSZ

func (i *IndexedAttestation) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the IndexedAttestation object

type ProposerSlashing

type ProposerSlashing struct {
	A *SignedBeaconBlockHeader `json:"signed_header_1"`
	B *SignedBeaconBlockHeader `json:"signed_header_2"`
}

ProposerSlashing https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#proposerslashing

func (*ProposerSlashing) HashTreeRoot

func (p *ProposerSlashing) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the ProposerSlashing object

func (*ProposerSlashing) HashTreeRootWith

func (p *ProposerSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the ProposerSlashing object with a hasher

func (*ProposerSlashing) MarshalSSZ

func (p *ProposerSlashing) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the ProposerSlashing object

func (*ProposerSlashing) MarshalSSZTo

func (p *ProposerSlashing) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the ProposerSlashing object to a target array

func (*ProposerSlashing) SizeSSZ

func (p *ProposerSlashing) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the ProposerSlashing object

func (*ProposerSlashing) UnmarshalSSZ

func (p *ProposerSlashing) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the ProposerSlashing object

type PublicKey

type PublicKey [48]byte

func HexToPubkey

func HexToPubkey(s string) (ret PublicKey, err error)

HexToPubkey takes a hex string and returns a PublicKey

func (*PublicKey) FromSlice

func (p *PublicKey) FromSlice(x []byte)

func (PublicKey) MarshalText

func (p PublicKey) MarshalText() ([]byte, error)

func (PublicKey) String

func (p PublicKey) String() string

func (*PublicKey) UnmarshalJSON

func (p *PublicKey) UnmarshalJSON(input []byte) error

func (*PublicKey) UnmarshalText

func (p *PublicKey) UnmarshalText(input []byte) error

type RegisterValidatorRequestMessage

type RegisterValidatorRequestMessage struct {
	FeeRecipient Address   `json:"fee_recipient" ssz-size:"20"` // type was Address
	GasLimit     uint64    `json:"gas_limit,string"`
	Timestamp    uint64    `json:"timestamp,string"`
	Pubkey       PublicKey `json:"pubkey" ssz-size:"48"` // type was PublicKey
}

RegisterValidatorRequestMessage https://github.com/ethereum/beacon-APIs/blob/master/types/registration.yaml

func (*RegisterValidatorRequestMessage) HashTreeRoot

func (r *RegisterValidatorRequestMessage) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the RegisterValidatorRequestMessage object

func (*RegisterValidatorRequestMessage) HashTreeRootWith

func (r *RegisterValidatorRequestMessage) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the RegisterValidatorRequestMessage object with a hasher

func (*RegisterValidatorRequestMessage) MarshalSSZ

func (r *RegisterValidatorRequestMessage) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the RegisterValidatorRequestMessage object

func (*RegisterValidatorRequestMessage) MarshalSSZTo

func (r *RegisterValidatorRequestMessage) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the RegisterValidatorRequestMessage object to a target array

func (*RegisterValidatorRequestMessage) SizeSSZ

func (r *RegisterValidatorRequestMessage) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the RegisterValidatorRequestMessage object

func (*RegisterValidatorRequestMessage) UnmarshalSSZ

func (r *RegisterValidatorRequestMessage) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the RegisterValidatorRequestMessage object

type Root

type Root = Hash

type Signature

type Signature [96]byte

func HexToSignature

func HexToSignature(s string) (ret Signature, err error)

HexToSignature takes a hex string and returns a Signature

func SignMessage

func SignMessage(obj HashTreeRoot, d Domain, sk *bls.SecretKey) (Signature, error)

func (*Signature) FromSlice

func (s *Signature) FromSlice(x []byte)

func (Signature) MarshalText

func (s Signature) MarshalText() ([]byte, error)

func (Signature) String

func (s Signature) String() string

func (*Signature) UnmarshalJSON

func (s *Signature) UnmarshalJSON(input []byte) error

func (*Signature) UnmarshalText

func (s *Signature) UnmarshalText(input []byte) error

type SignedBeaconBlockHeader

type SignedBeaconBlockHeader struct {
	Header    *BeaconBlockHeader `json:"message"`
	Signature Signature          `json:"signature" ssz-size:"96"`
}

SignedBeaconBlockHeader https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#signedbeaconblockheader

func (*SignedBeaconBlockHeader) HashTreeRoot

func (s *SignedBeaconBlockHeader) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the SignedBeaconBlockHeader object

func (*SignedBeaconBlockHeader) HashTreeRootWith

func (s *SignedBeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the SignedBeaconBlockHeader object with a hasher

func (*SignedBeaconBlockHeader) MarshalSSZ

func (s *SignedBeaconBlockHeader) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the SignedBeaconBlockHeader object

func (*SignedBeaconBlockHeader) MarshalSSZTo

func (s *SignedBeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the SignedBeaconBlockHeader object to a target array

func (*SignedBeaconBlockHeader) SizeSSZ

func (s *SignedBeaconBlockHeader) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockHeader object

func (*SignedBeaconBlockHeader) UnmarshalSSZ

func (s *SignedBeaconBlockHeader) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the SignedBeaconBlockHeader object

type SignedBlindedBeaconBlock

type SignedBlindedBeaconBlock struct {
	Message   *BlindedBeaconBlock `json:"message"`
	Signature Signature           `json:"signature"`
}

SignedBlindedBeaconBlock https://github.com/ethereum/beacon-APIs/blob/master/types/bellatrix/block.yaml#L83

type SignedBuilderBid

type SignedBuilderBid struct {
	Message   *BuilderBid `json:"message"`
	Signature Signature   `json:"signature"`
}

SignedBuilderBid https://github.com/ethereum/builder-specs/pull/2/files#diff-b37cbf48e8754483e30e7caaadc5defc8c3c6e1aaf3273ee188d787b7c75d993

func (*SignedBuilderBid) HashTreeRoot

func (s *SignedBuilderBid) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the SignedBuilderBid object

func (*SignedBuilderBid) HashTreeRootWith

func (s *SignedBuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the SignedBuilderBid object with a hasher

func (*SignedBuilderBid) MarshalSSZ

func (s *SignedBuilderBid) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the SignedBuilderBid object

func (*SignedBuilderBid) MarshalSSZTo

func (s *SignedBuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the SignedBuilderBid object to a target array

func (*SignedBuilderBid) SizeSSZ

func (s *SignedBuilderBid) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the SignedBuilderBid object

func (*SignedBuilderBid) UnmarshalSSZ

func (s *SignedBuilderBid) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the SignedBuilderBid object

type SignedValidatorRegistration

type SignedValidatorRegistration struct {
	Message   *RegisterValidatorRequestMessage `json:"message"`
	Signature Signature                        `json:"signature"`
}

SignedValidatorRegistration https://github.com/ethereum/beacon-APIs/blob/master/types/registration.yaml#L18

type SigningData

type SigningData struct {
	Root   Root   `ssz-size:"32"`
	Domain Domain `ssz-size:"32"`
}

func (*SigningData) HashTreeRoot

func (s *SigningData) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the SigningData object

func (*SigningData) HashTreeRootWith

func (s *SigningData) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the SigningData object with a hasher

func (*SigningData) MarshalSSZ

func (s *SigningData) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the SigningData object

func (*SigningData) MarshalSSZTo

func (s *SigningData) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the SigningData object to a target array

func (*SigningData) SizeSSZ

func (s *SigningData) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the SigningData object

func (*SigningData) UnmarshalSSZ

func (s *SigningData) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the SigningData object

type SyncAggregate

type SyncAggregate struct {
	CommitteeBits      CommitteeBits `json:"sync_committee_bits" ssz-size:"64"`
	CommitteeSignature Signature     `json:"sync_committee_signature" ssz-size:"96"`
}

SyncAggregate ...

func (*SyncAggregate) HashTreeRoot

func (s *SyncAggregate) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the SyncAggregate object

func (*SyncAggregate) HashTreeRootWith

func (s *SyncAggregate) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the SyncAggregate object with a hasher

func (*SyncAggregate) MarshalSSZ

func (s *SyncAggregate) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the SyncAggregate object

func (*SyncAggregate) MarshalSSZTo

func (s *SyncAggregate) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the SyncAggregate object to a target array

func (*SyncAggregate) SizeSSZ

func (s *SyncAggregate) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the SyncAggregate object

func (*SyncAggregate) UnmarshalSSZ

func (s *SyncAggregate) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the SyncAggregate object

type Transactions added in v0.2.0

type Transactions struct {
	Transactions [][]byte `ssz-max:"1048576,1073741824" ssz-size:"?,?"`
}

func (*Transactions) HashTreeRoot added in v0.2.0

func (t *Transactions) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Transactions object

func (*Transactions) HashTreeRootWith added in v0.2.0

func (t *Transactions) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the Transactions object with a hasher

func (*Transactions) MarshalSSZ added in v0.2.0

func (t *Transactions) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Transactions object

func (*Transactions) MarshalSSZTo added in v0.2.0

func (t *Transactions) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Transactions object to a target array

func (*Transactions) SizeSSZ added in v0.2.0

func (t *Transactions) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Transactions object

func (*Transactions) UnmarshalSSZ added in v0.2.0

func (t *Transactions) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Transactions object

type U256Str

type U256Str Hash // encodes/decodes to string, not hex

func IntToU256

func IntToU256(i uint64) (ret U256Str)

func (*U256Str) BigInt added in v0.2.0

func (n *U256Str) BigInt() *big.Int

func (*U256Str) Cmp

func (n *U256Str) Cmp(b *U256Str) int

Cmp compares one U256Str to another and returns an integer indicating whether a > b. The result will be 0 if a == b, -1 if a < b, and +1 if a > b.

func (*U256Str) FromBig added in v0.2.0

func (n *U256Str) FromBig(x *big.Int) *U256Str

func (*U256Str) FromSlice

func (n *U256Str) FromSlice(x []byte)

func (U256Str) MarshalText

func (n U256Str) MarshalText() ([]byte, error)

func (*U256Str) String

func (n *U256Str) String() string

func (*U256Str) UnmarshalJSON

func (n *U256Str) UnmarshalJSON(input []byte) error

func (*U256Str) UnmarshalText

func (n *U256Str) UnmarshalText(input []byte) error

type VoluntaryExit

type VoluntaryExit struct {
	Epoch          uint64 `json:"epoch,string"`
	ValidatorIndex uint64 `json:"validator_index,string"`
}

VoluntaryExit https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#voluntaryexit

func (*VoluntaryExit) HashTreeRoot

func (v *VoluntaryExit) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the VoluntaryExit object

func (*VoluntaryExit) HashTreeRootWith

func (v *VoluntaryExit) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the VoluntaryExit object with a hasher

func (*VoluntaryExit) MarshalSSZ

func (v *VoluntaryExit) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the VoluntaryExit object

func (*VoluntaryExit) MarshalSSZTo

func (v *VoluntaryExit) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the VoluntaryExit object to a target array

func (*VoluntaryExit) SizeSSZ

func (v *VoluntaryExit) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the VoluntaryExit object

func (*VoluntaryExit) UnmarshalSSZ

func (v *VoluntaryExit) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the VoluntaryExit object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL