github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/engine/execution/computation/committer/noop.go (about)

     1  package committer
     2  
     3  import (
     4  	"github.com/onflow/flow-go/engine/execution"
     5  	"github.com/onflow/flow-go/fvm/storage/snapshot"
     6  	"github.com/onflow/flow-go/ledger"
     7  	"github.com/onflow/flow-go/model/flow"
     8  )
     9  
    10  type NoopViewCommitter struct {
    11  }
    12  
    13  func NewNoopViewCommitter() *NoopViewCommitter {
    14  	return &NoopViewCommitter{}
    15  }
    16  
    17  func (NoopViewCommitter) CommitView(
    18  	_ *snapshot.ExecutionSnapshot,
    19  	baseStorageSnapshot execution.ExtendableStorageSnapshot,
    20  ) (
    21  	flow.StateCommitment,
    22  	[]byte,
    23  	*ledger.TrieUpdate,
    24  	execution.ExtendableStorageSnapshot,
    25  	error,
    26  ) {
    27  
    28  	trieUpdate := &ledger.TrieUpdate{
    29  		RootHash: ledger.RootHash(baseStorageSnapshot.Commitment()),
    30  	}
    31  	return baseStorageSnapshot.Commitment(), []byte{}, trieUpdate, baseStorageSnapshot, nil
    32  }