config

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PollChallengedNullifier = iota
	PollNullifierTreeRoot
	PollParticipationEventID
	PollChallengedEventID
)

Variables

View Source
var (
	ErrInvalidProposalEventID   = errors.New("invalid proposal event id")
	ErrInvalidRoot              = errors.New("invalid root")
	ErrInvalidChallengedEventID = errors.New("invalid challenged event id")
)
View Source
var ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000")

Functions

This section is empty.

Types

type Abstraction added in v1.7.2

type Abstraction interface {
	AbstractionConfig() *AbstractionConfig
}

func NewAbstractionConfig added in v1.7.2

func NewAbstractionConfig(getter kv.Getter) Abstraction

type AbstractionConfig added in v1.7.2

type AbstractionConfig struct {
	RPC            *ethclient.Client
	AccountFactory common.Address
	PointTokens    common.Address
	ChainID        *big.Int
	PointPrice     *big.Int
	// contains filtered or unexported fields
}

func (*AbstractionConfig) CreateAccount added in v1.7.2

func (r *AbstractionConfig) CreateAccount(ctx context.Context, nullifier [32]byte) (common.Address, error)

func (*AbstractionConfig) GetAccount added in v1.7.2

func (r *AbstractionConfig) GetAccount(nullifier [32]byte) (common.Address, error)

func (*AbstractionConfig) Mint added in v1.7.2

func (r *AbstractionConfig) Mint(ctx context.Context, account common.Address, amount *big.Int) (common.Hash, error)

type Config

func New

func New(getter kv.Getter) Config

type DailyQuestions added in v1.5.0

type DailyQuestions struct {
	Location    *time.Location
	RawLocation int

	Notifications *NotificationConfig
	// contains filtered or unexported fields
}

func (*DailyQuestions) ClearDeadlines added in v1.5.0

func (q *DailyQuestions) ClearDeadlines() map[int]int

func (*DailyQuestions) GetDeadline added in v1.5.0

func (q *DailyQuestions) GetDeadline(nullifier string) *Deadline

func (*DailyQuestions) LocalTime added in v1.5.0

func (q *DailyQuestions) LocalTime(date time.Time) time.Time

func (*DailyQuestions) Notification added in v1.8.0

func (q *DailyQuestions) Notification() *messaging.Message

func (*DailyQuestions) SendNotification added in v1.8.0

func (q *DailyQuestions) SendNotification() error

func (*DailyQuestions) SetDeadline added in v1.5.0

func (q *DailyQuestions) SetDeadline(nullifier string, id int, duration time.Duration) bool

func (*DailyQuestions) ZeroDeadline added in v1.8.1

func (q *DailyQuestions) ZeroDeadline(nullifier string) *Deadline

type Deadline added in v1.5.0

type Deadline struct {
	ID int
	At time.Time
}

type Level

type Level struct {
	Level             int  `fig:"lvl,required"`
	Threshold         int  `fig:"threshold,required"`
	Referrals         int  `fig:"referrals"`
	Infinity          bool `fig:"infinity"`
	WithdrawalAllowed bool `fig:"withdrawal_allowed"`
}

type Levels

type Levels struct {
	Downgradeable bool
	// contains filtered or unexported fields
}

func (*Levels) LvlChange added in v1.3.0

func (l *Levels) LvlChange(currentLevel int, totalAmount int64) (refCoundToAdd *int, newLevel int)

LvlUp Calculates new lvl. New lvl always greater then current level

func (Levels) MinLvl

func (l Levels) MinLvl() int

func (*Levels) WithdrawalAllowed added in v1.7.1

func (l *Levels) WithdrawalAllowed(level int) bool

type NotificationConfig added in v1.8.0

type NotificationConfig struct {
	Title string
	Body  string
	// offset from location time
	SendAt int
	Topic  string
	// contains filtered or unexported fields
}

type PollVerifier added in v1.4.0

type PollVerifier struct {
	RPC                  *ethclient.Client `fig:"rpc,required"`
	ProposalStateAddress common.Address    `fig:"proposal_state_address,required"`
	// contains filtered or unexported fields
}

func (*PollVerifier) VerifyProof added in v1.4.0

func (v *PollVerifier) VerifyProof(proof zkptypes.ZKProof, proposalID, proposalEventID *big.Int) error

type PollVerifierer added in v1.4.0

type PollVerifierer interface {
	PollVerifier() *PollVerifier
}

func NewPollVerifier added in v1.4.0

func NewPollVerifier(getter kv.Getter) PollVerifierer

type Verifiers added in v1.3.0

type Verifiers struct {
	Passport *zk.Verifier
	Poll     *zk.Verifier
	PollRoot *root.ProposalSMTVerifier
}

Jump to

Keyboard shortcuts

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