github.com/koko1123/flow-go-1@v0.29.6/fvm/state/view.go (about)

     1  package state
     2  
     3  import (
     4  	"github.com/koko1123/flow-go-1/model/flow"
     5  )
     6  
     7  type View interface {
     8  	NewChild() View
     9  	MergeView(child View) error
    10  	DropDelta() // drops all the delta changes
    11  	RegisterUpdates() ([]flow.RegisterID, []flow.RegisterValue)
    12  	AllRegisters() []flow.RegisterID
    13  	Ledger
    14  }
    15  
    16  // Ledger is the storage interface used by the virtual machine to read and write register values.
    17  //
    18  // TODO Rename this to Storage
    19  // and remove reference to flow.RegisterValue and use byte[]
    20  type Ledger interface {
    21  	Set(owner, key string, value flow.RegisterValue) error
    22  	Get(owner, key string) (flow.RegisterValue, error)
    23  	Touch(owner, key string) error
    24  	Delete(owner, key string) error
    25  }