contracts: Removed mixnode location from the bonding process

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
This commit is contained in:
Bogdan-Ștefan Neacșu
2021-06-28 15:10:57 +03:00
parent bb0257ccc6
commit a82ac9c50d
5 changed files with 3 additions and 12 deletions
-1
View File
@@ -14,7 +14,6 @@ pub struct MixNode {
pub verloc_port: u16,
pub http_api_port: u16,
pub layer: u64,
pub location: String,
pub sphinx_key: SphinxKey,
/// Base58 encoded ed25519 EdDSA public key.
pub identity_key: IdentityKey,
-3
View File
@@ -216,7 +216,6 @@ mod message_receiver {
vec![mix::Node {
owner: "foomp1".to_string(),
stake: 123,
location: "unknown".to_string(),
host: "10.20.30.40".parse().unwrap(),
mix_host: "10.20.30.40:1789".parse().unwrap(),
identity_key: identity::PublicKey::from_base58_string(
@@ -237,7 +236,6 @@ mod message_receiver {
vec![mix::Node {
owner: "foomp2".to_string(),
stake: 123,
location: "unknown".to_string(),
host: "11.21.31.41".parse().unwrap(),
mix_host: "11.21.31.41:1789".parse().unwrap(),
identity_key: identity::PublicKey::from_base58_string(
@@ -258,7 +256,6 @@ mod message_receiver {
vec![mix::Node {
owner: "foomp3".to_string(),
stake: 123,
location: "unknown".to_string(),
host: "12.22.32.42".parse().unwrap(),
mix_host: "12.22.32.42:1789".parse().unwrap(),
identity_key: identity::PublicKey::from_base58_string(
+3 -4
View File
@@ -289,7 +289,6 @@ mod converting_mixes_to_vec {
let node1 = mix::Node {
owner: "N/A".to_string(),
stake: 0,
location: "London".to_string(),
host: "3.3.3.3".parse().unwrap(),
mix_host: "3.3.3.3:1789".parse().unwrap(),
identity_key: identity::PublicKey::from_base58_string(
@@ -305,12 +304,12 @@ mod converting_mixes_to_vec {
};
let node2 = mix::Node {
location: "Thunder Bay".to_string(),
owner: "Alice".to_string(),
..node1.clone()
};
let node3 = mix::Node {
location: "Warsaw".to_string(),
owner: "Bob".to_string(),
..node1.clone()
};
@@ -320,7 +319,7 @@ mod converting_mixes_to_vec {
let topology = NymTopology::new(mixes, vec![]);
let mixvec = topology.mixes_as_vec();
assert!(mixvec.iter().any(|node| node.location == "London"));
assert!(mixvec.iter().any(|node| node.owner == "N/A"));
}
}
-2
View File
@@ -83,7 +83,6 @@ pub struct Node {
// somebody correct me if I'm wrong, but we should only ever have a single denom of currency
// on the network at a type, right?
pub stake: u128,
pub location: String,
pub host: NetworkAddress,
// we're keeping this as separate resolved field since we do not want to be resolving the potential
// hostname every time we want to construct a path via this node
@@ -137,7 +136,6 @@ impl<'a> TryFrom<&'a MixNodeBond> for Node {
.first()
.map(|stake| stake.amount.into())
.unwrap_or(0),
location: bond.mix_node.location.clone(),
host,
mix_host,
identity_key: identity::PublicKey::from_base58_string(&bond.mix_node.identity_key)?,
-2
View File
@@ -111,7 +111,6 @@ pub mod helpers {
verloc_port: 1790,
http_api_port: 8000,
layer: 1,
location: "Sweden".to_string(),
sphinx_key: "sphinx".to_string(),
identity_key: "identity".to_string(),
version: "0.10.0".to_string(),
@@ -125,7 +124,6 @@ pub mod helpers {
verloc_port: 1790,
http_api_port: 8000,
layer: 1,
location: "London".to_string(),
sphinx_key: "1234".to_string(),
identity_key: "aaaa".to_string(),
version: "0.10.0".to_string(),