governance

package
v1.28.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 2 Imported by: 9

Documentation

Index

Constants

View Source
const (
	REGISTERED = 0
	APPROVED   = 1

	GovernanceRegisting    GovernanceStatus = "registering"
	GovernanceAvailable    GovernanceStatus = "available"
	GovernanceUnavailable  GovernanceStatus = "unavailable"
	GovernanceUpdating     GovernanceStatus = "updating"
	GovernanceFreezing     GovernanceStatus = "freezing"
	GovernanceActivating   GovernanceStatus = "activating"
	GovernanceFrozen       GovernanceStatus = "frozen"
	GovernanceLogouting    GovernanceStatus = "logouting"
	GovernanceBinding      GovernanceStatus = "binding"
	GovernanceUnbinding    GovernanceStatus = "unbinding"
	GovernanceBindable     GovernanceStatus = "bindable"
	GovernanceBinded       GovernanceStatus = "binded"
	GovernanceForbidden    GovernanceStatus = "forbidden"
	GovernanceTransferring GovernanceStatus = "transferring"
	GovernancePause        GovernanceStatus = "pause"
	GovernanceTransferred  GovernanceStatus = "transferred"

	EventRegister EventType = "register"
	EventUpdate   EventType = "update"
	EventFreeze   EventType = "freeze"
	EventActivate EventType = "activate"
	EventLogout   EventType = "logout"
	EventApprove  EventType = "approve"
	EventReject   EventType = "reject"
	EventBind     EventType = "bind"
	EventUnbind   EventType = "unbind"
	EventTransfer EventType = "transfer"
	EventPause    EventType = "pause"
	EventUnpause  EventType = "unpause"
	EventCLear    EventType = "clear"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EvaluationRecord added in v1.20.0

type EvaluationRecord struct {
	Addr       string  `json:"addr"`
	Score      float64 `json:"score"`
	Desc       string  `json:"desc"`
	CreateTime int64   `json:"create_time"`
}

type EventType

type EventType string

type Governance added in v1.3.0

type Governance interface {
	// ChangeStatus changes state of object
	ChangeStatus(id, trigger, lastStatus string, extra []byte) (bool, []byte)

	// CountAvailable counts all available objects
	CountAvailable(extra []byte) (bool, []byte)

	// CountAll counts all objects including approved, rejected, registered and so on
	CountAll(extra []byte) (bool, []byte)

	// ALL returns all objects
	All(extra []byte) (interface{}, error)

	// QueryById returns object info by id
	QueryById(id string, extra []byte) (interface{}, error)

	// GovernancePre check if the object can do the event
	GovernancePre(id string, event EventType, extra []byte) (interface{}, *boltvm.BxhError)
}

type GovernanceResult added in v1.20.0

type GovernanceResult struct {
	ProposalID string `json:"proposal_id"`
	Extra      []byte `json:"extra"`
}

type GovernanceStatus

type GovernanceStatus string

type InvokeRecord added in v1.20.0

type InvokeRecord struct {
	Addr    string `json:"addr"`
	Succeed int64  `json:"succeed"`
	Failure int64  `json:"failure"`
}

type Persister added in v1.3.0

type Persister interface {
	// Caller
	Caller() string
	// Logger
	Logger() logrus.FieldLogger
	// Has judges key
	Has(key string) bool
	// Get gets value from datastore by key
	Get(key string) (bool, []byte)
	// GetObject
	GetObject(key string, ret interface{}) bool
	// Set sets k-v
	Set(key string, value []byte)
	// SetObject sets k with object v, v will be marshaled using json
	SetObject(key string, value interface{})
	// Delete deletes k-v
	Delete(key string)
	// QueryByPrefix queries object by prefix
	Query(prefix string) (bool, [][]byte)
	// GetAccount get ledger account address
	GetAccount(address string) interface{}
}

type RegisterResult added in v1.3.0

type RegisterResult struct {
	IsRegistered bool   `json:"is_registered"`
	ID           string `json:"id"`
}

Jump to

Keyboard shortcuts

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