executor

package
v1.66.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: BSD-3-Clause Imports: 12 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        = 10000           // 默认借贷限额
	DefaultLiquidationRatio   = 0.4 * 1e4       // 默认质押比
	DefaultStabilityFeeRation = 0.08 * 1e4      // 默认稳定费
	DefaultPeriod             = 3600 * 24 * 365 // 默认合约限期
	DefaultTotalBalance       = 0               // 默认放贷总额
	PriceWarningRate          = 1.3 * 1e4       // 价格提前预警率
	ExpireWarningTime         = 3600 * 24 * 10  // 提前10天超时预警
)

setting

Variables

This section is empty.

Functions

func AddrKey

func AddrKey() (key []byte)

AddrKey Key for CollateralizeAddrConfig

func ConfigKey

func ConfigKey() (key []byte)

ConfigKey Key for CollateralizeConfig

func GetName

func GetName() string

GetName for Collateralize

func Init

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

Init collateralize

func InitExecType

func InitExecType()

InitExecType ...

func Key

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

Key for Collateralize

func PriceKey

func PriceKey() (key []byte)

PriceKey Key for IssuancePriceFeed

Types

type Action

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

Action struct

func NewCollateralizeAction

func NewCollateralizeAction(c *Collateralize, tx *types.Transaction, index int) *Action

NewCollateralizeAction 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) CollateralizeAppend

func (action *Action) CollateralizeAppend(cAppend *pty.CollateralizeAppend) (*types.Receipt, error)

CollateralizeAppend 追加抵押物

func (*Action) CollateralizeBorrow

func (action *Action) CollateralizeBorrow(borrow *pty.CollateralizeBorrow) (*types.Receipt, error)

CollateralizeBorrow 用户质押bty借出ccny

func (*Action) CollateralizeCreate

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

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

func (*Action) CollateralizeFeed

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

CollateralizeFeed 喂价

func (*Action) CollateralizeManage

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

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

func (*Action) CollateralizeRepay

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

CollateralizeRepay 用户主动清算

func (*Action) CollateralizeRetrieve

func (action *Action) CollateralizeRetrieve(retrieve *pty.CollateralizeRetrieve) (*types.Receipt, error)

CollateralizeRetrieve 收回未放贷

func (*Action) GetAppendReceiptLog

func (action *Action) GetAppendReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog

GetAppendReceiptLog generate logs for Collateralize append action

func (*Action) GetBorrowReceiptLog

func (action *Action) GetBorrowReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog

GetBorrowReceiptLog generate logs for Collateralize borrow action

func (*Action) GetCreateReceiptLog

func (action *Action) GetCreateReceiptLog(collateralize *pty.Collateralize) *types.ReceiptLog

GetCreateReceiptLog generate logs for Collateralize create action

func (*Action) GetFeedReceiptLog

func (action *Action) GetFeedReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog

GetFeedReceiptLog generate logs for Collateralize price feed action

func (*Action) GetIndex

func (action *Action) GetIndex() int64

GetIndex returns index in block

func (*Action) GetRepayReceiptLog

func (action *Action) GetRepayReceiptLog(collateralize *pty.Collateralize, record *pty.BorrowRecord) *types.ReceiptLog

GetRepayReceiptLog generate logs for Collateralize Repay action

func (*Action) GetRetrieveReceiptLog

func (action *Action) GetRetrieveReceiptLog(collateralize *pty.Collateralize) *types.ReceiptLog

GetRetrieveReceiptLog generate logs for Collateralize close action

type Collateralize

type Collateralize struct {
	drivers.DriverBase
}

Collateralize driver

func (*Collateralize) CheckReceiptExecOk

func (c *Collateralize) CheckReceiptExecOk() bool

CheckReceiptExecOk return true to check if receipt ty is ok

func (*Collateralize) ExecDelLocal_Append

func (c *Collateralize) ExecDelLocal_Append(payload *pty.CollateralizeAppend, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Append Action

func (*Collateralize) ExecDelLocal_Borrow

func (c *Collateralize) ExecDelLocal_Borrow(payload *pty.CollateralizeBorrow, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Borrow Action

func (*Collateralize) ExecDelLocal_Create

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

ExecDelLocal_Create Action

func (*Collateralize) ExecDelLocal_Feed

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

ExecDelLocal_Feed Action

func (*Collateralize) ExecDelLocal_Manage

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

ExecDelLocal_Manage Action

func (*Collateralize) ExecDelLocal_Repay

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

ExecDelLocal_Repay Action

func (*Collateralize) ExecDelLocal_Retrieve

func (c *Collateralize) ExecDelLocal_Retrieve(payload *pty.CollateralizeRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Retrieve Action

func (*Collateralize) ExecLocal_Append

func (c *Collateralize) ExecLocal_Append(payload *pty.CollateralizeAppend, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Append Action

func (*Collateralize) ExecLocal_Borrow

func (c *Collateralize) ExecLocal_Borrow(payload *pty.CollateralizeBorrow, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Borrow Action

func (*Collateralize) ExecLocal_Create

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

ExecLocal_Create Action

func (*Collateralize) ExecLocal_Feed

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

ExecLocal_Feed Action

func (*Collateralize) ExecLocal_Manage

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

ExecLocal_Manage Action

func (*Collateralize) ExecLocal_Repay

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

ExecLocal_Repay Action

func (*Collateralize) ExecLocal_Retrieve

func (c *Collateralize) ExecLocal_Retrieve(payload *pty.CollateralizeRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Retrieve Action

func (*Collateralize) Exec_Append

func (c *Collateralize) Exec_Append(payload *pty.CollateralizeAppend, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Append Action

func (*Collateralize) Exec_Borrow

func (c *Collateralize) Exec_Borrow(payload *pty.CollateralizeBorrow, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Borrow Action

func (*Collateralize) Exec_Create

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

Exec_Create Action

func (*Collateralize) Exec_Feed

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

Exec_Feed Action

func (*Collateralize) Exec_Manage

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

Exec_Manage Action

func (*Collateralize) Exec_Repay

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

Exec_Repay Action

func (*Collateralize) Exec_Retrieve

func (c *Collateralize) Exec_Retrieve(payload *pty.CollateralizeRetrieve, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Retrieve Action

func (*Collateralize) ExecutorOrder

func (c *Collateralize) ExecutorOrder() int64

ExecutorOrder 设置localdb的EnableRead

func (*Collateralize) GetDriverName

func (c *Collateralize) GetDriverName() string

GetDriverName for Collateralize

func (*Collateralize) Query_CollateralizeByAddr

func (c *Collateralize) Query_CollateralizeByAddr(req *pty.ReqCollateralizeByAddr) (types.Message, error)

Query_CollateralizeByAddr ...

func (*Collateralize) Query_CollateralizeByStatus

func (c *Collateralize) Query_CollateralizeByStatus(req *pty.ReqCollateralizeByStatus) (types.Message, error)

Query_CollateralizeByStatus ...

func (*Collateralize) Query_CollateralizeConfig

func (c *Collateralize) Query_CollateralizeConfig(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)

Query_CollateralizeConfig ...

func (*Collateralize) Query_CollateralizeInfoByID

func (c *Collateralize) Query_CollateralizeInfoByID(req *pty.ReqCollateralizeInfo) (types.Message, error)

Query_CollateralizeInfoByID ...

func (*Collateralize) Query_CollateralizeInfoByIDs

func (c *Collateralize) Query_CollateralizeInfoByIDs(req *pty.ReqCollateralizeInfos) (types.Message, error)

Query_CollateralizeInfoByIDs ...

func (*Collateralize) Query_CollateralizePrice

func (c *Collateralize) Query_CollateralizePrice(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)

Query_CollateralizePrice ...

func (*Collateralize) Query_CollateralizeRecordByAddr

func (c *Collateralize) Query_CollateralizeRecordByAddr(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)

Query_CollateralizeRecordByAddr ...

func (*Collateralize) Query_CollateralizeRecordByID

func (c *Collateralize) Query_CollateralizeRecordByID(req *pty.ReqCollateralizeRecord) (types.Message, error)

Query_CollateralizeRecordByID ...

func (*Collateralize) Query_CollateralizeRecordByStatus

func (c *Collateralize) Query_CollateralizeRecordByStatus(req *pty.ReqCollateralizeRecordByStatus) (types.Message, error)

Query_CollateralizeRecordByStatus ...

func (*Collateralize) Query_CollateralizeUserBalance

func (c *Collateralize) Query_CollateralizeUserBalance(req *pty.ReqCollateralizeRecordByAddr) (types.Message, error)

Query_CollateralizeUserBalance ...

type CollateralizeDB

type CollateralizeDB struct {
	pty.Collateralize
}

CollateralizeDB def

func (*CollateralizeDB) GetKVSet

func (coll *CollateralizeDB) GetKVSet() (kvset []*types.KeyValue)

GetKVSet for CollateralizeDB

func (*CollateralizeDB) Save

func (coll *CollateralizeDB) Save(db dbm.KV)

Save for CollateralizeDB

Jump to

Keyboard shortcuts

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