common

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

orderfilled 当用户处于ing状态时允许重置状态,cancel是特例,从合约的角度来看没有cancel,从客户端来看需要考虑cancel,这里我们以合约为准

同一个订单必须允许多次cancel&cutoff,有的cancel/cutoff可能会不成功,后续的动作可以跟进

todo pending状态的订单是否允许软取消

Functions

func IsInvalidFillStatus

func IsInvalidFillStatus(status types.OrderStatus) bool

func IsPendingStatus

func IsPendingStatus(status types.OrderStatus) bool

Types

type CutoffCache

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

func NewCutoffCache

func NewCutoffCache(expire int64) *CutoffCache

func (*CutoffCache) GetCutoff

func (c *CutoffCache) GetCutoff(protocol, owner common.Address) *big.Int

func (*CutoffCache) GetCutoffPair

func (c *CutoffCache) GetCutoffPair(protocol, owner, token1, token2 common.Address) *big.Int

func (*CutoffCache) IsOrderCutoff

func (c *CutoffCache) IsOrderCutoff(protocol, owner, token1, token2 common.Address, validsince *big.Int) bool

合约验证的是创建时间

func (*CutoffCache) UpdateCutoff

func (c *CutoffCache) UpdateCutoff(protocol, owner common.Address, cutoff *big.Int) error

func (*CutoffCache) UpdateCutoffPair

func (c *CutoffCache) UpdateCutoffPair(protocol, owner, token1, token2 common.Address, cutoff *big.Int) error

type OrderManagerOptions

type OrderManagerOptions struct {
	CutoffCacheExpireTime int64
	CutoffCacheCleanTime  int64
}

Jump to

Keyboard shortcuts

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