Documentation ¶
Index ¶
Constants ¶
View Source
const ( AccountStatusPending = iota AccountStatusConfirmed )
View Source
const (
AccountHistoryTableName = `account_history`
)
View Source
const (
AccountTableName = `account`
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { gorm.Model AccountIndex int64 `gorm:"uniqueIndex"` AccountName string `gorm:"uniqueIndex"` PublicKey string `gorm:"uniqueIndex"` AccountNameHash string `gorm:"uniqueIndex"` L1Address string Nonce int64 CollectionNonce int64 // map[int64]*AccountAsset AssetInfo string AssetRoot string // 0 - registered, not committer 1 - committer Status int }
always keep the latest data of committer
type AccountHistory ¶
type AccountHistory struct { gorm.Model AccountIndex int64 `gorm:"index"` Nonce int64 CollectionNonce int64 AssetInfo string AssetRoot string L2BlockHeight int64 `gorm:"index"` }
func (*AccountHistory) TableName ¶
func (*AccountHistory) TableName() string
type AccountHistoryModel ¶
type AccountHistoryModel interface { CreateAccountHistoryTable() error DropAccountHistoryTable() error GetValidAccounts(height int64, limit int, offset int) (rowsAffected int64, accounts []*AccountHistory, err error) GetValidAccountCount(height int64) (accounts int64, err error) CreateAccountHistoriesInTransact(tx *gorm.DB, histories []*AccountHistory) error GetLatestAccountHistory(accountIndex, height int64) (accountHistory *AccountHistory, err error) }
func NewAccountHistoryModel ¶
func NewAccountHistoryModel(db *gorm.DB) AccountHistoryModel
type AccountModel ¶
type AccountModel interface { CreateAccountTable() error DropAccountTable() error GetAccountByIndex(accountIndex int64) (account *Account, err error) GetConfirmedAccountByIndex(accountIndex int64) (account *Account, err error) GetAccountByPk(pk string) (account *Account, err error) GetAccountByName(name string) (account *Account, err error) GetAccountByNameHash(nameHash string) (account *Account, err error) GetAccounts(limit int, offset int64) (accounts []*Account, err error) GetAccountsTotalCount() (count int64, err error) UpdateAccountsInTransact(tx *gorm.DB, accounts []*Account) error }
func NewAccountModel ¶
func NewAccountModel(db *gorm.DB) AccountModel
Click to show internal directories.
Click to hide internal directories.