go-tezos: github.com/DefinitelyNotAGoat/go-tezos/block Index | Files

package block

import "github.com/DefinitelyNotAGoat/go-tezos/block"

Index

Package Files

block.go interfaces.go mocks.go

type BalanceUpdates Uses

type BalanceUpdates struct {
    Kind     string `json:"kind"`
    Contract string `json:"contract,omitempty"`
    Change   string `json:"change"`
    Category string `json:"category,omitempty"`
    Delegate string `json:"delegate,omitempty"`
    Cycle    int    `json:"cycle,omitempty"`
    Level    int    `json:"level,omitempty"`
}

BalanceUpdates is the BalanceUpdates found in the Metadata of a block returned by the Tezos RPC API.

type Block Uses

type Block struct {
    Protocol   string         `json:"protocol"`
    ChainID    string         `json:"chain_id"`
    Hash       string         `json:"hash"`
    Header     Header         `json:"header"`
    Metadata   Metadata       `json:"metadata"`
    Operations [][]Operations `json:"operations"`
}

Block is a block returned by the Tezos RPC API.

type BlockService Uses

type BlockService struct {
    // contains filtered or unexported fields
}

BlockService is a struct wrapper for all block functions

func NewBlockService Uses

func NewBlockService(tzclient tzc.TezosClient) *BlockService

NewBlockService creates a new BlockService

func (*BlockService) Get Uses

func (b *BlockService) Get(id interface{}) (Block, error)

Get returns a Block at a specific level or hash

func (*BlockService) GetHead Uses

func (b *BlockService) GetHead() (Block, error)

GetHead returns the head block

func (*BlockService) IDToString Uses

func (b *BlockService) IDToString(id interface{}) (string, error)

IDToString returns a queryable block reference for a specific level or hash

type Contents Uses

type Contents struct {
    Kind             string            `json:"kind,omitempty"`
    Source           string            `json:"source,omitempty"`
    Fee              string            `json:"fee,omitempty"`
    Counter          string            `json:"counter,omitempty"`
    GasLimit         string            `json:"gas_limit,omitempty"`
    StorageLimit     string            `json:"storage_limit,omitempty"`
    Amount           string            `json:"amount,omitempty"`
    Destination      string            `json:"destination,omitempty"`
    Delegate         string            `json:"delegate,omitempty"`
    Phk              string            `json:"phk,omitempty"`
    Secret           string            `json:"secret,omitempty"`
    Level            int               `json:"level,omitempty"`
    ManagerPublicKey string            `json:"managerPubkey,omitempty"`
    Balance          string            `json:"balance,omitempty"`
    Period           int               `json:"period,omitempty"`
    Proposal         string            `json:"proposal,omitempty"`
    Proposals        []string          `json:"proposals,omitempty"`
    Ballot           string            `json:"ballot,omitempty"`
    Metadata         *ContentsMetadata `json:"metadata,omitempty"`
}

Contents is the Contents found in a operation of a block returned by the Tezos RPC API.

type ContentsMetadata Uses

type ContentsMetadata struct {
    BalanceUpdates  []BalanceUpdates `json:"balance_updates"`
    OperationResult *OperationResult `json:"operation_result,omitempty"`
    Slots           []int            `json:"slots"`
}

ContentsMetadata is the Metadata found in the Contents in a operation of a block returned by the Tezos RPC API.

type Error Uses

type Error struct {
    Kind string `json:"kind"`
    ID   string `json:"id"`
}

Error is the Error found in the OperationResult in a metadata of operation of a block returned by the Tezos RPC API.

type Header struct {
    Level            int       `json:"level"`
    Proto            int       `json:"proto"`
    Predecessor      string    `json:"Predecessor"`
    Timestamp        time.Time `json:"timestamp"`
    ValidationPass   int       `json:"validation_pass"`
    OperationsHash   string    `json:"operations_hash"`
    Fitness          []string  `json:"fitness"`
    Context          string    `json:"context"`
    Priority         int       `json:"priority"`
    ProofOfWorkNonce string    `json:"proof_of_work_nonce"`
    Signature        string    `json:"signature"`
}

Header is a header in a block returned by the Tezos RPC API.

type Level Uses

type Level struct {
    Level                int  `json:"level"`
    LevelPosition        int  `json:"level_position"`
    Cycle                int  `json:"cycle"`
    CyclePosition        int  `json:"cycle_position"`
    VotingPeriod         int  `json:"voting_period"`
    VotingPeriodPosition int  `json:"voting_period_position"`
    ExpectedCommitment   bool `json:"expected_commitment"`
}

Level the Level found in the Metadata of a block returned by the Tezos RPC API.

type MaxOperationListLength Uses

type MaxOperationListLength struct {
    MaxSize int `json:"max_size"`
    MaxOp   int `json:"max_op,omitempty"`
}

MaxOperationListLength is the MaxOperationListLength found in the Metadata of a block returned by the Tezos RPC API.

type Metadata Uses

type Metadata struct {
    Protocol               string                   `json:"protocol"`
    NextProtocol           string                   `json:"next_protocol"`
    TestChainStatus        TestChainStatus          `json:"test_chain_status"`
    MaxOperationsTTL       int                      `json:"max_operations_ttl"`
    MaxOperationDataLength int                      `json:"max_operation_data_length"`
    MaxBlockHeaderLength   int                      `json:"max_block_header_length"`
    MaxOperationListLength []MaxOperationListLength `json:"max_operation_list_length"`
    Baker                  string                   `json:"baker"`
    Level                  Level                    `json:"level"`
    VotingPeriodKind       string                   `json:"voting_period_kind"`
    NonceHash              interface{}              `json:"nonce_hash"`
    ConsumedGas            string                   `json:"consumed_gas"`
    Deactivated            []string                 `json:"deactivated"`
    BalanceUpdates         []BalanceUpdates         `json:"balance_updates"`
}

Metadata is the Metadata in a block returned by the Tezos RPC API.

type OperationResult Uses

type OperationResult struct {
    Status      string  `json:"status"`
    ConsumedGas string  `json:"consumed_gas,omitempty"`
    Errors      []Error `json:"errors,omitempty"`
}

OperationResult is the OperationResult found in metadata of block returned by the Tezos RPC API.

type Operations Uses

type Operations struct {
    Protocol  string     `json:"protocol"`
    ChainID   string     `json:"chain_id"`
    Hash      string     `json:"hash"`
    Branch    string     `json:"branch"`
    Contents  []Contents `json:"contents"`
    Signature string     `json:"signature"`
}

Operations is the Operations found in a block returned by the Tezos RPC API.

type TestChainStatus Uses

type TestChainStatus struct {
    Status string `json:"status"`
}

TestChainStatus is the TestChainStatus found in the Metadata of a block returned by the Tezos RPC API.

type TezosBlockService Uses

type TezosBlockService interface {
    GetHead() (Block, error)
    Get(id interface{}) (Block, error)
    IDToString(id interface{}) (string, error)
}

Package block imports 5 packages (graph) and is imported by 19 packages. Updated 2019-08-01. Refresh now. Tools for package owners.