contracts

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GetContractById  = "8ba9ac6f"
	ContractMetaDate = "1e7936bd"
	RegisteContract  = "f38bbf6d"
)
View Source
const (
	GetCandidataByRanking = "ae3364a4"
	UrlReg                = "[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}:[0-9]{2,5}"
)

byte code which match to function name

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaData

type MetaData interface {

	// get contract address by contract id
	GetContractById(types.ContractType) types.Address

	// issue a proposal to update contract address
	UpdateContractAddress(uint64, types.ContractType, types.Address)

	// voteForContractProposal
	UpdateWhiteListAddress(uint64, types.Address)
}

func NewMetaDataContract

func NewMetaDataContract() MetaData

type MetaDataContract

type MetaDataContract struct {
	Address types.Address
	MetaMap map[types.ContractType]types.Address
}

func (*MetaDataContract) GetContractById

func (instance *MetaDataContract) GetContractById(contractType types.ContractType) types.Address

func (*MetaDataContract) UpdateContractAddress

func (instance *MetaDataContract) UpdateContractAddress(uint64, types.ContractType, types.Address)

func (*MetaDataContract) UpdateWhiteListAddress

func (instance *MetaDataContract) UpdateWhiteListAddress(uint64, types.Address)

type NodeInfo

type NodeInfo struct {
	Address types.Address `json:"address"     gencodec:"required"`
	Url     string        `json:"url"`
	Id      uint64        `json:"id"`
}

type Voting

type Voting interface {

	// get node num
	NodeNumber() uint64

	// get nodes list which sorted
	GetNodeList(count uint64) ([]NodeInfo, error)
}

func NewVotingContract

func NewVotingContract() Voting

type VotingContract

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

func (*VotingContract) GetNodeList

func (vote *VotingContract) GetNodeList(count uint64) ([]NodeInfo, error)

func (*VotingContract) NodeNumber

func (vote *VotingContract) NodeNumber() uint64

type WhiteList

type WhiteList interface {

	// issue a proposal to add whitelist
	IssueWhileListProposal(uint64, types.Address, uint64)

	// vote for white list proposal
	VoteForWhiteListProposal(uint64)

	// issue a proposal to update contract address
	IssueContractProposal(uint64, types.ContractType)

	// voteForContractProposal
	VoteForContractProposal(uint64)
}

Jump to

Keyboard shortcuts

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