From 84a927f20d5323e547348d59210a2e95239e3648 Mon Sep 17 00:00:00 2001 From: Michael Connor Date: Mon, 20 Feb 2023 09:23:39 +0000 Subject: [PATCH] add missing to_nt converts (#167) * add missing to_nt converts * Simplify `to_nt`. --------- Co-authored-by: Suyash Bagad --- cpp/src/barretenberg/stdlib/types/convert.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cpp/src/barretenberg/stdlib/types/convert.hpp b/cpp/src/barretenberg/stdlib/types/convert.hpp index c3bce8a9c8..6ffe8491b7 100644 --- a/cpp/src/barretenberg/stdlib/types/convert.hpp +++ b/cpp/src/barretenberg/stdlib/types/convert.hpp @@ -152,7 +152,7 @@ template typename NT::grumpkin_point to_nt(typename CT typename NT::bn254_point to_nt(typename CT::bn254_point const& e) { - return NT::bn254_point{ e.x.get_value(), e.y.get_value() }; + return e.get_value(); }; template @@ -178,6 +178,13 @@ std::optional to_nt(std::optional(to_nt(*e)) : std::nullopt; }; +template std::vector to_nt(std::vector::fr> const& vec) +{ + auto ref_to_nt = [&](typename CT::fr const& e) { return to_nt(e); }; + + return map(vec, ref_to_nt); +}; + template std::optional> to_nt(std::optional::fr>> const& vec) {