types

package
v0.0.0-...-f395faf Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: GPL-3.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const AddressLength = 20

Variables

View Source
var Crypto_name = map[int32]string{
	0: "SECP",
	1: "SM2",
}
View Source
var Crypto_value = map[string]int32{
	"SECP": 0,
	"SM2":  1,
}

Functions

This section is empty.

Types

type Block

type Block struct {
	Version int          `json:"version"`
	Hash    string       `json:"hash"`
	Header  *BlockHeader `json:"header"`
	Body    *BlockBody   `json:"body"`
}

type BlockBody

type BlockBody struct {
	Transactions []*BlockTransaction `json:"transactions"`
}

type BlockHeader

type BlockHeader struct {
	Timestamp        int64       `json:"timestamp"`
	PrevHash         string      `json:"prevHash"`
	Proof            *BlockProof `json:"proof"`
	StateRoot        string      `json:"stateRoot"`
	TransactionsRoot string      `json:"transactionsRoot"`
	ReceiptsRoot     string      `json:"receiptsRoot"`
	GasUsed          string      `json:"gasUsed"`
	Number           string      `json:"number"`
	Proposer         string      `json:"proposer"`
}

type BlockMetadata

type BlockMetadata struct {
	ChainID          uint32   `json:"chainId"`
	ChainName        string   `json:"chainName"`
	Operator         string   `json:"operator"`
	GenesisTimestamp uint64   `json:"genesisTimestamp"`
	Validators       []string `json:"validators"`
	BlockInterval    uint64   `json:"blockInterval"`
}

type BlockProof

type BlockProof struct {
	Proposal string   `json:"proposal"`
	Height   uint     `json:"height"`
	Round    uint     `json:"round"`
	Commits  []string `json:"commits"`
}

type BlockTransaction

type BlockTransaction struct {
	Hash    string `json:"hash"`
	Content string `json:"content"`
}

type Crypto

type Crypto int32
const (
	Crypto_SECP Crypto = 0
	Crypto_SM2  Crypto = 1
)

func (Crypto) EnumDescriptor

func (Crypto) EnumDescriptor() ([]byte, []int)

func (Crypto) String

func (x Crypto) String() string

type Log

type Log struct {
	Address             string   `json:"address"`
	Topics              []string `json:"topics"`
	Data                string   `json:"data"`
	BlockHash           string   `json:"blockHash"`
	BlockNumber         string   `json:"blockNumber"`
	TransactionHash     string   `json:"transactionHash"`
	TransactionIndex    string   `json:"transactionIndex"`
	LogIndex            string   `json:"logIndex"`
	TransactionLogIndex string   `json:"transactionLogIndex"`
}

type Receipt

type Receipt struct {
	TransactionHash   string `json:"transactionHash"`
	TransactionIndex  string `json:"transactionIndex"`
	BlockHash         string `json:"blockHash"`
	BlockNumber       string `json:"blockNumber"`
	CumulativeGasUsed string `json:"cumulativeGasUsed"`
	GasUsed           string `json:"gasUsed"`
	ContractAddress   string `json:"contractAddress"`
	Logs              []*Log `json:"logs"`
	Root              string `json:"root"`
	LogsBloom         string `json:"logsBloom"`
	ErrorMessage      string `json:"errorMessage"`
}

type TransactParams

type TransactParams struct {
	HexPrivateKey   string
	To              string
	Nonce           string
	ValidUntilBlock *big.Int

	Value *big.Int
	Quota *big.Int

	ChainID uint32
	Version uint32
}

TransactParams is the collection of authorization data required to create a valid CITA transaction.

type Transaction

type Transaction struct {
	To                   string   `protobuf:"bytes,1,opt,name=to" json:"to,omitempty"`
	Nonce                string   `protobuf:"bytes,2,opt,name=nonce" json:"nonce,omitempty"`
	Quota                uint64   `protobuf:"varint,3,opt,name=quota" json:"quota,omitempty"`
	ValidUntilBlock      uint64   `protobuf:"varint,4,opt,name=valid_until_block,json=validUntilBlock" json:"valid_until_block,omitempty"`
	Data                 []byte   `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
	Value                uint64   `protobuf:"varint,6,opt,name=value" json:"value,omitempty"`
	ChainId              uint32   `protobuf:"varint,7,opt,name=chain_id,json=chainId" json:"chain_id,omitempty"`
	Version              uint32   `protobuf:"varint,8,opt,name=version" json:"version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Transaction) Descriptor

func (*Transaction) Descriptor() ([]byte, []int)

func (*Transaction) GetChainId

func (m *Transaction) GetChainId() uint32

func (*Transaction) GetData

func (m *Transaction) GetData() []byte

func (*Transaction) GetNonce

func (m *Transaction) GetNonce() string

func (*Transaction) GetQuota

func (m *Transaction) GetQuota() uint64

func (*Transaction) GetTo

func (m *Transaction) GetTo() string

func (*Transaction) GetValidUntilBlock

func (m *Transaction) GetValidUntilBlock() uint64

func (*Transaction) GetValue

func (m *Transaction) GetValue() uint64

func (*Transaction) GetVersion

func (m *Transaction) GetVersion() uint32

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) Reset

func (m *Transaction) Reset()

func (*Transaction) String

func (m *Transaction) String() string

func (*Transaction) XXX_DiscardUnknown

func (m *Transaction) XXX_DiscardUnknown()

func (*Transaction) XXX_Marshal

func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Transaction) XXX_Merge

func (dst *Transaction) XXX_Merge(src proto.Message)

func (*Transaction) XXX_Size

func (m *Transaction) XXX_Size() int

func (*Transaction) XXX_Unmarshal

func (m *Transaction) XXX_Unmarshal(b []byte) error

type TransactionStatus

type TransactionStatus struct {
	Hash   string `json:"hash"`
	Status string `json:"status"`
}

type UnverifiedTransaction

type UnverifiedTransaction struct {
	Transaction          *Transaction `protobuf:"bytes,1,opt,name=transaction" json:"transaction,omitempty"`
	Signature            []byte       `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	Crypto               Crypto       `protobuf:"varint,3,opt,name=crypto,enum=proto.Crypto" json:"crypto,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*UnverifiedTransaction) Descriptor

func (*UnverifiedTransaction) Descriptor() ([]byte, []int)

func (*UnverifiedTransaction) GetCrypto

func (m *UnverifiedTransaction) GetCrypto() Crypto

func (*UnverifiedTransaction) GetSignature

func (m *UnverifiedTransaction) GetSignature() []byte

func (*UnverifiedTransaction) GetTransaction

func (m *UnverifiedTransaction) GetTransaction() *Transaction

func (*UnverifiedTransaction) ProtoMessage

func (*UnverifiedTransaction) ProtoMessage()

func (*UnverifiedTransaction) Reset

func (m *UnverifiedTransaction) Reset()

func (*UnverifiedTransaction) String

func (m *UnverifiedTransaction) String() string

func (*UnverifiedTransaction) XXX_DiscardUnknown

func (m *UnverifiedTransaction) XXX_DiscardUnknown()

func (*UnverifiedTransaction) XXX_Marshal

func (m *UnverifiedTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UnverifiedTransaction) XXX_Merge

func (dst *UnverifiedTransaction) XXX_Merge(src proto.Message)

func (*UnverifiedTransaction) XXX_Size

func (m *UnverifiedTransaction) XXX_Size() int

func (*UnverifiedTransaction) XXX_Unmarshal

func (m *UnverifiedTransaction) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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