Documentation ¶
Index ¶
- Variables
- type FundingHistoryRecord
- type FundingState
- type Record
- func (r *Record) Clone() *Record
- func (r *Record) ContainsRecentRoot(recentRoot string) (bool, int)
- func (r *Record) CopyTo(dst *Record)
- func (r *Record) GetMostRecentRoot() string
- func (r *Record) GetPreviousMostRecentRoot() string
- func (r *Record) Update(data *splitter_token.PoolAccount, solanaBlock uint64) error
- func (r *Record) Validate() error
- type Store
- type TreasuryPoolState
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTreasuryPoolNotFound = errors.New("no records could be found") ErrTreasuryPoolBlockhashNotFound = errors.New("treasury pool blockhash not found") ErrStaleTreasuryPoolState = errors.New("treasury pool state is stale") ErrNegativeFunding = errors.New("treasury pool has negative funding") )
Functions ¶
This section is empty.
Types ¶
type FundingHistoryRecord ¶
type FundingHistoryRecord struct { Id uint64 Vault string DeltaQuarks int64 TransactionId string State FundingState CreatedAt time.Time }
func (*FundingHistoryRecord) Clone ¶
func (r *FundingHistoryRecord) Clone() *FundingHistoryRecord
func (*FundingHistoryRecord) CopyTo ¶
func (r *FundingHistoryRecord) CopyTo(dst *FundingHistoryRecord)
func (*FundingHistoryRecord) Validate ¶
func (r *FundingHistoryRecord) Validate() error
type FundingState ¶
type FundingState uint8
const ( FundingStateUnknown FundingState = iota FundingStatePending FundingStateConfirmed FundingStateFailed )
type Record ¶
type Record struct { Id uint64 DataVersion splitter_token.DataVersion Name string Address string Bump uint8 Vault string VaultBump uint8 Authority string MerkleTreeLevels uint8 CurrentIndex uint8 HistoryListSize uint8 HistoryList []string // order maintained with on-chain state SolanaBlock uint64 State TreasuryPoolState // currently managed manually LastUpdatedAt time.Time }
func (*Record) ContainsRecentRoot ¶
func (*Record) GetMostRecentRoot ¶
func (*Record) GetPreviousMostRecentRoot ¶
func (*Record) Update ¶
func (r *Record) Update(data *splitter_token.PoolAccount, solanaBlock uint64) error
type Store ¶
type Store interface { // Save saves a treasury pool account's state Save(ctx context.Context, record *Record) error // GetByName gets a treasury pool account by its name GetByName(ctx context.Context, name string) (*Record, error) // GetByAddress gets a treasury pool account by its address GetByAddress(ctx context.Context, address string) (*Record, error) // GetByVault gets a treasury pool account by its vault address GetByVault(ctx context.Context, vault string) (*Record, error) // GetAllByState gets all treasury pool accounts in the provided state GetAllByState(ctx context.Context, state TreasuryPoolState, cursor query.Cursor, limit uint64, direction query.Ordering) ([]*Record, error) // SaveFunding saves a funding history record for a treasury pool vault SaveFunding(ctx context.Context, record *FundingHistoryRecord) error // GetTotalAvailableFunds gets the total available funds for a treasury pool's vault GetTotalAvailableFunds(ctx context.Context, vault string) (uint64, error) }
type TreasuryPoolState ¶
type TreasuryPoolState uint8
const ( TreasuryPoolStateUnknown TreasuryPoolState = iota TreasuryPoolStateAvailable TreasuryPoolStateDeprecated )
func (TreasuryPoolState) String ¶
func (s TreasuryPoolState) String() string
Click to show internal directories.
Click to hide internal directories.