-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove legacy router and primitives
- Loading branch information
Showing
11 changed files
with
73 additions
and
338 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,15 +20,6 @@ pub struct PaymentRequest { | |
pub hash: String, // TODO use sha256::Hash | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Default)] | ||
pub struct PostMintResponse { | ||
pub promises: Vec<BlindedSignature>, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub struct PostMintRequest { | ||
pub outputs: Vec<BlindedMessage>, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub struct CheckFeesRequest { | ||
|
@@ -41,36 +32,6 @@ pub struct CheckFeesResponse { | |
pub fee: u64, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub struct PostMeltRequest { | ||
pub proofs: Proofs, | ||
pub pr: String, | ||
pub outputs: Vec<BlindedMessage>, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Default)] | ||
pub struct PostMeltResponse { | ||
pub paid: bool, | ||
pub preimage: String, | ||
pub change: Vec<BlindedSignature>, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub struct PostSplitRequest { | ||
pub proofs: Proofs, | ||
pub outputs: Vec<BlindedMessage>, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Default)] | ||
pub struct PostSplitResponse { | ||
pub promises: Vec<BlindedSignature>, | ||
} | ||
|
||
impl PostSplitResponse { | ||
pub fn with_promises(promises: Vec<BlindedSignature>) -> Self { | ||
Self { promises } | ||
} | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)] | ||
pub struct PostSwapRequest { | ||
|
@@ -89,24 +50,7 @@ pub struct CashuErrorResponse { | |
pub detail: String, | ||
} | ||
|
||
#[skip_serializing_none] | ||
#[derive(Deserialize, Serialize, Debug, PartialEq, Eq)] | ||
pub struct MintLegacyInfoResponse { | ||
pub name: Option<String>, | ||
pub pubkey: PublicKey, | ||
pub version: Option<String>, | ||
pub description: Option<String>, | ||
pub description_long: Option<String>, | ||
pub contact: Option<Vec<Vec<String>>>, | ||
pub nuts: Vec<String>, | ||
pub motd: Option<String>, | ||
pub parameter: Parameter, | ||
} | ||
|
||
#[derive(Deserialize, Serialize, Debug, PartialEq, Eq, Default)] | ||
pub struct Parameter { | ||
pub peg_out_only: bool, | ||
} | ||
|
||
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq, Default, ToSchema)] | ||
pub struct KeysResponse { | ||
|
@@ -581,7 +525,7 @@ mod tests { | |
dhke::public_key_from_hex, | ||
fixture::read_fixture, | ||
primitives::{ | ||
KeyResponse, MintInfoResponse, MintLegacyInfoResponse, Nuts, Parameter, | ||
KeyResponse, MintInfoResponse, Nuts, | ||
PostSwapResponse, | ||
}, | ||
}; | ||
|
@@ -606,37 +550,7 @@ mod tests { | |
Ok(()) | ||
} | ||
|
||
#[test] | ||
fn test_deserialize_legacy_mint_info() -> anyhow::Result<()> { | ||
let mint_info = MintLegacyInfoResponse { | ||
name: Some("Bob's Cashu mint".to_string()), | ||
pubkey: public_key_from_hex( | ||
"02a9acc1e48c25eeeb9289b5031cc57da9fe72f3fe2861d264bdc074209b107ba2", | ||
), | ||
version: Some("Nutshell/0.11.0".to_string()), | ||
description: Some("The short mint description".to_string()), | ||
description_long: Some("A description that can be a long piece of text.".to_string()), | ||
contact: Some(vec![ | ||
vec!["email".to_string(), "[email protected]".to_string()], | ||
vec!["twitter".to_string(), "@me".to_string()], | ||
vec!["nostr".to_string(), "npub...".to_string()], | ||
]), | ||
nuts: vec![ | ||
"NUT-07".to_string(), | ||
"NUT-08".to_string(), | ||
"NUT-08".to_string(), | ||
], | ||
motd: Some("Message to display to users.".to_string()), | ||
parameter: Parameter { | ||
peg_out_only: false, | ||
}, | ||
}; | ||
let out = serde_json::to_string_pretty(&mint_info)?; | ||
println!("{}", out); | ||
assert!(!out.is_empty()); | ||
|
||
Ok(()) | ||
} | ||
|
||
|
||
#[test] | ||
fn test_deserialize_mint_info() -> anyhow::Result<()> { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rc/fixtures/post_split_request_64_20.json → ...src/fixtures/post_swap_request_64_20.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"proofs": [ | ||
"inputs": [ | ||
{ | ||
"amount": 64, | ||
"secret": "sYYrrhUD3IwJzGFCGsUqqXXa", | ||
|
2 changes: 1 addition & 1 deletion
2
...res/post_split_request_duplicate_key.json → ...ures/post_swap_request_duplicate_key.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"proofs": [ | ||
"inputs": [ | ||
{ | ||
"amount": 64, | ||
"secret": "sYYrrhUD3IwJzGFCGsUqqXXa", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.