executor

package
Version: v1.65.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListDESC     = int32(0)   // list降序
	ListASC      = int32(1)   // list升序
	DefaultCount = int32(20)  // 默认一次取多少条记录
	MaxCount     = int32(100) // 最多取100条
)

List control

View Source
const (
	DefaultDebtCeiling      = 100000          // 默认借贷限额
	DefaultLiquidationRatio = 0.25 * 1e4      // 默认质押比
	DefaultPeriod           = 3600 * 24 * 365 // 默认合约限期
	PriceWarningRate        = 1.3 * 1e4       // 价格提前预警率
	ExpireWarningTime       = 3600 * 24 * 10  // 提前10天超时预警
)

setting

Variables

This section is empty.

Functions

func AddrKey

func AddrKey() (key []byte)

AddrKey for IssuanceAddrConfig

func GetName

func GetName() string

GetName for Issuance

func Init

func Init(name string, cfg *types.Chain33Config, sub []byte)

Init issuance

func InitExecType

func InitExecType()

InitExecType ...

func Key

func Key(id string) (key []byte)

Key for Issuance

func PriceKey

func PriceKey() (key []byte)

PriceKey for IssuancePriceFeed

Types

type Action

type Action struct {
	Issuance *Issuance
	// contains filtered or unexported fields
}

Action struct

func NewIssuanceAction

func NewIssuanceAction(c *Issuance, tx *types.Transaction, index int) *Action

NewIssuanceAction generate New Action

func (*Action) CheckExecAccountBalance

func (action *Action) CheckExecAccountBalance(fromAddr string, ToFrozen, ToActive int64) bool

CheckExecAccountBalance 检查账户抵押物余额

func (*Action) CheckExecTokenAccount

func (action *Action) CheckExecTokenAccount(addr string, amount int64, isFrozen bool) bool

CheckExecTokenAccount 检查账户token余额

func (*Action) GetCloseReceiptLog

func (action *Action) GetCloseReceiptLog(issuance *pty.Issuance) *types.ReceiptLog

GetCloseReceiptLog generate logs for Issuance close action

func (*Action) GetCreateReceiptLog

func (action *Action) GetCreateReceiptLog(issuance *pty.Issuance) *types.ReceiptLog

GetCreateReceiptLog generate logs for Issuance create action

func (*Action) GetDebtReceiptLog

func (action *Action) GetDebtReceiptLog(issuance *pty.Issuance, debtRecord *pty.DebtRecord) *types.ReceiptLog

GetDebtReceiptLog generate logs for Issuance debt action

func (*Action) GetFeedReceiptLog

func (action *Action) GetFeedReceiptLog(issuance *pty.Issuance, debtRecord *pty.DebtRecord) *types.ReceiptLog

GetFeedReceiptLog generate logs for Issuance price feed action

func (*Action) GetIndex

func (action *Action) GetIndex() int64

GetIndex returns index in block

func (*Action) GetRepayReceiptLog

func (action *Action) GetRepayReceiptLog(issuance *pty.Issuance, debtRecord *pty.DebtRecord) *types.ReceiptLog

GetRepayReceiptLog generate logs for Issuance Repay action

func (*Action) IssuanceClose

func (action *Action) IssuanceClose(close *pty.IssuanceClose) (*types.Receipt, error)

IssuanceClose 终止借贷

func (*Action) IssuanceCreate

func (action *Action) IssuanceCreate(create *pty.IssuanceCreate) (*types.Receipt, error)

IssuanceCreate 创建借贷,持有一定数量ccny的用户可创建借贷,提供给其他用户借贷

func (*Action) IssuanceDebt

func (action *Action) IssuanceDebt(debt *pty.IssuanceDebt) (*types.Receipt, error)

IssuanceDebt 大户质押bty借出ccny

func (*Action) IssuanceFeed

func (action *Action) IssuanceFeed(feed *pty.IssuanceFeed) (*types.Receipt, error)

IssuanceFeed 喂价

func (*Action) IssuanceManage

func (action *Action) IssuanceManage(manage *pty.IssuanceManage) (*types.Receipt, error)

IssuanceManage 设置全局借贷参数(管理员权限)

func (*Action) IssuanceRepay

func (action *Action) IssuanceRepay(repay *pty.IssuanceRepay) (*types.Receipt, error)

IssuanceRepay 用户主动清算

type Issuance

type Issuance struct {
	drivers.DriverBase
}

Issuance driver

func (*Issuance) CheckReceiptExecOk

func (c *Issuance) CheckReceiptExecOk() bool

CheckReceiptExecOk return true to check if receipt ty is ok

func (*Issuance) ExecDelLocal_Close

func (c *Issuance) ExecDelLocal_Close(payload *pty.IssuanceClose, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Close Action

func (*Issuance) ExecDelLocal_Create

func (c *Issuance) ExecDelLocal_Create(payload *pty.IssuanceCreate, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Create Action

func (*Issuance) ExecDelLocal_Debt

func (c *Issuance) ExecDelLocal_Debt(payload *pty.IssuanceDebt, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Debt Action

func (*Issuance) ExecDelLocal_Feed

func (c *Issuance) ExecDelLocal_Feed(payload *pty.IssuanceFeed, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Feed Action

func (*Issuance) ExecDelLocal_Manage

func (c *Issuance) ExecDelLocal_Manage(payload *pty.IssuanceManage, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Manage Action

func (*Issuance) ExecDelLocal_Repay

func (c *Issuance) ExecDelLocal_Repay(payload *pty.IssuanceRepay, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Repay Action

func (*Issuance) ExecLocal_Close

func (c *Issuance) ExecLocal_Close(payload *pty.IssuanceClose, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Close Action

func (*Issuance) ExecLocal_Create

func (c *Issuance) ExecLocal_Create(payload *pty.IssuanceCreate, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Create Action

func (*Issuance) ExecLocal_Debt

func (c *Issuance) ExecLocal_Debt(payload *pty.IssuanceDebt, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Debt Action

func (*Issuance) ExecLocal_Feed

func (c *Issuance) ExecLocal_Feed(payload *pty.IssuanceFeed, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Feed Action

func (*Issuance) ExecLocal_Manage

func (c *Issuance) ExecLocal_Manage(payload *pty.IssuanceManage, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Manage Action

func (*Issuance) ExecLocal_Repay

func (c *Issuance) ExecLocal_Repay(payload *pty.IssuanceRepay, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Repay Action

func (*Issuance) Exec_Close

func (c *Issuance) Exec_Close(payload *pty.IssuanceClose, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Close Action

func (*Issuance) Exec_Create

func (c *Issuance) Exec_Create(payload *pty.IssuanceCreate, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Create Action

func (*Issuance) Exec_Debt

func (c *Issuance) Exec_Debt(payload *pty.IssuanceDebt, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Debt Action

func (*Issuance) Exec_Feed

func (c *Issuance) Exec_Feed(payload *pty.IssuanceFeed, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Feed Action

func (*Issuance) Exec_Manage

func (c *Issuance) Exec_Manage(payload *pty.IssuanceManage, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Manage Action

func (*Issuance) Exec_Repay

func (c *Issuance) Exec_Repay(payload *pty.IssuanceRepay, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Repay Action

func (*Issuance) ExecutorOrder

func (c *Issuance) ExecutorOrder() int64

ExecutorOrder 设置localdb的EnableRead

func (*Issuance) GetDriverName

func (c *Issuance) GetDriverName() string

GetDriverName for Issuance

func (*Issuance) Query_IssuanceByStatus

func (c *Issuance) Query_IssuanceByStatus(req *pty.ReqIssuanceByStatus) (types.Message, error)

Query_IssuanceByStatus ...

func (*Issuance) Query_IssuanceInfoByID

func (c *Issuance) Query_IssuanceInfoByID(req *pty.ReqIssuanceInfo) (types.Message, error)

Query_IssuanceInfoByID ...

func (*Issuance) Query_IssuanceInfoByIDs

func (c *Issuance) Query_IssuanceInfoByIDs(req *pty.ReqIssuanceInfos) (types.Message, error)

Query_IssuanceInfoByIDs ...

func (*Issuance) Query_IssuancePrice

func (c *Issuance) Query_IssuancePrice(req *pty.ReqIssuanceRecords) (types.Message, error)

Query_IssuancePrice ...

func (*Issuance) Query_IssuanceRecordByID

func (c *Issuance) Query_IssuanceRecordByID(req *pty.ReqIssuanceRecords) (types.Message, error)

Query_IssuanceRecordByID ...

func (*Issuance) Query_IssuanceRecordsByAddr

func (c *Issuance) Query_IssuanceRecordsByAddr(req *pty.ReqIssuanceRecords) (types.Message, error)

Query_IssuanceRecordsByAddr ...

func (*Issuance) Query_IssuanceRecordsByStatus

func (c *Issuance) Query_IssuanceRecordsByStatus(req *pty.ReqIssuanceRecords) (types.Message, error)

Query_IssuanceRecordsByStatus ...

func (*Issuance) Query_IssuanceUserBalance

func (c *Issuance) Query_IssuanceUserBalance(req *pty.ReqIssuanceRecords) (types.Message, error)

Query_IssuanceUserBalance ...

type IssuanceDB

type IssuanceDB struct {
	pty.Issuance
}

IssuanceDB def

func (*IssuanceDB) GetKVSet

func (issu *IssuanceDB) GetKVSet() (kvset []*types.KeyValue)

GetKVSet for IssuanceDB

func (*IssuanceDB) Save

func (issu *IssuanceDB) Save(db dbm.KV)

Save for IssuanceDB

Jump to

Keyboard shortcuts

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