Documentation ¶
Overview ¶
Copyright (c) 2018-2020. The asimov developers Use of this source code is governed by an ISC license that can be found in the LICENSE file.
Copyright (c) 2018-2020. The asimov developers Use of this source code is governed by an ISC license that can be found in the LICENSE file.
Copyright (c) 2018-2020. The asimov developers Use of this source code is governed by an ISC license that can be found in the LICENSE file.
Index ¶
Constants ¶
const (
// Round payload = RoundStartUnix 8 bytes + duration 8 bytes
RoundPayLoad = 16
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContractManager ¶
type ContractManager interface { // Init manager by genesis data. Init(chain fvm.ChainContext, genesisCoinbaseData []byte) error // Get latest contract by height. GetActiveContractByHeight(height int32, contractAddr common.Address) *chaincfg.ContractInfo GetContractAddressByAsset( gas uint64, block *asiutil.Block, stateDB vm.StateDB, chainConfig *params.ChainConfig, assets []string) ([]common.Address, bool, uint64) GetAssetInfoByAssetId( block *asiutil.Block, stateDB vm.StateDB, chainConfig *params.ChainConfig, assets []string) ([]AssetInfo, error) // Get fees from state GetFees(block *asiutil.Block, stateDB vm.StateDB, chainConfig *params.ChainConfig) (map[protos.Asset]int32, error) // Get template from state GetTemplate(block *asiutil.Block, gas uint64, stateDB vm.StateDB, chainConfig *params.ChainConfig, category uint16, name string) (TemplateWarehouseContent, bool, uint64) GetTemplates(block *asiutil.Block, gas uint64, stateDB vm.StateDB, chainConfig *params.ChainConfig, getCountFunc string, getTemplatesFunc string, category uint16, pageNo int, pageSize int) (int, []TemplateWarehouseContent, error, uint64) // Get signed up validators GetSignedUpValidators( consensus common.Address, block *asiutil.Block, stateDB vm.StateDB, chainConfig *params.ChainConfig, miners []string) ([]common.Address, []uint32, error) IsLimit(block *asiutil.Block, stateDB vm.StateDB, asset *protos.Asset) int IsSupport(block *asiutil.Block, stateDB vm.StateDB, gasLimit uint64, asset *protos.Asset, address []byte) (bool, uint64) DisconnectBlock(block *asiutil.Block) }
ContractManager provides a generic interface that the is called when system contract state need to be validated and each round started from the tip of the main chain for the purpose of supporting system contracts.
type GetValidatorsCallBack ¶
type IBtcClient ¶
type IRoundManager ¶
type IRoundManager interface { Init(round uint32, db database.Transactor, c IBtcClient) error // let the manager run Start() Halt() GetContract() common.Address GetHsMappingByRound(round uint32) (map[string]*ValidatorInfo, error) GetRoundInterval(round int64) int64 GetNextRound(round *Round) (*Round, error) HasValidator(validator common.Address) bool GetValidators(blockHash common.Hash, round uint32, fn GetValidatorsCallBack) ([]*common.Address, map[common.Address]uint16, error) }
type Page ¶
type Page struct { TotalLength int `json:"totalLength"` TemplateInfo []TemplateWarehouseContent }
type RegistryCenterContent ¶
type Round ¶
func (*Round) Deserialize ¶
Deserialize decodes a round from r into the receiver using a format that is suitable for long-term storage such as a database while respecting the Version field.
func (*Round) Serialize ¶
Serialize encodes a round from w into the receiver using a format that is suitable for long-term storage such as a database while respecting the Version field.