repo

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotDeleted = -1
	Deleted    = 1
)

Variables

View Source
var ErrRecordNotFound = gorm.ErrRecordNotFound

Functions

This section is empty.

Types

type ActorCfgRepo

type ActorCfgRepo interface {
	SaveActorCfg(ctx context.Context, address *types.ActorCfg) error
	GetActorCfgByMethodType(ctx context.Context, methodType *types.MethodType) (*types.ActorCfg, error)
	HasActorCfg(ctx context.Context, methodType *types.MethodType) (bool, error)
	GetActorCfgByID(ctx context.Context, id shared.UUID) (*types.ActorCfg, error)
	ListActorCfg(ctx context.Context) ([]*types.ActorCfg, error)
	DelActorCfgByMethodType(ctx context.Context, addr *types.MethodType) error
	DelActorCfgById(ctx context.Context, id shared.UUID) error
	UpdateSelectSpecById(ctx context.Context, id shared.UUID, spec *types.ChangeGasSpecParams) error
}

type AddressRepo

type AddressRepo interface {
	SaveAddress(ctx context.Context, address *types.Address) error
	GetAddress(ctx context.Context, addr address.Address) (*types.Address, error)
	GetAddressByID(ctx context.Context, id shared.UUID) (*types.Address, error)
	GetOneRecord(ctx context.Context, addr address.Address) (*types.Address, error)
	HasAddress(ctx context.Context, addr address.Address) (bool, error)
	ListAddress(ctx context.Context) ([]*types.Address, error)
	ListActiveAddress(ctx context.Context) ([]*types.Address, error)
	DelAddress(ctx context.Context, addr address.Address) error
	UpdateNonce(ctx context.Context, addr address.Address, nonce uint64) error
	UpdateState(ctx context.Context, addr address.Address, state types.AddressState) error
	UpdateSelectMsgNum(ctx context.Context, addr address.Address, num uint64) error
	UpdateFeeParams(ctx context.Context, addr address.Address, gasOverEstimation, gasOverPremium float64, maxFee, gasFeeCap, baseFee big.Int) error
}

type INodeProvider

type INodeProvider interface {
	ListNode() ([]*types.Node, error)
}

func NewINodeProvider

func NewINodeProvider(s NodeRepo) INodeProvider

type ISqlField

type ISqlField interface {
	Scan(value interface{}) error
	Value() (driver.Value, error)
}

type MessageRepo

type MessageRepo interface {
	ExpireMessage(msg []*types.Message) error
	BatchSaveMessage(msg []*types.Message) error
	CreateMessage(msg *types.Message) error
	UpdateMessage(msg *types.Message) error
	UpdateMessageByState(msg *types.Message, state types.MessageState) error

	GetMessageByFromAndNonce(from address.Address, nonce uint64) (*types.Message, error)
	GetMessageByFromNonceAndState(from address.Address, nonce uint64, state types.MessageState) (*types.Message, error)
	GetMessageByUid(id string) (*types.Message, error)
	HasMessageByUid(id string) (bool, error)
	GetMessageState(id string) (types.MessageState, error)
	GetMessageByCid(unsignedCid cid.Cid) (*types.Message, error)
	GetMessageBySignedCid(signedCid cid.Cid) (*types.Message, error)
	GetSignedMessageByTime(start time.Time) ([]*types.Message, error)
	GetSignedMessageByHeight(height abi.ChainEpoch) ([]*types.Message, error)
	GetSignedMessageFromFailedMsg(addr address.Address) ([]*types.Message, error)

	ListMessage() ([]*types.Message, error)
	ListMessageByFromState(from address.Address, state types.MessageState, isAsc bool, pageIndex, pageSize int, d time.Duration) ([]*types.Message, error)
	ListMessageByAddress(addr address.Address) ([]*types.Message, error)
	ListFailedMessage(*MsgQueryParams) ([]*types.Message, error)
	// ListBlockedMessage returns filled messages and unfill messages
	ListBlockedMessage(p *MsgQueryParams, d time.Duration) ([]*types.Message, error)
	ListUnChainMessageByAddress(addr address.Address, topN int) ([]*types.Message, error)
	ListFilledMessageByAddress(addr address.Address) ([]*types.Message, error)
	ListChainMessageByHeight(height abi.ChainEpoch) ([]*types.Message, error)
	ListUnFilledMessage(addr address.Address) ([]*types.Message, error)
	ListSignedMsgs() ([]*types.Message, error)
	ListFilledMessageBelowNonce(addr address.Address, nonce uint64) ([]*types.Message, error)
	ListMessageByParams(*MsgQueryParams) ([]*types.Message, error)

	UpdateMessageInfoByCid(unsignedCid string, receipt *venustypes.MessageReceipt, height abi.ChainEpoch, state types.MessageState, tsKey venustypes.TipSetKey) error
	UpdateMessageStateByCid(unsignedCid string, state types.MessageState) error
	UpdateMessageStateByID(id string, state types.MessageState) error
	MarkBadMessage(id string) error
	UpdateErrMsg(id string, errMsg string) error
}

type MsgQueryParams

type MsgQueryParams = types.MsgQueryParams

type NodeRepo

type NodeRepo interface {
	CreateNode(node *types.Node) error
	SaveNode(node *types.Node) error
	GetNode(name string) (*types.Node, error)
	HasNode(name string) (bool, error)
	ListNode() ([]*types.Node, error)
	DelNode(name string) error
}

func NewINodeRepo

func NewINodeRepo(repo Repo) NodeRepo

type Repo

type Repo interface {
	GetDb() *gorm.DB
	Transaction(func(txRepo TxRepo) error) error
	DbClose() error
	AutoMigrate() error

	TxRepo
}

type SharedParamsRepo

type SharedParamsRepo interface {
	GetSharedParams(ctx context.Context) (*types.SharedSpec, error)
	SetSharedParams(ctx context.Context, params *types.SharedSpec) (uint, error)
}

type SqlMsgReceipt

type SqlMsgReceipt struct {
	ExitCode exitcode.ExitCode `gorm:"column:exit_code;default:-1"`
	Return   []byte            `gorm:"column:return_value;type:blob;"`
	GasUsed  int64             `gorm:"column:gas_used;type:bigint;NOT NULL"`
}

func FromMsgReceipt

func FromMsgReceipt(receipt *types.MessageReceipt) *SqlMsgReceipt

func (*SqlMsgReceipt) MsgReceipt

func (s *SqlMsgReceipt) MsgReceipt() *types.MessageReceipt

type SqlSignature

type SqlSignature crypto.Signature

func (*SqlSignature) Scan

func (s *SqlSignature) Scan(value interface{}) error

func (*SqlSignature) Value

func (s *SqlSignature) Value() (driver.Value, error)

type TxRepo

type TxRepo interface {
	ActorCfgRepo() ActorCfgRepo
	MessageRepo() MessageRepo
	AddressRepo() AddressRepo
	SharedParamsRepo() SharedParamsRepo
	NodeRepo() NodeRepo
}

Jump to

Keyboard shortcuts

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