github.com/MetalBlockchain/metalgo@v1.11.9/snow/networking/handler/parser.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package handler
     5  
     6  import (
     7  	"github.com/MetalBlockchain/metalgo/ids"
     8  	"github.com/MetalBlockchain/metalgo/utils/set"
     9  )
    10  
    11  func getIDs(idsBytes [][]byte) (set.Set[ids.ID], error) {
    12  	var res set.Set[ids.ID]
    13  	for _, bytes := range idsBytes {
    14  		id, err := ids.ToID(bytes)
    15  		if err != nil {
    16  			return nil, err
    17  		}
    18  		res.Add(id)
    19  	}
    20  	return res, nil
    21  }