github.com/sixexorg/magnetic-ring@v0.0.0-20191119090307-31705a21e419/store/orgchain/storages/ledger_law.go (about) 1 package storages 2 3 import ( 4 "math/big" 5 6 "github.com/sixexorg/magnetic-ring/common" 7 "github.com/sixexorg/magnetic-ring/core/orgchain/types" 8 "github.com/sixexorg/magnetic-ring/store/storelaw" 9 ) 10 11 type PublicLedger interface { 12 GetCurrentHeaderHash() common.Hash 13 GetCurrentBlock() (uint64, common.Hash) 14 GetCurrentBlockHash() common.Hash 15 GetCurrentBlockHeight() uint64 16 TotalDifficulty() *big.Int 17 GetDifficultyByBlockHash(hash common.Hash) (*big.Int, error) 18 RollbackToHeight(height uint64) error 19 SaveAll(block *types.Block, accountStates storelaw.AccountStaters) error 20 }