github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/mempool/model/id_entity.go (about) 1 package model 2 3 import ( 4 "github.com/onflow/flow-go/model/flow" 5 ) 6 7 // IdEntity is an internal data structure for mempool 8 // It implements a wrapper around the original flow Identifier 9 // which represents it as a flow Entity 10 // that allows the identifier to directly gets stored in the mempool 11 type IdEntity struct { 12 Id flow.Identifier 13 } 14 15 // ID implements flow.Entity.ID for Identifier to make it capable of being stored directly 16 // in mempools and storage 17 // ID returns the identifier itself 18 func (id IdEntity) ID() flow.Identifier { 19 return id.Id 20 } 21 22 // ID implements flow.Entity.ID for Identifier to make it capable of being stored directly 23 // in mempools and storage 24 // ID returns checksum of identifier 25 func (id IdEntity) Checksum() flow.Identifier { 26 return flow.MakeID(id) 27 }