github.com/filecoin-project/specs-actors/v4@v4.0.2/support/testing/adt.go (about)

     1  package testing
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/ipfs/go-cid"
     7  )
     8  
     9  type rooter interface {
    10  	Root() (cid.Cid, error)
    11  }
    12  
    13  func MustRoot(t testing.TB, r rooter) cid.Cid {
    14  	t.Helper()
    15  	c, err := r.Root()
    16  	if err != nil {
    17  		t.Fatal(err)
    18  	}
    19  	return c
    20  }