common

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2019 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	BlockHeader
	//Transactions []*RPCTransaction `json:"transactions"`
	Transactions map[string][]*RPCTransaction `json:"transactions"`
}

func UnmarshalBlock

func UnmarshalBlock(buff []byte, fullTx bool) (*Block, error)

type BlockHeader

type BlockHeader struct {
	Number          *hexutil.Big        `json:"number"           gencodec:"required"`
	Hash            common.Hash         `json:"hash"`
	SignHash        common.Hash         `json:"signHash"`
	ParentHash      common.Hash         `json:"parentHash"       gencodec:"required"`
	Nonce           string              `json:"nonce"            gencodec:"required"`
	MixDigest       common.Hash         `json:"mixHash"          gencodec:"required"`
	UncleHash       common.Hash         `json:"sha3Uncles"`
	Uncles          []common.Hash       `json:"uncles"`
	Roots           []common.CoinRoot   `json:"stateRoot"`
	Sharding        []common.Coinbyte   `json:"sharding"`
	Coinbase        string              `json:"miner"`
	Difficulty      *hexutil.Big        `json:"difficulty"`
	TotalDifficulty *hexutil.Big        `json:"totalDifficulty"`
	Extra           hexutil.Bytes       `json:"extraData"`
	Size            hexutil.Uint64      `json:"size"`
	GasLimit        hexutil.Uint64      `json:"gasLimit"`
	GasUsed         hexutil.Uint64      `json:"gasUsed"`
	Time            *hexutil.Big        `json:"timestamp"`
	Leader          string              `json:"leader"`
	Elect           []common.Elect1     `json:"elect"`
	NetTopology     common.NetTopology1 `json:"nettopology"`
	Signatures      []common.Signature  `json:"signatures"`
	Version         hexutil.Bytes       `json:"version"`
	VrfValue        hexutil.Bytes       `json:"vrfvalue"`
}

type BlockNonce added in v1.0.2

type BlockNonce [8]byte
type BlockHeader11 struct {
	Number   *hexutil.Big `json:"number"`
	Hash     string       `json:"hash"`
	SignHash string       `json:"signHash"`
	Leader   string       `json:"leader"`
	//	Coinbase   string   `json:"miner"`
	ParentHash       string              `json:"parentHash"`
	Author           string              `json:"author,omitempty"`
	Miner            string              `json:"miner,omitempty"`
	StateRoot        string              `json:"stateRoot,omitempty"`
	TransactionsRoot string              `json:"transactionsRoot,omitempty"`
	ReceiptsRoot     string              `json:"receiptsRoot,omitempty"`
	Size             *hexutil.Big        `json:"size"`
	GasUsed          *hexutil.Big        `json:"gasUsed"`
	Nonce            string              `json:"nonce"`
	Timestamp        *hexutil.Big        `json:"timestamp"`
	Elect            *[]Elect1           `json:"elect" gencodec:"required"`
	NetTopology      *NetTopology1       `json:"nettopology"        gencodec:"required"`
	Signatures       *[]common.Signature `json:"signatures" gencodec:"required"`
	Version          hexutil.Bytes       `json:"version"`
	VrfValue         hexutil.Bytes       `json:"VrfValue"`
}

type DepositDetail

type DepositDetail struct {
	Address     string
	SignAddress string
	Deposit     *big.Int
	WithdrawH   *big.Int
	OnlineTime  *big.Int
	Role        *big.Int
}

type Elect1

type Elect1 struct {
	Account string
	Stock   uint64
	Type    common.RoleType
	VIP     common.VIPRoleType
}

type ExtraTo_Mx

type ExtraTo_Mx struct {
	To2    *common.Address `json:"to"`
	Value2 *hexutil.Big    `json:"value"`
	Input2 *hexutil.Bytes  `json:"input"`
}

type ExtraTo_Mx1

type ExtraTo_Mx1 struct {
	To2    *string        `json:"to"`
	Value2 *hexutil.Big   `json:"value"`
	Input2 *hexutil.Bytes `json:"input"`
}

type FullBlock

type FullBlock struct {
	BlockHeader
	//Transactions []*RPCTransaction `json:"transactions"`
	Transactions map[string][]*RPCTransaction `json:"transactions"`
}

type HashBlock

type HashBlock struct {
	BlockHeader
}

type ManCallArgs

type ManCallArgs struct {
	From     string         `json:"from"`
	To       *string        `json:"to"`
	Gas      hexutil.Uint64 `json:"gas"`
	GasPrice hexutil.Big    `json:"gasPrice"`
	Value    hexutil.Big    `json:"value"`
	Data     hexutil.Bytes  `json:"data"`
}

type NetTopology1

type NetTopology1 struct {
	Type            uint8
	NetTopologyData []NetTopologyData1
}

type NetTopologyData1

type NetTopologyData1 struct {
	Account  string
	Position uint16
}

type NodeInfo

type NodeInfo struct {
	Account  string `json:"account"`
	Online   bool   `json:"online"`
	Position uint16 `json:"position"`
}

type RPCBalanceType

type RPCBalanceType struct {
	AccountType uint32       `json:"accountType"`
	Balance     *hexutil.Big `json:"balance"`
}

type RPCTransaction

type RPCTransaction struct {
	BlockHash        common.Hash    `json:"blockHash"`
	BlockNumber      *hexutil.Big   `json:"blockNumber"`
	From             string         `json:"from"`
	Gas              hexutil.Uint64 `json:"gas"`
	GasPrice         *hexutil.Big   `json:"gasPrice"`
	Hash             common.Hash    `json:"hash"`
	Input            hexutil.Bytes  `json:"input"`
	Nonce            hexutil.Uint64 `json:"nonce"`
	To               *string        `json:"to"`
	TransactionIndex hexutil.Uint   `json:"transactionIndex"`
	Value            *hexutil.Big   `json:"value"`
	V                *hexutil.Big   `json:"v"`
	R                *hexutil.Big   `json:"r"`
	S                *hexutil.Big   `json:"s"`
	TxEnterType      byte           `json:"TxEnterType"`
	IsEntrustTx      bool           `json:"IsEntrustTx"`
	Currency         string         `json:"Currency"`
	CommitTime       hexutil.Uint64 `json:"CommitTime"`
	MatrixType       byte           `json:"matrixType"`
	ExtraTo          []*ExtraTo_Mx1 `json:"extra_to"`
}

type SendTxArgs

type SendTxArgs struct {
	From     common.Address  `json:"from"`
	Currency string          `json:"currency"`
	To       *common.Address `json:"to"`
	Gas      *hexutil.Uint64 `json:"gas"`
	GasPrice *hexutil.Big    `json:"gasPrice"`
	Value    *hexutil.Big    `json:"value"`
	Nonce    *hexutil.Uint64 `json:"nonce"`
	// We accept "data" and "input" for backwards-compatibility reasons. "input" is the
	// newer name and should be preferred by clients.
	Data        *hexutil.Bytes `json:"data"`
	Input       *hexutil.Bytes `json:"input"`
	V           *hexutil.Big   `json:"v"`
	R           *hexutil.Big   `json:"r"`
	S           *hexutil.Big   `json:"s"`
	TxType      byte           `json:"txType"`     //
	LockHeight  uint64         `json:"lockHeight"` //
	IsEntrustTx byte           `json:"isEntrustTx"`
	CommitTime  uint64         `json:"commitTime"`
	ExtraTo     []*ExtraTo_Mx  `json:"extra_to"` //
}

func StrArgsToByteArgs

func StrArgsToByteArgs(args1 SendTxArgs1) (args SendTxArgs, err error)

type SendTxArgs1

type SendTxArgs1 struct {
	From     string          `json:"from"`
	To       *string         `json:"to"`
	Gas      *hexutil.Uint64 `json:"gas"`
	GasPrice *hexutil.Big    `json:"gasPrice"`
	Value    *hexutil.Big    `json:"value"`
	Nonce    *hexutil.Uint64 `json:"nonce"`
	// We accept "data" and "input" for backwards-compatibility reasons. "input" is the
	// newer name and should be preferred by clients.
	Data        *hexutil.Bytes `json:"data"`
	Input       *hexutil.Bytes `json:"input"`
	V           *hexutil.Big   `json:"v"`
	R           *hexutil.Big   `json:"r"`
	S           *hexutil.Big   `json:"s"`
	Currency    *string        `json:"currency"`
	TxType      byte           `json:"txType"`     //
	LockHeight  uint64         `json:"lockHeight"` //
	IsEntrustTx byte           `json:"isEntrustTx"`
	CommitTime  uint64         `json:"commitTime"`
	ExtraTo     []*ExtraTo_Mx1 `json:"extra_to"` //
}

SendTxArgs represents the arguments to sumbit a new transaction into the transaction pool.

func (*SendTxArgs1) SetData

func (args *SendTxArgs1) SetData(input []byte)

func (*SendTxArgs1) SetDefaults

func (args *SendTxArgs1) SetDefaults() error

func (*SendTxArgs1) SetValue

func (args *SendTxArgs1) SetValue(int2 *big.Int)

func (*SendTxArgs1) ToTransaction

func (args1 *SendTxArgs1) ToTransaction() *types.Transaction

type TopologyStatus

type TopologyStatus struct {
	LeaderReelect         bool       `json:"leader_reelect"`
	Validators            []NodeInfo `json:"validators"`
	BackupValidators      []NodeInfo `json:"backup_validators"`
	Miners                []NodeInfo `json:"miners"`
	ElectValidators       []NodeInfo `json:"elect_validators"`
	ElectBackupValidators []NodeInfo `json:"elect_backup_validators"`
}

Jump to

Keyboard shortcuts

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