From 38fe11bcdbb48d19d6115287ffd7984536e7dc46 Mon Sep 17 00:00:00 2001
From: Evgeniy Kramsakov <sobiegrus@gmail.com>
Date: Sat, 3 Sep 2022 19:50:12 +0300
Subject: [PATCH] [+] add todo tag for future work with scientific notation

---
 modules/common/dap_chain_common.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/common/dap_chain_common.c b/modules/common/dap_chain_common.c
index 963405a476..2491c7b8d8 100644
--- a/modules/common/dap_chain_common.c
+++ b/modules/common/dap_chain_common.c
@@ -765,8 +765,11 @@ uint256_t dap_cvt_str_to_uint256(const char *a_256bit_num)
         int l_exp_len = l_eptr - a_256bit_num - l_dot_len - 1;
         if (l_exp_len + l_dot_len + 1 >= SZ_MAX256SCINOT)
             return log_it(L_ERROR, "Too many digits in '%s'", a_256bit_num), uint256_0;
-        if (l_exp < l_exp_len)
-            return  log_it(L_ERROR, "Invalid number format with exponent %d and nuber coun after dot %d", l_exp, l_exp_len), uint256_0;
+        if (l_exp < l_exp_len) {
+            //todo: we need to handle numbers like 1.23456789000000e9
+            return log_it(L_ERROR, "Invalid number format with exponent %d and nuber coun after dot %d", l_exp,
+                          l_exp_len), uint256_0;
+        }
         memcpy(l_256bit_num, a_256bit_num, l_dot_len);
         memcpy(l_256bit_num + l_dot_len, a_256bit_num + l_dot_len + 1, l_exp_len);
         int l_zero_cnt = l_exp - l_exp_len;
-- 
GitLab