archive

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Senator

type Senator struct {
	Id           int
	CampaignHash types.Hash
	// contains filtered or unexported fields
}

type Senators

type Senators map[common.Address]*Senator

type Term

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

func NewTerm

func NewTerm(id uint32, participantNumber int, termChangeInterval int) *Term

func (*Term) AddAlsorans

func (t *Term) AddAlsorans(camps []*campaign.Campaign)

func (*Term) AddCampaign

func (t *Term) AddCampaign(c *campaign.Campaign)

func (*Term) AddCandidate

func (t *Term) AddCandidate(c *campaign.Campaign, publicKey crypto.PublicKey)

func (*Term) Alsorans

func (t *Term) Alsorans() map[common.Address]*campaign.Campaign

func (*Term) Campaigns

func (t *Term) Campaigns() map[common.Address]*campaign.Campaign

func (*Term) CanChange

func (t *Term) CanChange(lastHeight uint64, isGenesis bool) bool

CanChange returns true if the campaigns cached reaches the term change requirments.

func (*Term) Candidates

func (t *Term) Candidates() map[common.Address]*campaign.Campaign

func (*Term) ChangeTerm

func (t *Term) ChangeTerm(tc *campaign.TermChange, lastHeight uint64) error

func (*Term) Changing

func (t *Term) Changing() bool

func (*Term) ClearCampaigns

func (t *Term) ClearCampaigns()

func (*Term) GetAlsoran

func (t *Term) GetAlsoran(addr common.Address) *campaign.Campaign

func (*Term) GetCampaign

func (t *Term) GetCampaign(addr common.Address) *campaign.Campaign

func (*Term) GetCandidate

func (t *Term) GetCandidate(addr common.Address) *campaign.Campaign

func (*Term) GetFormerPks

func (t *Term) GetFormerPks() []crypto.PublicKey

func (*Term) GetGenesisTermChange

func (t *Term) GetGenesisTermChange() *campaign.TermChange

func (*Term) GetSenator

func (t *Term) GetSenator(address common.Address) *Senator

func (*Term) HasCampaign

func (t *Term) HasCampaign(address common.Address) bool

func (*Term) ID

func (t *Term) ID() uint32

func (*Term) SetStartedHeight

func (t *Term) SetStartedHeight(h uint64)

func (*Term) Started

func (t *Term) Started() bool

func (*Term) SwitchFlag

func (t *Term) SwitchFlag(flag bool)

func (*Term) UpdateID

func (t *Term) UpdateID(id uint32)

Jump to

Keyboard shortcuts

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