Conversation
benthecarman
left a comment
There was a problem hiding this comment.
looking good so far!
|
also looks like you need to run |
f0fb430 to
c3b3d62
Compare
|
Added rest of endpoints. Need to fix this cargo doc failing |
204e7d2 to
a40f067
Compare
eb9e540 to
178cb22
Compare
benthecarman
left a comment
There was a problem hiding this comment.
Mostly looks good to me just some style things.
I think we will need to properly figure out the issue you had with the docs CI. When I try to run cargo check in the root of mutiny-node now I get issues. Probably will need to figure out correct ways to handle the per-package-target stuff
mutiny-server/src/routes.rs
Outdated
| let fees = match invoice.fees_paid { | ||
| Some(fee) => fee, | ||
| None => { | ||
| return Err(( | ||
| StatusCode::INTERNAL_SERVER_ERROR, | ||
| Json(json!({"error": "unable to pay invoice"})), | ||
| )) | ||
| } | ||
| }; |
There was a problem hiding this comment.
You do this style a bunch, it is cleaner to do let fees = invoice.fees_paid.ok_or((StatusCode::INTERNAL_SERVER_ERROR, Json(json!({"error": "unable to pay invoice"})))?
mutiny-server/src/routes.rs
Outdated
| true => "usable", | ||
| false => "unusable", |
There was a problem hiding this comment.
Can you make this into an enum?
0ef9077 to
9a99b93
Compare
mutiny-server/src/routes.rs
Outdated
| None => None, | ||
| }; | ||
|
|
||
| let pr = invoice.bolt11.clone().map(|bolt11| bolt11.to_string()); |
There was a problem hiding this comment.
you don't need this clone, can do as_ref() instead
mutiny-server/src/routes.rs
Outdated
| Some(bolt11) => Some(bolt11.to_string()), | ||
| None => None, | ||
| }; | ||
| let pr = invoice.bolt11.clone().map(|bolt11| bolt11.to_string()); |
21e13b1 to
6545820
Compare
55fec7e to
b6fece9
Compare
benthecarman
left a comment
There was a problem hiding this comment.
couple nits
Can you also add some commands to the just file? Make sure the clippy commands will run clippy for mutiny-server. Also would be good to add a somehting like just run-signet that will run mutiny server on signet with all the required params
mutiny-server/Cargo.toml
Outdated
| @@ -0,0 +1,29 @@ | |||
| [package] | |||
| name = "mutiny-server" | |||
| version = "0.3.7" | |||
There was a problem hiding this comment.
can you bump to 0.6.4
mutiny-server/src/main.rs
Outdated
| let config: Config = Config::parse(); | ||
|
|
||
| let network = config.network(); | ||
| let storage = SledStorage::new(&config.db_file, config.clone().password)?; |
There was a problem hiding this comment.
can instead do config.password.clone() here, that way you don't need to clone the entire config
| let state = match channel.is_usable { | ||
| true => ChannelState::Usable, | ||
| false => ChannelState::Unusable, | ||
| }; |
There was a problem hiding this comment.
instead of all this, can just have ChannelState impl Serialize, maybe just need to add the serde flag for all lowercase
a1dfbd6 to
8dc8981
Compare
|
Would like to figure out how to get the workspaces to work correctly. I can look into that more. Skimmed the structure and looks pretty sound. Will play with it more soon and can merge whenever the base looks good, can then can keep iterating on the commands. Nice work so far! |
|
Actually, I think we should use rocksdb instead of sleddb. |
6e46c9f to
0bfcdf8
Compare
this is a wip of mutiny-server
There are other endpoints I will need to add but I have basic ones working right now (open channel, create invoice, pay invoice, send to address)
I would appreciate any reviews of what I've done so far :)