From ba79b1e4c664bef8ce04f1d7a406d6dd98d6cb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Wed, 14 May 2025 09:56:34 +0100 Subject: [PATCH] dont use deprecated fields --- nym-api/enter_db.sh | 2 +- nym-api/src/support/legacy_helpers.rs | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/nym-api/enter_db.sh b/nym-api/enter_db.sh index 39453ce20b..7d91be72bf 100755 --- a/nym-api/enter_db.sh +++ b/nym-api/enter_db.sh @@ -1,2 +1,2 @@ #!/bin/sh -sqlite3 -init settings.sql /Users/jedrzej/workspace/nym/target/debug/build/nym-api-3a0aa50356183aba/out/nym-api-example.sqlite \ No newline at end of file +sqlite3 -init settings.sql /Users/jedrzej/workspace/nym/target/debug/build/nym-api-6517e259cadeb663/out/nym-api-example.sqlite \ No newline at end of file diff --git a/nym-api/src/support/legacy_helpers.rs b/nym-api/src/support/legacy_helpers.rs index abc95b1b6d..430a73aad6 100644 --- a/nym-api/src/support/legacy_helpers.rs +++ b/nym-api/src/support/legacy_helpers.rs @@ -4,12 +4,12 @@ use nym_api_requests::legacy::{LegacyMixNodeBondWithLayer, LegacyMixNodeDetailsWithLayer}; use nym_api_requests::models::NymNodeData; use nym_config::defaults::DEFAULT_NYM_NODE_HTTP_PORT; -use nym_crypto::aes::cipher::crypto_common::rand_core::OsRng; use nym_mixnet_contract_common::mixnode::LegacyPendingMixNodeChanges; use nym_mixnet_contract_common::{ Gateway, GatewayBond, LegacyMixLayer, MixNode, MixNodeBond, NymNodeDetails, }; use rand::prelude::SliceRandom; +use rand::rngs::OsRng; use std::net::{IpAddr, ToSocketAddrs}; use std::str::FromStr; @@ -61,7 +61,12 @@ pub(crate) fn to_legacy_mixnode( .node .custom_http_port .unwrap_or(DEFAULT_NYM_NODE_HTTP_PORT), - sphinx_key: description.host_information.keys.x25519.to_base58_string(), + sphinx_key: description + .host_information + .keys + .current_x25519_sphinx_key + .public_key + .to_base58_string(), identity_key: nym_node.bond_information.node.identity_key.clone(), version: description.build_information.build_version.clone(), }, @@ -95,7 +100,12 @@ pub(crate) fn to_legacy_gateway( .location .map(|c| c.to_string()) .unwrap_or_default(), - sphinx_key: description.host_information.keys.x25519.to_base58_string(), + sphinx_key: description + .host_information + .keys + .current_x25519_sphinx_key + .public_key + .to_base58_string(), identity_key: nym_node.bond_information.node.identity_key.clone(), version: description.build_information.build_version.clone(), },