package routing

import (
	

	
)

func ( *QueryEvent) () ([]byte, error) {
	return json.Marshal(map[string]interface{}{
		"ID":        .ID.String(),
		"Type":      int(.Type),
		"Responses": .Responses,
		"Extra":     .Extra,
	})
}

func ( *QueryEvent) ( []byte) error {
	 := struct {
		        string
		      int
		 []*peer.AddrInfo
		     string
	}{}
	 := json.Unmarshal(, &)
	if  != nil {
		return 
	}
	if len(.) > 0 {
		,  := peer.Decode(.)
		if  != nil {
			return 
		}
		.ID = 
	}
	.Type = QueryEventType(.)
	.Responses = .
	.Extra = .
	return nil
}