core: update MPT during block processing

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2020-05-29 17:20:00 +03:00
parent 2b53877dff
commit 0e29382035
6 changed files with 326 additions and 5 deletions

View file

@ -20,6 +20,7 @@ type Blockchainer interface {
GetConfig() config.ProtocolConfiguration
AddHeaders(...*block.Header) error
AddBlock(*block.Block) error
AddStateRoot(r *state.MPTRoot) error
BlockHeight() uint32
CalculateClaimable(value *big.Int, startHeight, endHeight uint32) *big.Int
Close()
@ -42,6 +43,7 @@ type Blockchainer interface {
GetValidators() ([]*keys.PublicKey, error)
GetStandByValidators() keys.PublicKeys
GetScriptHashesForVerifying(*transaction.Transaction) ([]util.Uint160, error)
GetStateRoot(height uint32) (*state.MPTRootState, error)
GetStorageItem(id int32, key []byte) *state.StorageItem
GetStorageItems(id int32) (map[string]*state.StorageItem, error)
GetTestVM(tx *transaction.Transaction) *vm.VM