Browse Source

Add a separate struct that holds a bandwidth information

develop
Silvestr Predko 2 years ago
parent
commit
87b90f2511
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      common-api/src/api.rs

+ 9
- 2
common-api/src/api.rs View File

1
 use crate::crypto::prelude::*;
1
 use crate::crypto::prelude::*;
2
+use borsh::{BorshDeserialize, BorshSerialize};
2
 use near_account_id::AccountId;
3
 use near_account_id::AccountId;
3
 use serde::{Deserialize, Serialize};
4
 use serde::{Deserialize, Serialize};
4
 use std::{collections::HashSet, time::Duration};
5
 use std::{collections::HashSet, time::Duration};
27
     pub account_id: AccountId,
28
     pub account_id: AccountId,
28
 }
29
 }
29
 
30
 
30
-#[derive(Clone, Debug, Serialize, Deserialize)]
31
+#[derive(Clone, Debug, Serialize, Deserialize, BorshSerialize, BorshDeserialize)]
32
+pub struct Bandwidth {
33
+    pub speed: u32,
34
+    pub units: String,
35
+}
36
+
37
+#[derive(Clone, Debug, Serialize, Deserialize, BorshSerialize, BorshDeserialize)]
31
 pub struct NodeInfo {
38
 pub struct NodeInfo {
32
     pub region: String,
39
     pub region: String,
33
-    pub bandwidth: String,
40
+    pub bandwidth: Bandwidth,
34
     pub account_id: AccountId,
41
     pub account_id: AccountId,
35
 }
42
 }

Loading…
Cancel
Save