浏览代码

walletdb: fixed get_token_id test

lunar-mining 4 年之前
父节点
当前提交
5cae0cf6e0
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      src/wallet/walletdb.rs

+ 6 - 5
src/wallet/walletdb.rs

@@ -462,13 +462,14 @@ mod tests {
         wallet.put_own_coins(own_coin.clone())?;
         wallet.put_own_coins(own_coin.clone())?;
 
-        let token_id = wallet.get_token_id()?;
+        let id = wallet.get_token_id()?;
 
-        assert_eq!(token_id.len(), 4);
-        //assert_eq!(token_id[0], token_id);
-        //assert_eq!(token_id[2], token_id);
+        assert_eq!(id.len(), 4);
 
-        //assert!(wallet.token_id_exists(&token_id)?);
+        for i in id {
+            assert_eq!(i, token_id);
+            assert!(wallet.token_id_exists(&i)?);
+        }
 
         std::fs::remove_file(walletdb_path)?;