From 88e9ad95ac26d05f30c7d96ec19983030d56cdac Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 4 Apr 2024 16:49:51 +0000 Subject: [PATCH 1/5] Fix ReferenceScrit model. --- src/client/transactions.rs | 4 ++-- src/models/addresses.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/transactions.rs b/src/client/transactions.rs index 8fcf4c9..1b92a8a 100644 --- a/src/client/transactions.rs +++ b/src/client/transactions.rs @@ -54,11 +54,11 @@ impl Maestro { params: Option>, ) -> Result> { let formatted_params = params.map_or("".to_string(), |p| { - p.iter() + "?".to_string() + p.iter() .map(|(k, v)| format!("{}={}", k, v)) .collect::>() .join("&") - .to_string() + .as_str() }); let url = format!( "/transactions/{}/outputs/{}/txo{}", diff --git a/src/models/addresses.rs b/src/models/addresses.rs index 755c35e..6c09d4f 100644 --- a/src/models/addresses.rs +++ b/src/models/addresses.rs @@ -95,7 +95,7 @@ pub struct Utxo { pub struct ReferenceScript { pub bytes: String, pub hash: String, - pub json: HashMap, + pub json: Option>, pub r#type: String, } From 6e33b1ca043fb7db79d977ffd686b920d63a2e48 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 4 Apr 2024 16:52:46 +0000 Subject: [PATCH 2/5] FixUtxo model. --- src/models/addresses.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/models/addresses.rs b/src/models/addresses.rs index 6c09d4f..2bde342 100644 --- a/src/models/addresses.rs +++ b/src/models/addresses.rs @@ -87,7 +87,6 @@ pub struct Utxo { pub index: i64, pub reference_script: ReferenceScript, pub tx_hash: String, - pub slot: i64, pub tx_out_cbor: String, } From 84f8bfe703b75b856937bace60a36a8f5761c24f Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 4 Apr 2024 16:55:29 +0000 Subject: [PATCH 3/5] Fix Utxo model txout_cbor. --- src/models/addresses.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/addresses.rs b/src/models/addresses.rs index 2bde342..9a17090 100644 --- a/src/models/addresses.rs +++ b/src/models/addresses.rs @@ -87,7 +87,7 @@ pub struct Utxo { pub index: i64, pub reference_script: ReferenceScript, pub tx_hash: String, - pub tx_out_cbor: String, + pub txout_cbor: String, } #[derive(Deserialize)] From ea20b362bd16faf3636d8709d564af7d05de85e8 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 4 Apr 2024 16:57:50 +0000 Subject: [PATCH 4/5] Fix Utxo model add alias for tx_out_cbor. --- src/models/addresses.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/models/addresses.rs b/src/models/addresses.rs index 9a17090..2278b38 100644 --- a/src/models/addresses.rs +++ b/src/models/addresses.rs @@ -87,7 +87,8 @@ pub struct Utxo { pub index: i64, pub reference_script: ReferenceScript, pub tx_hash: String, - pub txout_cbor: String, + #[serde(alias="txout_cbor")] + pub tx_out_cbor: String, } #[derive(Deserialize)] From 8593c0496eb86606ceb429286e2e98f96ce109c5 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 5 Apr 2024 09:29:31 +0000 Subject: [PATCH 5/5] Fix structure Utxo, make reference_script optional. --- src/models/addresses.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/addresses.rs b/src/models/addresses.rs index 2278b38..56d2f7d 100644 --- a/src/models/addresses.rs +++ b/src/models/addresses.rs @@ -85,7 +85,7 @@ pub struct Utxo { pub assets: Vec, pub datum: Option>, pub index: i64, - pub reference_script: ReferenceScript, + pub reference_script: Option, pub tx_hash: String, #[serde(alias="txout_cbor")] pub tx_out_cbor: String,