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.
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
- func NewContractManager() ainterface.ContractManager
- type Manager
- func (m *Manager) DisconnectBlock(block *asiutil.Block)
- func (m *Manager) GetActiveContractByHeight(height int32, delegateAddr common.Address) *chaincfg.ContractInfo
- func (m *Manager) GetAssetInfoByAssetId(block *asiutil.Block, stateDB vm.StateDB, chainConfig *params.ChainConfig, ...) ([]ainterface.AssetInfo, error)
- func (m *Manager) GetContractAddressByAsset(gas uint64, block *asiutil.Block, stateDB vm.StateDB, ...) ([]common.Address, bool, uint64)
- func (m *Manager) GetFees(block *asiutil.Block, stateDB vm.StateDB, chainConfig *params.ChainConfig) (map[protos.Asset]int32, error)
- func (m *Manager) GetSignedUpValidators(proxyAddr common.Address, block *asiutil.Block, stateDB vm.StateDB, ...) ([]common.Address, []uint32, error)
- func (m *Manager) GetTemplate(block *asiutil.Block, gas uint64, stateDB vm.StateDB, ...) (ainterface.TemplateWarehouseContent, bool, uint64)
- func (m *Manager) GetTemplates(block *asiutil.Block, gas uint64, stateDB vm.StateDB, ...) (int, []ainterface.TemplateWarehouseContent, error, uint64)
- func (m *Manager) Init(chain fvm.ChainContext, dataBytes []byte) error
- func (m *Manager) IsLimit(block *asiutil.Block, stateDB vm.StateDB, asset *protos.Asset) int
- func (m *Manager) IsLimitInCache(asset *protos.Asset) bool
- func (m *Manager) IsSupport(block *asiutil.Block, stateDB vm.StateDB, gasLimit uint64, asset *protos.Asset, ...) (bool, uint64)
Constants ¶
const ( TEMPLATE_STATUS_SUBMIT uint8 = 0 TEMPLATE_STATUS_APPROVE uint8 = 1 TEMPLATE_STATUS_NOTEXIST uint8 = 2 TEMPLATE_STATUS_DISABLE uint8 = 3 )
Variables ¶
This section is empty.
Functions ¶
func NewContractManager ¶
func NewContractManager() ainterface.ContractManager
NewContractManager returns an empty struct of Manager
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager defines an contract manager that manages multiple system contracts and implements the blockchain.ContractManager interface so it can be seamlessly plugged into normal chain processing.
func (*Manager) DisconnectBlock ¶
DisconnectBlock delete unrestricted asset of cache which is in the block.
func (*Manager) GetActiveContractByHeight ¶
func (m *Manager) GetActiveContractByHeight(height int32, delegateAddr common.Address) *chaincfg.ContractInfo
Get latest contract by height.
func (*Manager) GetAssetInfoByAssetId ¶
func (m *Manager) GetAssetInfoByAssetId( block *asiutil.Block, stateDB vm.StateDB, chainConfig *params.ChainConfig, assets []string) ([]ainterface.AssetInfo, error)
GetAssetInfoByAssetId returns asset information by parameter asset id asset id is consist of organization id and asset index
func (*Manager) GetContractAddressByAsset ¶
func (m *Manager) GetContractAddressByAsset( gas uint64, block *asiutil.Block, stateDB vm.StateDB, chainConfig *params.ChainConfig, assets []string) ([]common.Address, bool, uint64)
GetContractAddressByAsset returns organization addresses by calling system contract of registry according to parameter assets
func (*Manager) GetFees ¶
func (m *Manager) GetFees( block *asiutil.Block, stateDB vm.StateDB, chainConfig *params.ChainConfig) (map[protos.Asset]int32, error)
GetFees returns an asset list and their valid heights asset in list are used as transaction fees heights describe the assets formally effective the asset list is submitted by members of validator committee
func (*Manager) GetSignedUpValidators ¶
func (m *Manager) GetSignedUpValidators( proxyAddr common.Address, block *asiutil.Block, stateDB vm.StateDB, chainConfig *params.ChainConfig, miners []string) ([]common.Address, []uint32, error)
GetSignedUpValidators returns validators and their rounds information by calling system contract of consensus_satoshiplus. some of these validators will mine next round by checking their rounds if match our mining rules. for rules, one validator may offline. he must sign up to update his round to newest. if not, he will lose the chance to mine for the chain
func (*Manager) GetTemplate ¶
func (m *Manager) GetTemplate( block *asiutil.Block, gas uint64, stateDB vm.StateDB, chainConfig *params.ChainConfig, category uint16, name string) (ainterface.TemplateWarehouseContent, bool, uint64)
GetTemplate returns template detail by its template name
func (*Manager) GetTemplates ¶
func (m *Manager) GetTemplates( block *asiutil.Block, gas uint64, stateDB vm.StateDB, chainConfig *params.ChainConfig, getCountFunc string, getTemplatesFunc string, category uint16, pageNo int, pageSize int) (int, []ainterface.TemplateWarehouseContent, error, uint64)
GetTemplates returns all submitted templates by calling system contract of template_warehouse
func (*Manager) Init ¶
func (m *Manager) Init(chain fvm.ChainContext, dataBytes []byte) error
Init manager by genesis data.