github.com/koko1123/flow-go-1@v0.29.6/model/flow/collection_test.go (about) 1 package flow_test 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 8 "github.com/koko1123/flow-go-1/model/encoding/rlp" 9 "github.com/koko1123/flow-go-1/model/fingerprint" 10 "github.com/koko1123/flow-go-1/model/flow" 11 "github.com/koko1123/flow-go-1/utils/unittest" 12 ) 13 14 func TestLightCollectionFingerprint(t *testing.T) { 15 col := unittest.CollectionFixture(2) 16 colID := col.ID() 17 data := fingerprint.Fingerprint(col.Light()) 18 var decoded flow.LightCollection 19 rlp.NewMarshaler().MustUnmarshal(data, &decoded) 20 decodedID := decoded.ID() 21 assert.Equal(t, colID, decodedID) 22 assert.Equal(t, col.Light(), decoded) 23 }