enterprise

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdMembershipAdd    = "add"
	CmdMembershipRemove = "remove"

	CCCommand         = "command"
	MemberAttrName    = "name"
	MemberAttrAddress = "address"
	MemberAttrPeerID  = "peerid"
	MemberAttrID      = "id"
)
View Source
const (
	RPCPermissions = "RPCPERMISSIONS"
	P2PWhite       = "P2PWHITE"
	P2PBlack       = "P2PBLACK"
	AccountWhite   = "ACCOUNTWHITE"
)
View Source
const AdminsKey = "ADMINS"
View Source
const AppendAdmin = "appendAdmin"
View Source
const AppendConf = "appendConf"
View Source
const ChangeCluster = "changeCluster"
View Source
const DisableConf = "disableConf"
View Source
const EnableConf = "enableConf"
View Source
const RemoveAdmin = "removeAdmin"
View Source
const RemoveConf = "removeConf"
View Source
const SetConf = "setConf"

Variables

View Source
var (
	ErrNotSupportedMethod                      = errors.New("Not supported Enterprise Tx")
	ErrTxEnterpriseAlreadyIncludeChangeCluster = errors.New("Enterprise Tx of Change cluster type already included in the block")
)
View Source
var ErrTxEnterpriseAdminIsNotSet = errors.New("admin is not set")

Functions

func ExecuteEnterpriseTx

func ExecuteEnterpriseTx(bs *state.BlockState, ccc consensus.ChainConsensusCluster, scs *state.ContractState, txBody *types.TxBody,
	sender, receiver *state.V, blockNo types.BlockNo) ([]*types.Event, error)

func ValidateChangeCluster

func ValidateChangeCluster(ci types.CallInfo, blockNo types.BlockNo) (interface{}, error)

Types

type AccountStateReader

type AccountStateReader interface {
	GetEnterpriseAccountState() (*state.ContractState, error)
}

AccountStateReader is an interface for getting a enterprise account state.

type CcArgument

type CcArgument map[string]interface{}

type Conf

type Conf struct {
	On     bool
	Values []string
}

func (*Conf) AppendValue

func (c *Conf) AppendValue(r string)

func (*Conf) RemoveValue

func (c *Conf) RemoveValue(r string)

func (*Conf) Validate

func (c *Conf) Validate(key []byte, context *EnterpriseContext) error

type EnterpriseContext

type EnterpriseContext struct {
	Call    *types.CallInfo
	Args    []string
	ArgsAny []interface{}
	Admins  [][]byte
	Conf    *Conf
}

func ValidateEnterpriseTx

func ValidateEnterpriseTx(tx *types.TxBody, sender *state.V,
	scs *state.ContractState, blockNo types.BlockNo) (*EnterpriseContext, error)

func (*EnterpriseContext) HasConfValue

func (e *EnterpriseContext) HasConfValue(value string) bool

func (*EnterpriseContext) IsAdminExist

func (e *EnterpriseContext) IsAdminExist(addr []byte) bool

Jump to

Keyboard shortcuts

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