Documentation ¶
Overview ¶
Copyright © 2019 Annchain Authors <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Senator
- type Senators
- type Term
- func (t *Term) AddAlsorans(camps []*campaign.Campaign)
- func (t *Term) AddCampaign(c *campaign.Campaign)
- func (t *Term) AddCandidate(c *campaign.Campaign, publicKey crypto.PublicKey)
- func (t *Term) Alsorans() map[common.Address]*campaign.Campaign
- func (t *Term) Campaigns() map[common.Address]*campaign.Campaign
- func (t *Term) CanChange(lastHeight uint64, isGenesis bool) bool
- func (t *Term) Candidates() map[common.Address]*campaign.Campaign
- func (t *Term) ChangeTerm(tc *campaign.TermChange, lastHeight uint64) error
- func (t *Term) Changing() bool
- func (t *Term) ClearCampaigns()
- func (t *Term) GetAlsoran(addr common.Address) *campaign.Campaign
- func (t *Term) GetCampaign(addr common.Address) *campaign.Campaign
- func (t *Term) GetCandidate(addr common.Address) *campaign.Campaign
- func (t *Term) GetFormerPks() []crypto.PublicKey
- func (t *Term) GetGenesisTermChange() *campaign.TermChange
- func (t *Term) GetSenator(address common.Address) *Senator
- func (t *Term) HasCampaign(address common.Address) bool
- func (t *Term) ID() uint32
- func (t *Term) SetStartedHeight(h uint64)
- func (t *Term) Started() bool
- func (t *Term) SwitchFlag(flag bool)
- func (t *Term) UpdateID(id uint32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Term ¶
type Term struct {
// contains filtered or unexported fields
}
func (*Term) AddAlsorans ¶
func (*Term) AddCampaign ¶
func (*Term) AddCandidate ¶
func (*Term) CanChange ¶
CanChange returns true if the campaigns cached reaches the term change requirments.
func (*Term) ChangeTerm ¶
func (t *Term) ChangeTerm(tc *campaign.TermChange, lastHeight uint64) error
func (*Term) ClearCampaigns ¶
func (t *Term) ClearCampaigns()
func (*Term) GetFormerPks ¶
func (*Term) GetGenesisTermChange ¶
func (t *Term) GetGenesisTermChange() *campaign.TermChange
func (*Term) SetStartedHeight ¶
func (*Term) SwitchFlag ¶
Click to show internal directories.
Click to hide internal directories.