Documentation
¶
Index ¶
- type Module
- func (s *Module) AddMPTBatch(index uint32, b mpt.Batch) error
- func (s *Module) AddStateRoot(sr *state.MPTRoot) error
- func (s *Module) CurrentLocalStateRoot() util.Uint256
- func (s *Module) CurrentValidatedHeight() uint32
- func (s *Module) GetStateProof(root util.Uint256, key []byte) ([][]byte, error)
- func (s *Module) GetStateRoot(height uint32) (*state.MPTRoot, error)
- func (s *Module) GetStateValidators(height uint32) keys.PublicKeys
- func (s *Module) Init(height uint32, enableRefCount bool) error
- func (s *Module) SetUpdateValidatorsCallback(f func(uint32, keys.PublicKeys))
- func (s *Module) UpdateStateValidators(height uint32, pubs keys.PublicKeys)
- func (s *Module) VerifyStateRoot(r *state.MPTRoot) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct { Store *storage.MemCachedStore // contains filtered or unexported fields }
Module represents module for local processing of state roots.
func NewModule ¶
func NewModule(bc blockchainer.Blockchainer, log *zap.Logger, s *storage.MemCachedStore) *Module
NewModule returns new instance of stateroot module.
func (*Module) AddMPTBatch ¶
AddMPTBatch updates using provided batch.
func (*Module) AddStateRoot ¶
AddStateRoot adds validated state root provided by network.
func (*Module) CurrentLocalStateRoot ¶
CurrentLocalStateRoot returns hash of the local state root.
func (*Module) CurrentValidatedHeight ¶
CurrentValidatedHeight returns current state root validated height.
func (*Module) GetStateProof ¶
GetStateProof returns proof of having key in the MPT with the specified root.
func (*Module) GetStateRoot ¶
GetStateRoot returns state root for a given height.
func (*Module) GetStateValidators ¶
func (s *Module) GetStateValidators(height uint32) keys.PublicKeys
GetStateValidators returns current state validators.
func (*Module) SetUpdateValidatorsCallback ¶
func (s *Module) SetUpdateValidatorsCallback(f func(uint32, keys.PublicKeys))
SetUpdateValidatorsCallback sets callback for sending signed root.
func (*Module) UpdateStateValidators ¶
func (s *Module) UpdateStateValidators(height uint32, pubs keys.PublicKeys)
UpdateStateValidators updates list of state validator keys.