icreward

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeVoted int = iota
	TypeDelegating
	TypeBonding
	TypeIScore
	TypeBugDisabledPRep
)

Variables

View Source
var (
	VotedKey           = containerdb.ToKey(containerdb.RLPBuilder, []byte{0x10})
	DelegatingKey      = containerdb.ToKey(containerdb.RLPBuilder, []byte{0x20})
	BondingKey         = containerdb.ToKey(containerdb.RLPBuilder, []byte{0x30})
	IScoreKey          = containerdb.ToKey(containerdb.RLPBuilder, []byte{0x40})
	BugDisabledPRepKey = containerdb.ToKey(containerdb.RLPBuilder, []byte{0x50})
)

Functions

func NewObjectImpl

func NewObjectImpl(tag icobject.Tag) (icobject.Impl, error)

Types

type Bonding

type Bonding struct {
	icobject.NoDatabase
	icstate.Bonds
}

func NewBonding

func NewBonding() *Bonding

func ToBonding

func ToBonding(obj trie.Object) *Bonding

func (*Bonding) ApplyVotes

func (b *Bonding) ApplyVotes(deltas icstage.VoteList) error

func (*Bonding) Clone

func (b *Bonding) Clone() *Bonding

func (*Bonding) Equal

func (b *Bonding) Equal(o icobject.Impl) bool

func (*Bonding) Format added in v0.9.7

func (b *Bonding) Format(f fmt.State, c rune)

func (*Bonding) IsEmpty

func (b *Bonding) IsEmpty() bool

func (*Bonding) RLPDecodeFields

func (b *Bonding) RLPDecodeFields(decoder codec.Decoder) error

func (*Bonding) RLPEncodeFields

func (b *Bonding) RLPEncodeFields(encoder codec.Encoder) error

func (*Bonding) Version

func (b *Bonding) Version() int

type BugDisabledPRep added in v0.9.8

type BugDisabledPRep struct {
	icobject.NoDatabase
	// contains filtered or unexported fields
}

func NewBugDisabledPRep added in v0.9.8

func NewBugDisabledPRep(value *big.Int) *BugDisabledPRep

func ToBugDisabledPRep added in v0.9.8

func ToBugDisabledPRep(obj trie.Object) *BugDisabledPRep

func (*BugDisabledPRep) Equal added in v0.9.8

func (is *BugDisabledPRep) Equal(o icobject.Impl) bool

func (*BugDisabledPRep) Format added in v0.9.8

func (is *BugDisabledPRep) Format(f fmt.State, c rune)

func (*BugDisabledPRep) RLPDecodeFields added in v0.9.8

func (is *BugDisabledPRep) RLPDecodeFields(decoder codec.Decoder) error

func (*BugDisabledPRep) RLPEncodeFields added in v0.9.8

func (is *BugDisabledPRep) RLPEncodeFields(encoder codec.Encoder) error

func (*BugDisabledPRep) Value added in v0.9.8

func (is *BugDisabledPRep) Value() *big.Int

func (*BugDisabledPRep) Version added in v0.9.8

func (is *BugDisabledPRep) Version() int

type Delegating

type Delegating struct {
	icobject.NoDatabase
	icstate.Delegations
}

func NewDelegating

func NewDelegating() *Delegating

func ToDelegating

func ToDelegating(obj trie.Object) *Delegating

func (*Delegating) ApplyVotes

func (d *Delegating) ApplyVotes(deltas icstage.VoteList) error

func (*Delegating) Clone

func (d *Delegating) Clone() *Delegating

func (*Delegating) Equal

func (d *Delegating) Equal(o icobject.Impl) bool

func (*Delegating) Format added in v0.9.7

func (d *Delegating) Format(f fmt.State, c rune)

func (*Delegating) IsEmpty

func (d *Delegating) IsEmpty() bool

func (*Delegating) RLPDecodeFields

func (d *Delegating) RLPDecodeFields(decoder codec.Decoder) error

func (*Delegating) RLPEncodeFields

func (d *Delegating) RLPEncodeFields(encoder codec.Encoder) error

func (*Delegating) Version

func (d *Delegating) Version() int

type IScore

type IScore struct {
	icobject.NoDatabase
	// contains filtered or unexported fields
}

func NewIScore

func NewIScore(value *big.Int) *IScore

func ToIScore

func ToIScore(obj trie.Object) *IScore

func (*IScore) Added

func (is *IScore) Added(amount *big.Int) *IScore

func (*IScore) Clear added in v0.9.7

func (is *IScore) Clear()

func (*IScore) Clone

func (is *IScore) Clone() *IScore

func (*IScore) Equal

func (is *IScore) Equal(o icobject.Impl) bool

func (*IScore) Format added in v0.9.7

func (is *IScore) Format(f fmt.State, c rune)

func (*IScore) IsEmpty added in v0.9.7

func (is *IScore) IsEmpty() bool

func (*IScore) RLPDecodeFields added in v0.9.7

func (is *IScore) RLPDecodeFields(decoder codec.Decoder) error

func (*IScore) RLPEncodeFields added in v0.9.7

func (is *IScore) RLPEncodeFields(encoder codec.Encoder) error

func (*IScore) Subtracted added in v0.9.7

func (is *IScore) Subtracted(amount *big.Int) *IScore

func (*IScore) Value added in v0.9.7

func (is *IScore) Value() *big.Int

func (*IScore) Version added in v0.9.7

func (is *IScore) Version() int

type Snapshot

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

func NewSnapshot

func NewSnapshot(database db.Database, hash []byte) *Snapshot

func NewSnapshotWithBuilder

func NewSnapshotWithBuilder(builder merkle.Builder, hash []byte) *Snapshot

func (*Snapshot) Bytes

func (ss *Snapshot) Bytes() []byte

func (*Snapshot) Filter

func (ss *Snapshot) Filter(prefix []byte) trie.IteratorForObject

func (*Snapshot) Flush

func (ss *Snapshot) Flush() error

func (*Snapshot) NewState

func (ss *Snapshot) NewState() *State

type State

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

func NewState

func NewState(database db.Database, hash []byte) *State

func NewStateFromSnapshot

func NewStateFromSnapshot(ss *Snapshot) *State

func (*State) AddBugDisabledPRep added in v0.9.8

func (s *State) AddBugDisabledPRep(addr module.Address, value *BugDisabledPRep) error

func (*State) DeleteBugDisabledPRep added in v0.9.8

func (s *State) DeleteBugDisabledPRep(addr module.Address) error

func (*State) GetBonding

func (s *State) GetBonding(addr module.Address) (*Bonding, error)

func (*State) GetDelegating

func (s *State) GetDelegating(addr module.Address) (*Delegating, error)

func (*State) GetIScore

func (s *State) GetIScore(addr module.Address) (*IScore, error)

func (*State) GetSnapshot

func (s *State) GetSnapshot() *Snapshot

func (*State) GetVoted

func (s *State) GetVoted(addr module.Address) (*Voted, error)

func (*State) Reset

func (s *State) Reset(ss *Snapshot)

func (*State) SetBonding

func (s *State) SetBonding(addr module.Address, bonding *Bonding) error

func (*State) SetDelegating

func (s *State) SetDelegating(addr module.Address, delegating *Delegating) error

func (*State) SetIScore

func (s *State) SetIScore(addr module.Address, iScore *IScore) error

func (*State) SetVoted

func (s *State) SetVoted(addr module.Address, voted *Voted) error

type Voted

type Voted struct {
	icobject.NoDatabase
	// contains filtered or unexported fields
}

func NewVoted

func NewVoted() *Voted

func ToVoted

func ToVoted(obj trie.Object) *Voted

func (*Voted) Bonded

func (v *Voted) Bonded() *big.Int

func (*Voted) BondedDelegation

func (v *Voted) BondedDelegation() *big.Int

func (*Voted) Clone

func (v *Voted) Clone() *Voted

func (*Voted) Delegated

func (v *Voted) Delegated() *big.Int

func (*Voted) Enable

func (v *Voted) Enable() bool

func (*Voted) Equal

func (v *Voted) Equal(o icobject.Impl) bool

func (*Voted) Format added in v0.9.7

func (v *Voted) Format(f fmt.State, c rune)

func (*Voted) GetVotedAmount added in v0.9.7

func (v *Voted) GetVotedAmount() *big.Int

func (*Voted) IsEmpty

func (v *Voted) IsEmpty() bool

func (*Voted) RLPDecodeFields

func (v *Voted) RLPDecodeFields(decoder codec.Decoder) error

func (*Voted) RLPEncodeFields

func (v *Voted) RLPEncodeFields(encoder codec.Encoder) error

func (*Voted) SetBonded

func (v *Voted) SetBonded(value *big.Int)

func (*Voted) SetBondedDelegation added in v0.9.7

func (v *Voted) SetBondedDelegation(value *big.Int)

func (*Voted) SetDelegated added in v0.9.7

func (v *Voted) SetDelegated(value *big.Int)

func (*Voted) SetEnable

func (v *Voted) SetEnable(enable bool)

func (*Voted) UpdateBondedDelegation

func (v *Voted) UpdateBondedDelegation(bondRequirement int)

func (*Voted) Version

func (v *Voted) Version() int

type Voting

type Voting interface {
	Iterator() icstate.VotingIterator
	ApplyVotes(deltas icstage.VoteList) error
}

Jump to

Keyboard shortcuts

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