github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/model/flow/seal_test.go (about)

     1  package flow_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  
     8  	"github.com/onflow/flow-go/utils/unittest"
     9  )
    10  
    11  // Test_SealID checks that two seals that only differ in their approval
    12  // signatures have different IDs. This is REQUIRED FOR the STORAGE layer
    13  // to correctly retrieve the block payload!
    14  func Test_SealID(t *testing.T) {
    15  
    16  	seal := unittest.Seal.Fixture()
    17  	id := seal.ID()
    18  	cs := seal.Checksum()
    19  
    20  	// Change signatures of first chunk
    21  	seal.AggregatedApprovalSigs[0] = unittest.Seal.AggregatedSignatureFixture()
    22  
    23  	// They should not have changed
    24  	assert.NotEqual(t, id, seal.ID())
    25  	assert.NotEqual(t, cs, seal.Checksum())
    26  }