fix(cli, store): pass account_id filter to list_consumable_notes and simplify sqlite get_setting - #2449
Conversation
juan518munoz
left a comment
There was a problem hiding this comment.
All changes look ok, could you fix the conflicts and the CI please?
| NotesCmd { list: Some(NoteFilter::Consumable), account_id, .. } => { | ||
| list_consumable_notes(client, account_id.as_ref()).await?; |
There was a problem hiding this comment.
This is a genuine fix
| pub(crate) fn get_setting<T: FromSql>( | ||
| conn: &mut Connection, | ||
| conn: &Connection, | ||
| name: &str, | ||
| ) -> Result<Option<T>, StoreError> { | ||
| conn.transaction() | ||
| .into_store_error()? | ||
| .query_row("SELECT value FROM settings WHERE name = $1", params![name], |row| { | ||
| row.get(0) | ||
| }) | ||
| .optional() | ||
| .into_store_error() | ||
| conn.query_row("SELECT value FROM settings WHERE name = $1", params![name], |row| { | ||
| row.get(0) | ||
| }) | ||
| .optional() | ||
| .into_store_error() | ||
| } |
There was a problem hiding this comment.
Removing the mut Connection and using a transaction aligns with set_setting and remove_setting, so it's also ok.
1eaede7 to
4120b51
Compare
|
Rebased onto next to resolve the conflict with the new settings scope, and applied the suggested invalid tag_len wording. CI should run cleanly now. |
|
I have approved the CI workflows. Please add a changelog entry noting the fix. |
|
Also note that commits need to be signed to be able mergeable. |
4120b51 to
2c4ee53
Compare
…simplify sqlite get_setting
2c4ee53 to
3ab9313
Compare
|
Added the changelog entries under ## Unreleased -> ### Fixes, rebased onto the latest next, and signed the commit. |
|
Thanks! I have enabled the CI, please monitor that all checks succeed. |
In bin/miden-cli/src/commands/notes.rs, passed account_id.as_ref() to list_consumable_notes when listing consumable notes so the --account-id CLI filter is respected. In crates/sqlite-store/src/settings.rs, simplified get_setting to take &Connection and query directly without opening an unnecessary transaction for a SELECT query.