Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type BlockStorageParams
- type MockAccount
- type MockState
- type State
- type StateManager
- func (s *StateManager) AcceptAndVerifyBlockBinary(data []byte, initialisation bool) error
- func (s *StateManager) AccountBalance(addr proto.Address, asset []byte) (uint64, error)
- func (s *StateManager) BlockIDToHeight(blockID crypto.Signature) (uint64, error)
- func (s *StateManager) Close() error
- func (s *StateManager) GetBlock(blockID crypto.Signature) (*proto.Block, error)
- func (s *StateManager) GetBlockByHeight(height uint64) (*proto.Block, error)
- func (s *StateManager) Height() (uint64, error)
- func (s *StateManager) HeightToBlockID(height uint64) (crypto.Signature, error)
- func (s *StateManager) RollbackTo(removalEdge crypto.Signature) error
- func (s *StateManager) RollbackToHeight(height uint64) error
- func (s *StateManager) WavesAddressesNumber() (uint64, error)
Constants ¶
View Source
const ( BLOCKS_STOR_DIR = "blocks_storage" BLOCKS_STOR_KEYVAL_DIR = "blocks_storage_keyvalue" ACCOUNTS_STOR_GLOBAL_DIR = "accounts_stor_global" ACCOUNTS_STOR_ADDR_DIR = "accounts_stor_addr" ACCOUNTS_STOR_ASSET_DIR = "accounts_stor_assets" )
View Source
const (
GENESIS_SIGNATURE = "FSH8eAAzZNqnG8xgTZtz5xuLqXySsXgAjmFEC25hXMbEufiGjqWPnGCZFt6gLiVLJny16ipxRNAkkzjjhqTjBE2"
)
Variables ¶
View Source
var ErrNotFound = errors.New("Not found")
Functions ¶
This section is empty.
Types ¶
type BlockStorageParams ¶
type BlockStorageParams struct {
OffsetLen, HeaderOffsetLen int
}
func DefaultBlockStorageParams ¶
func DefaultBlockStorageParams() BlockStorageParams
type MockAccount ¶
type MockAccount struct { Assets map[string]uint64 DataEntries []proto.DataEntry AddressField proto.Address }
func (*MockAccount) Address ¶
func (a *MockAccount) Address() proto.Address
func (*MockAccount) AssetBalance ¶
func (a *MockAccount) AssetBalance(p *proto.OptionalAsset) uint64
func (*MockAccount) Data ¶
func (a *MockAccount) Data() []proto.DataEntry
type MockState ¶
type MockState struct { TransactionsByID map[string]proto.Transaction TransactionsHeightByID map[string]uint64 Accounts map[string]Account // recipient to account }
func (MockState) TransactionByID ¶
func (a MockState) TransactionByID(b []byte) (proto.Transaction, error)
type StateManager ¶
type StateManager struct {
// contains filtered or unexported fields
}
func NewStateManager ¶
func NewStateManager(dataDir string, params BlockStorageParams) (*StateManager, error)
func (*StateManager) AcceptAndVerifyBlockBinary ¶
func (s *StateManager) AcceptAndVerifyBlockBinary(data []byte, initialisation bool) error
func (*StateManager) AccountBalance ¶
func (*StateManager) BlockIDToHeight ¶
func (s *StateManager) BlockIDToHeight(blockID crypto.Signature) (uint64, error)
func (*StateManager) Close ¶
func (s *StateManager) Close() error
func (*StateManager) GetBlockByHeight ¶
func (s *StateManager) GetBlockByHeight(height uint64) (*proto.Block, error)
func (*StateManager) Height ¶
func (s *StateManager) Height() (uint64, error)
func (*StateManager) HeightToBlockID ¶
func (s *StateManager) HeightToBlockID(height uint64) (crypto.Signature, error)
func (*StateManager) RollbackTo ¶
func (s *StateManager) RollbackTo(removalEdge crypto.Signature) error
func (*StateManager) RollbackToHeight ¶
func (s *StateManager) RollbackToHeight(height uint64) error
func (*StateManager) WavesAddressesNumber ¶
func (s *StateManager) WavesAddressesNumber() (uint64, error)
Click to show internal directories.
Click to hide internal directories.