thesimplekid 1 rok temu
rodzic
commit
8b9959073f
3 zmienionych plików z 8 dodań i 6 usunięć
  1. 4 4
      integration_test/src/main.rs
  2. 3 1
      src/client.rs
  3. 1 1
      src/types.rs

+ 4 - 4
integration_test/src/main.rs

@@ -12,11 +12,11 @@ use lightning_invoice::Invoice;
 
 #[tokio::main]
 async fn main() {
-    let url = "https://legend.lnbits.com/cashu/api/v1/MWMnRmbewX92AHjcL55mRo/";
+    let url = "https:dev-cashu.thesimplekid.com";
     let client = Client::new(url).unwrap();
 
     // NUT-09
-    // test_get_mint_info(&mint).await;
+    test_get_mint_info(&client).await;
 
     let keys = test_get_mint_keys(&client).await;
     let wallet = CashuWallet::new(client.to_owned(), keys);
@@ -139,8 +139,8 @@ async fn test_melt(wallet: &CashuWallet, invoice: Invoice, proofs: Proofs) {
     println!("{:?}", res);
 }
 
-async fn _test_get_mint_info(mint: &Client) {
-    let _mint_info = mint.get_info().await.unwrap();
+async fn test_get_mint_info(mint: &Client) {
+    let mint_info = mint.get_info().await.unwrap();
 
     // println!("{:?}", mint_info);
 }

+ 3 - 1
src/client.rs

@@ -167,6 +167,8 @@ impl Client {
     /// Get Mint Info [NUT-09]
     pub async fn get_info(&self) -> Result<MintInfo, Error> {
         let url = self.mint_url.join("info")?;
-        Ok(minreq::get(url).send()?.json::<MintInfo>()?)
+        let res = minreq::get(url).send()?.json::<Value>()?;
+
+        Ok(serde_json::from_value(res)?)
     }
 }

+ 1 - 1
src/types.rs

@@ -301,7 +301,7 @@ pub struct MintInfo {
     /// long description
     pub description_long: String,
     /// contact methods to reach the mint operator
-    pub contact: HashMap<String, String>,
+    pub contact: Vec<Vec<String>>,
     /// shows which NUTs the mint supports
     pub nuts: Vec<String>,
     /// message of the day that the wallet must display to the user