func GetMessageBlock(w http.ResponseWriter, req *http.Request) {
	haddr, err := hash.NewFromHash(mux.Vars(req)["addr"])
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, accountNotFound)
		return
	}

	messageID := mux.Vars(req)["message"]
	blockID := mux.Vars(req)["block"]

	ar := container.Instance.GetAccountRepo()
	block, err := ar.FetchMessageBlock(*haddr, messageID, blockID)
	if err != nil {
		httputils.ErrorOut(w, http.StatusBadRequest, incorrectBlock)
		return
	}

	w.Header().Set("Content-Type", "application/binary")
	w.WriteHeader(http.StatusOK)
	_, _ = w.Write(block)
}
// GetMessageBlock will return a message block
GetMessageBlock will return a message block
// GetMessageBlock will return a message block
func GetMessageBlock(w http.ResponseWriter, req *http.Request) {
	haddr, err := hash.NewFromHash(mux.Vars(req)["addr"])
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, accountNotFound)
		return
	}
	messageID := mux.Vars(req)["message"]
	blockID := mux.Vars(req)["block"]
	ar := container.Instance.GetAccountRepo()
	block, err := ar.FetchMessageBlock(*haddr, messageID, blockID)
	if err != nil {
		httputils.ErrorOut(w, http.StatusBadRequest, incorrectBlock)
		return
	}
	w.Header().Set("Content-Type", "application/binary")
	w.WriteHeader(http.StatusOK)
	_, _ = w.Write(block)
}
func GetMessageBlock ( w http . ResponseWriter , req * http . Request ) { haddr , err := hash . NewFromHash ( mux . Vars ( req ) [ " " ] ) if err != nil { httputils . ErrorOut ( w , http . StatusNotFound , accountNotFound ) return } messageID := mux . Vars ( req ) [ " " ] blockID := mux . Vars ( req ) [ " " ] ar := container . Instance . GetAccountRepo ( ) block , err := ar . FetchMessageBlock ( * haddr , messageID , blockID ) if err != nil { httputils . ErrorOut ( w , http . StatusBadRequest , incorrectBlock ) return } w . Header ( ) . Set ( " " , " " ) w . WriteHeader ( http . StatusOK ) _ , _ = w . Write ( block ) }
GetMessageBlock will return a message block
GetMessageBlock will return a message block