1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

bugfixed + crypto update

- compiles vs BoringSSL
- config proposal/vote fift code
- bugfixes in catchain
- other small fixes
This commit is contained in:
ton 2020-03-27 18:59:00 +04:00
parent 606e970ed5
commit a31f8d4424
39 changed files with 722 additions and 132 deletions

View file

@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include <algorithm>
#include <string>
@ -580,7 +580,7 @@ bool check_exp(std::ostream& stream, const td::NegExpBinTable& tab, double x) {
}
double y = yy.to_double() * exp2(-252);
double y0 = exp(x);
bool ok = (abs(y - y0) < 1e-15);
bool ok = (fabs(y - y0) < 1e-15);
if (!ok) {
stream << "exp(" << x << ") = exp(" << xx << " * 2^(-52)) = " << yy << " / 2^252 = " << y << " (correct value is "
<< y0 << ") " << (ok ? "match" : "incorrect") << std::endl;

View file

@ -52,6 +52,8 @@
#include <openssl/sha.h>
#include "openssl/digest.hpp"
namespace vm {
std::vector<int> do_get_serialization_modes() {

View file

@ -331,11 +331,12 @@ TEST(Tonlib, HighloadWallet) {
td::Ed25519::PrivateKey priv_key{td::SecureString{new_wallet_pk}};
auto pub_key = priv_key.get_public_key().move_as_ok();
auto init_state = ton::HighloadWallet::get_init_state(pub_key, 239);
auto init_state = ton::HighloadWallet::get_init_state(pub_key, 239, -1);
auto init_message = ton::HighloadWallet::get_init_message(priv_key, 239);
auto address = ton::GenericAccount::get_address(0, init_state);
ton::HighloadWallet wallet({ton::HighloadWallet::get_init_code(), ton::HighloadWallet::get_init_data(pub_key, 239)});
ton::HighloadWallet wallet(
{ton::HighloadWallet::get_init_code(-1), ton::HighloadWallet::get_init_data(pub_key, 239)});
ASSERT_EQ(239u, wallet.get_wallet_id().ok());
ASSERT_EQ(0u, wallet.get_seqno().ok());
CHECK(pub_key.as_octet_string() == wallet.get_public_key().ok().as_octet_string());