Conversation
roles/translator/src/lib/mod.rs
Outdated
| match serde_json::from_str::<HashMap<String, String>>(&body) { | ||
| Ok(mapping) => mapping, |
There was a problem hiding this comment.
| match serde_json::from_str::<HashMap<String, String>>(&body) { | |
| Ok(mapping) => mapping, | |
| match serde_json::from_str::<serde_json::Value>(&body) { | |
| Ok(json) => { | |
| let mut result = HashMap::new(); | |
| if let Some(quote_ids) = json.get("quote_ids").and_then(|v| v.as_object()) { | |
| for (k, v) in quote_ids { | |
| if let Some(uuid) = v.as_str() { | |
| result.insert(k.clone(), uuid.to_string()); | |
| } | |
| } | |
| } | |
| result | |
| } |
There was a problem hiding this comment.
I updated the CDK wallet client to support the new route so we may be able to avoid this whole serde block. I'm still testing it locally but I'll push up the changes so you can take a look.
|
You don't need to add redis to all the example toml files. If you look here in devenv.nix you can see which toml we actually use: I've been working on a hashpool global config file. Check out how I imported the redis URL in the We should do something similar in the translator
|
|
I just updated global config to work with an import. It only has redis configs for now but this is the new home for any shared config between roles. |
|
I just rebased master into this branch and wow it was rough. I got it working but I didn't like the way it reassigned your commits to me. That would bother me if I was a contributor so I made this fork with the working code after rebase. https://github.com/vnprc/hashpool/tree/pikacchu-rebase We can proceed however you want. If you don't care about the commit author field and want to make forward progress on the project the fastest thing is probably for me to force push this up to the master branch. The commit messages are kind of inaccurate now but as long as it works we can roll forward. If you want to take this as a learning opportunity you can use this branch as a reference to do the rebase yourself. You'll definitely learn more this way. I'd probably take this path, but it's up to you. |
|
Closing in favor of #48 as this branch has conflicts and the git history will be cleaner with the other PR. |
Note: this is dependent on a proposed change to CDK.
Addresses #45
This PR adds a method for fetching a batch of quote IDs from the mint via an HTTP Get request instead of reading from Redis directly.
Steps to get it running:
export CDK_PATH=/path/to/cdk/repo/crates/cdk/just local-cdkcdk-axum = { path = "$CDK_PATH/cdk-axum", features = ["redis"] }devenv upI'm still testing this before I open a full PR, but it runs locally. We should also consider updating the CDK wallet client so that we don't have to hardcode the mint URL and path here. Opening this draft now for early feedback!