Просмотр исходного кода

drk: dao_name is TEXT instead of BLOB

x 3 лет назад
Родитель
Сommit
348e3a8a1e
1 измененных файлов с 6 добавлено и 8 удалено
  1. 6 8
      bin/drk/src/wallet_dao.rs

+ 6 - 8
bin/drk/src/wallet_dao.rs

@@ -432,7 +432,7 @@ impl Drk {
             query,
             query,
             QueryType::Integer as u8,
             QueryType::Integer as u8,
             DAO_DAOS_COL_DAO_ID,
             DAO_DAOS_COL_DAO_ID,
-            QueryType::Blob as u8,
+            QueryType::Text as u8,
             DAO_DAOS_COL_NAME,
             DAO_DAOS_COL_NAME,
         ]);
         ]);
 
 
@@ -450,8 +450,7 @@ impl Drk {
                     anyhow!("[get_dao_id_by_alias] Unexpected response from darkfid: {}", rep))
                     anyhow!("[get_dao_id_by_alias] Unexpected response from darkfid: {}", rep))
             };
             };
 
 
-            let alias_bytes: Vec<u8> = serde_json::from_value(row[1].clone())?;
-            let alias: String = deserialize(&alias_bytes)?;
+            let alias: String = serde_json::from_value(row[1].clone())?;
             if alias != alias_filter {
             if alias != alias_filter {
                 continue
                 continue
             }
             }
@@ -496,8 +495,8 @@ impl Drk {
 
 
         let params = json!([
         let params = json!([
             query,
             query,
-            QueryType::Blob as u8,
-            serialize(&dao_name),
+            QueryType::Text as u8,
+            dao_name,
             QueryType::Blob as u8,
             QueryType::Blob as u8,
             serialize(&dao_params.proposer_limit),
             serialize(&dao_params.proposer_limit),
             QueryType::Blob as u8,
             QueryType::Blob as u8,
@@ -563,7 +562,7 @@ impl Drk {
             query,
             query,
             QueryType::Integer as u8,
             QueryType::Integer as u8,
             DAO_DAOS_COL_DAO_ID,
             DAO_DAOS_COL_DAO_ID,
-            QueryType::Blob as u8,
+            QueryType::Text as u8,
             DAO_DAOS_COL_NAME,
             DAO_DAOS_COL_NAME,
             QueryType::Blob as u8,
             QueryType::Blob as u8,
             DAO_DAOS_COL_PROPOSER_LIMIT,
             DAO_DAOS_COL_PROPOSER_LIMIT,
@@ -603,8 +602,7 @@ impl Drk {
 
 
             let id: u64 = serde_json::from_value(row[0].clone())?;
             let id: u64 = serde_json::from_value(row[0].clone())?;
 
 
-            let name_bytes: Vec<u8> = serde_json::from_value(row[1].clone())?;
-            let name = deserialize(&name_bytes)?;
+            let name: String = serde_json::from_value(row[1].clone())?;
 
 
             let proposer_limit_bytes: Vec<u8> = serde_json::from_value(row[2].clone())?;
             let proposer_limit_bytes: Vec<u8> = serde_json::from_value(row[2].clone())?;
             let proposer_limit = deserialize(&proposer_limit_bytes)?;
             let proposer_limit = deserialize(&proposer_limit_bytes)?;