store

package
v0.0.0-...-6ceb869 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package store is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoosterStatus

type BoosterStatus struct {
	Pac            int
	Usdt           int
	AllPkgs        int
	ClaimedPkgs    int
	UnClaimedPkgs  int
	PaymentDone    int
	PaymentWaiting int
	Whitelists     int
}

type ClaimStatus

type ClaimStatus struct {
	Claimed          int
	ClaimedAmount    int64
	NotClaimed       int
	NotClaimedAmount int64
}

type Claimer

type Claimer struct {
	DiscordID   string `json:"did"`
	TotalReward int64  `json:"r"`
	ClaimedTxID string `json:"tx_id"`
}

func (*Claimer) IsClaimed

func (c *Claimer) IsClaimed() bool

type IStore

type IStore interface {
	ClaimerInfo(testNetValAddr string) *Claimer
	AddClaimTransaction(testNetValAddr string, txID string) error
	ClaimStatus() *ClaimStatus

	SaveTwitterParty(party *TwitterParty) error
	FindTwitterParty(twitterName string) *TwitterParty

	WhitelistTwitterAccount(twitterID, twitterName, authorizedDiscordID string) error
	IsWhitelisted(twitterID string) bool
	BoosterStatus() *BoosterStatus
}

func NewStore

func NewStore(storePath string, logger *log.SubLogger) (IStore, error)

type MockIStore

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

MockIStore is a mock of IStore interface.

func NewMockIStore

func NewMockIStore(ctrl *gomock.Controller) *MockIStore

NewMockIStore creates a new mock instance.

func (*MockIStore) AddClaimTransaction

func (m *MockIStore) AddClaimTransaction(testNetValAddr, txID string) error

AddClaimTransaction mocks base method.

func (*MockIStore) BoosterStatus

func (m *MockIStore) BoosterStatus() *BoosterStatus

BoosterStatus mocks base method.

func (*MockIStore) ClaimStatus

func (m *MockIStore) ClaimStatus() *ClaimStatus

ClaimStatus mocks base method.

func (*MockIStore) ClaimerInfo

func (m *MockIStore) ClaimerInfo(testNetValAddr string) *Claimer

ClaimerInfo mocks base method.

func (*MockIStore) EXPECT

func (m *MockIStore) EXPECT() *MockIStoreMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIStore) FindTwitterParty

func (m *MockIStore) FindTwitterParty(twitterName string) *TwitterParty

FindTwitterParty mocks base method.

func (*MockIStore) IsWhitelisted

func (m *MockIStore) IsWhitelisted(twitterID string) bool

IsWhitelisted mocks base method.

func (*MockIStore) SaveTwitterParty

func (m *MockIStore) SaveTwitterParty(party *TwitterParty) error

SaveTwitterParty mocks base method.

func (*MockIStore) WhitelistTwitterAccount

func (m *MockIStore) WhitelistTwitterAccount(twitterID, twitterName, authorizedDiscordID string) error

WhitelistTwitterAccount mocks base method.

type MockIStoreMockRecorder

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

MockIStoreMockRecorder is the mock recorder for MockIStore.

func (*MockIStoreMockRecorder) AddClaimTransaction

func (mr *MockIStoreMockRecorder) AddClaimTransaction(testNetValAddr, txID any) *gomock.Call

AddClaimTransaction indicates an expected call of AddClaimTransaction.

func (*MockIStoreMockRecorder) BoosterStatus

func (mr *MockIStoreMockRecorder) BoosterStatus() *gomock.Call

BoosterStatus indicates an expected call of BoosterStatus.

func (*MockIStoreMockRecorder) ClaimStatus

func (mr *MockIStoreMockRecorder) ClaimStatus() *gomock.Call

ClaimStatus indicates an expected call of ClaimStatus.

func (*MockIStoreMockRecorder) ClaimerInfo

func (mr *MockIStoreMockRecorder) ClaimerInfo(testNetValAddr any) *gomock.Call

ClaimerInfo indicates an expected call of ClaimerInfo.

func (*MockIStoreMockRecorder) FindTwitterParty

func (mr *MockIStoreMockRecorder) FindTwitterParty(twitterName any) *gomock.Call

FindTwitterParty indicates an expected call of FindTwitterParty.

func (*MockIStoreMockRecorder) IsWhitelisted

func (mr *MockIStoreMockRecorder) IsWhitelisted(twitterID any) *gomock.Call

IsWhitelisted indicates an expected call of IsWhitelisted.

func (*MockIStoreMockRecorder) SaveTwitterParty

func (mr *MockIStoreMockRecorder) SaveTwitterParty(party any) *gomock.Call

SaveTwitterParty indicates an expected call of SaveTwitterParty.

func (*MockIStoreMockRecorder) WhitelistTwitterAccount

func (mr *MockIStoreMockRecorder) WhitelistTwitterAccount(twitterID, twitterName, authorizedDiscordID any) *gomock.Call

WhitelistTwitterAccount indicates an expected call of WhitelistTwitterAccount.

type Store

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

Store is a thread-safe cache.

func (*Store) AddClaimTransaction

func (s *Store) AddClaimTransaction(testnetAddr string, txID string) error

func (*Store) BoosterStatus

func (s *Store) BoosterStatus() *BoosterStatus

func (*Store) ClaimStatus

func (s *Store) ClaimStatus() *ClaimStatus

func (*Store) ClaimerInfo

func (s *Store) ClaimerInfo(testnetAddr string) *Claimer

func (*Store) FindTwitterParty

func (s *Store) FindTwitterParty(twitterName string) *TwitterParty

func (*Store) IsWhitelisted

func (s *Store) IsWhitelisted(twitterID string) bool

func (*Store) SaveTwitterParty

func (s *Store) SaveTwitterParty(party *TwitterParty) error

func (*Store) WhitelistTwitterAccount

func (s *Store) WhitelistTwitterAccount(twitterID, twitterName, authorizedDiscordID string) error

type TwitterParty

type TwitterParty struct {
	TwitterID            string `json:"twitter_id"`
	TwitterName          string `json:"twitter_name"`
	RetweetID            string `json:"retweet_id"`
	ValAddr              string `json:"val_addr"`
	ValPubKey            string `json:"val_pub"`
	DiscordID            string `json:"discord_id"`
	DiscountCode         string `json:"discount_code"`
	TotalPrice           int    `json:"total_price"`
	AmountInPAC          int64  `json:"amount_in_pac"`
	CreatedAt            int64  `json:"created_at"`
	NowPaymentsInvoiceID string `json:"nowpayments_id"`
	NowPaymentsFinished  bool   `json:"nowpayments_finished"`
	TransactionID        string `json:"tx_id"`
}

type WhitelistInfo

type WhitelistInfo struct {
	TwitterID     string `json:"twitter_id"`
	TwitterName   string `json:"twitter_name"`
	WhitelistedBy string `json:"whitelisted_by"`
}

Jump to

Keyboard shortcuts

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