primitives

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Created = iota
	Finished
)
View Source
const PrimitiveContractsInterfaceABI = "[]"

PrimitiveContractsInterfaceABI is the input ABI used to generate the binding from.

View Source
const PrimitiveContractsInterfaceBin = `` /* 242-byte string literal not displayed */

PrimitiveContractsInterfaceBin is the compiled bytecode used for deploying new contracts.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetMaintenance

type GetMaintenance struct {
	Backend RptPrimitiveBackend
}

func (*GetMaintenance) RequiredGas

func (c *GetMaintenance) RequiredGas(input []byte) uint64

func (*GetMaintenance) Run

func (c *GetMaintenance) Run(input []byte) ([]byte, error)

type GetProxyCount

type GetProxyCount struct {
	Backend RptPrimitiveBackend
}

GetProxyCount returns the count of transactions processed by the proxy specified by given account address

func (*GetProxyCount) RequiredGas

func (c *GetProxyCount) RequiredGas(input []byte) uint64

func (*GetProxyCount) Run

func (c *GetProxyCount) Run(input []byte) ([]byte, error)

type GetRank

type GetRank struct {
	Backend RptPrimitiveBackend
}

func (*GetRank) RequiredGas

func (c *GetRank) RequiredGas(input []byte) uint64

func (*GetRank) Run

func (c *GetRank) Run(input []byte) ([]byte, error)

type GetTxVolume

type GetTxVolume struct {
	Backend RptPrimitiveBackend
}

func (*GetTxVolume) RequiredGas

func (c *GetTxVolume) RequiredGas(input []byte) uint64

func (*GetTxVolume) Run

func (c *GetTxVolume) Run(input []byte) ([]byte, error)

type GetUploadReward

type GetUploadReward struct {
	Backend RptPrimitiveBackend
}

func (*GetUploadReward) RequiredGas

func (c *GetUploadReward) RequiredGas(input []byte) uint64

func (*GetUploadReward) Run

func (c *GetUploadReward) Run(input []byte) ([]byte, error)

type IsProxy

type IsProxy struct {
	Backend RptPrimitiveBackend
}

func (*IsProxy) RequiredGas

func (c *IsProxy) RequiredGas(input []byte) uint64

func (*IsProxy) Run

func (c *IsProxy) Run(input []byte) ([]byte, error)

type PrimitiveContractsInterface

type PrimitiveContractsInterface struct {
	PrimitiveContractsInterfaceCaller     // Read-only binding to the contract
	PrimitiveContractsInterfaceTransactor // Write-only binding to the contract
	PrimitiveContractsInterfaceFilterer   // Log filterer for contract events
}

PrimitiveContractsInterface is an auto generated Go binding around an cpchain contract.

func DeployPrimitiveContractsInterface

func DeployPrimitiveContractsInterface(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *PrimitiveContractsInterface, error)

DeployPrimitiveContractsInterface deploys a new cpchain contract, binding an instance of PrimitiveContractsInterface to it.

func NewPrimitiveContractsInterface

func NewPrimitiveContractsInterface(address common.Address, backend bind.ContractBackend) (*PrimitiveContractsInterface, error)

NewPrimitiveContractsInterface creates a new instance of PrimitiveContractsInterface, bound to a specific deployed contract.

type PrimitiveContractsInterfaceCaller

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

PrimitiveContractsInterfaceCaller is an auto generated read-only Go binding around an cpchain contract.

func NewPrimitiveContractsInterfaceCaller

func NewPrimitiveContractsInterfaceCaller(address common.Address, caller bind.ContractCaller) (*PrimitiveContractsInterfaceCaller, error)

NewPrimitiveContractsInterfaceCaller creates a new read-only instance of PrimitiveContractsInterface, bound to a specific deployed contract.

type PrimitiveContractsInterfaceCallerRaw

type PrimitiveContractsInterfaceCallerRaw struct {
	Contract *PrimitiveContractsInterfaceCaller // Generic read-only contract binding to access the raw methods on
}

PrimitiveContractsInterfaceCallerRaw is an auto generated low-level read-only Go binding around an cpchain contract.

func (*PrimitiveContractsInterfaceCallerRaw) Call

func (_PrimitiveContractsInterface *PrimitiveContractsInterfaceCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type PrimitiveContractsInterfaceCallerSession

type PrimitiveContractsInterfaceCallerSession struct {
	Contract *PrimitiveContractsInterfaceCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts                      // Call options to use throughout this session
}

PrimitiveContractsInterfaceCallerSession is an auto generated read-only Go binding around an cpchain contract, with pre-set call options.

type PrimitiveContractsInterfaceFilterer

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

PrimitiveContractsInterfaceFilterer is an auto generated log filtering Go binding around an cpchain contract events.

func NewPrimitiveContractsInterfaceFilterer

func NewPrimitiveContractsInterfaceFilterer(address common.Address, filterer bind.ContractFilterer) (*PrimitiveContractsInterfaceFilterer, error)

NewPrimitiveContractsInterfaceFilterer creates a new log filterer instance of PrimitiveContractsInterface, bound to a specific deployed contract.

type PrimitiveContractsInterfaceRaw

type PrimitiveContractsInterfaceRaw struct {
	Contract *PrimitiveContractsInterface // Generic contract binding to access the raw methods on
}

PrimitiveContractsInterfaceRaw is an auto generated low-level Go binding around an cpchain contract.

func (*PrimitiveContractsInterfaceRaw) Call

func (_PrimitiveContractsInterface *PrimitiveContractsInterfaceRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*PrimitiveContractsInterfaceRaw) Transact

func (_PrimitiveContractsInterface *PrimitiveContractsInterfaceRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*PrimitiveContractsInterfaceRaw) Transfer

func (_PrimitiveContractsInterface *PrimitiveContractsInterfaceRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type PrimitiveContractsInterfaceSession

type PrimitiveContractsInterfaceSession struct {
	Contract     *PrimitiveContractsInterface // Generic contract binding to set the session for
	CallOpts     bind.CallOpts                // Call options to use throughout this session
	TransactOpts bind.TransactOpts            // Transaction auth options to use throughout this session
}

PrimitiveContractsInterfaceSession is an auto generated Go binding around an cpchain contract, with pre-set call and transact options.

type PrimitiveContractsInterfaceTransactor

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

PrimitiveContractsInterfaceTransactor is an auto generated write-only Go binding around an cpchain contract.

func NewPrimitiveContractsInterfaceTransactor

func NewPrimitiveContractsInterfaceTransactor(address common.Address, transactor bind.ContractTransactor) (*PrimitiveContractsInterfaceTransactor, error)

NewPrimitiveContractsInterfaceTransactor creates a new write-only instance of PrimitiveContractsInterface, bound to a specific deployed contract.

type PrimitiveContractsInterfaceTransactorRaw

type PrimitiveContractsInterfaceTransactorRaw struct {
	Contract *PrimitiveContractsInterfaceTransactor // Generic write-only contract binding to access the raw methods on
}

PrimitiveContractsInterfaceTransactorRaw is an auto generated low-level write-only Go binding around an cpchain contract.

func (*PrimitiveContractsInterfaceTransactorRaw) Transact

func (_PrimitiveContractsInterface *PrimitiveContractsInterfaceTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*PrimitiveContractsInterfaceTransactorRaw) Transfer

func (_PrimitiveContractsInterface *PrimitiveContractsInterfaceTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type PrimitiveContractsInterfaceTransactorSession

type PrimitiveContractsInterfaceTransactorSession struct {
	Contract     *PrimitiveContractsInterfaceTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts                      // Transaction auth options to use throughout this session
}

PrimitiveContractsInterfaceTransactorSession is an auto generated write-only Go binding around an cpchain contract, with pre-set transact options.

type RptEvaluator

type RptEvaluator struct {
	ContractClient bind.ContractBackend
	ChainClient    *primitive_backend.ApiClient
}

func NewRptEvaluator

func NewRptEvaluator(contractClient bind.ContractBackend, chainClient *primitive_backend.ApiClient) (*RptEvaluator, error)

func (*RptEvaluator) Maintenance

func (re *RptEvaluator) Maintenance(address common.Address, number uint64) (int64, error)

leader:0,committee:1,rNode:2,nil:3

func (*RptEvaluator) ProxyInfo

func (re *RptEvaluator) ProxyInfo(address common.Address, number uint64) (int64, int64, error)

ProxyInfo func return the node is proxy or not

func (*RptEvaluator) Rank

func (re *RptEvaluator) Rank(address common.Address, number uint64) (int64, error)

Rank is the func to get rank to rpt

func (*RptEvaluator) TxVolume

func (re *RptEvaluator) TxVolume(address common.Address, number uint64) (int64, error)

TxVolume is the func to get txVolume to rpt

func (*RptEvaluator) UploadCount

func (re *RptEvaluator) UploadCount(address common.Address, number uint64) (int64, error)

UploadCount is the func to get uploadnumber to rpt

type RptPrimitiveBackend

type RptPrimitiveBackend interface {
	// Rank returns the rank for given account address at the given block number.
	Rank(address common.Address, number uint64) (int64, error)

	// TxVolume returns the transaction volumn for given account address at the given block number.
	TxVolume(address common.Address, number uint64) (int64, error)

	// Maintenance returns the maintenance score for given account address at the given block number.
	Maintenance(address common.Address, number uint64) (int64, error)

	// UploadCount returns the upload score for given account address at the given block number.
	UploadCount(address common.Address, number uint64) (int64, error)

	// ProxyInfo returns a value indicating whether the given address is proxy and the count of transactions processed
	// by the proxy at the given block number.
	ProxyInfo(address common.Address, number uint64) (isProxy int64, proxyCount int64, err error)
}

Jump to

Keyboard shortcuts

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