github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/cmd/bootstrap/run/seal.go (about)

     1  package run
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/onflow/flow-go/model/flow"
     7  )
     8  
     9  func GenerateRootSeal(result *flow.ExecutionResult) (*flow.Seal, error) {
    10  	finalState, err := result.FinalStateCommitment()
    11  	if err != nil {
    12  		return nil, fmt.Errorf("generating root seal failed: %w", err)
    13  	}
    14  	seal := &flow.Seal{
    15  		BlockID:    result.BlockID,
    16  		ResultID:   result.ID(),
    17  		FinalState: finalState,
    18  	}
    19  	return seal, nil
    20  }