Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
### Fixes

* [FIX][rust] Added validation of cached transaction encryption keys during deserialization. Unsupported encryption schemes and empty or oversized key IDs are rejected before reading the key ID bytes ([#2411](https://github.com/0xMiden/rust-sdk/pull/2411)).
* [FIX][cli] `notes --list consumable` now respects the `--account-id` filter ([#2449](https://github.com/0xMiden/rust-sdk/pull/2449)).
* [store] Simplified `SqliteStore::get_setting` to take `&Connection` directly without opening an unnecessary transaction ([#2449](https://github.com/0xMiden/rust-sdk/pull/2449)).
* [FIX][cli] `miden-client import` now rejects invocations without a file path instead of silently succeeding ([#2450](https://github.com/0xMiden/rust-sdk/pull/2450)).
* [FIX][rust] `TransactionRequestBuilder::build_swap` and `build_pswap_create` now reject a zero-amount asset on either side of the exchange. A zero requested asset produced a payback P2ID note carrying nothing, and a zero offered asset produced a note whose consumer pays and receives nothing ([#2459](https://github.com/0xMiden/rust-sdk/pull/2459)).

Expand Down
2 changes: 1 addition & 1 deletion bin/miden-cli/src/commands/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ async fn encode_address<AUTH>(
let routing_params = match tag_len {
Some(tag_len) => RoutingParameters::new(interface)
.with_note_tag_len(tag_len)
.map_err(|e| CliError::Address(e, String::new()))?,
.map_err(|e| CliError::Address(e, format!("invalid tag_len {tag_len}")))?,
None => RoutingParameters::new(interface),
};
let address = Address::new(account_id).with_routing_parameters(routing_params);
Expand Down
8 changes: 6 additions & 2 deletions bin/miden-cli/src/commands/notes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ impl NotesCmd {
mut client: Client<AUTH>,
) -> Result<(), CliError> {
match self {
NotesCmd { list: Some(NoteFilter::Consumable), .. } => {
list_consumable_notes(client, None).await?;
NotesCmd {
list: Some(NoteFilter::Consumable),
account_id,
..
} => {
list_consumable_notes(client, account_id.as_ref()).await?;
},
NotesCmd { list: Some(filter), .. } => {
list_notes(
Expand Down
18 changes: 8 additions & 10 deletions crates/sqlite-store/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ use crate::{insert_sql, subst};

impl SqliteStore {
pub(crate) fn get_setting<T: FromSql>(
conn: &mut Connection,
conn: &Connection,
scope: SettingScope,
name: &str,
) -> Result<Option<T>, StoreError> {
conn.transaction()
.into_store_error()?
.query_row(
"SELECT value FROM settings WHERE scope = $1 AND name = $2",
params![scope.as_u8(), name],
|row| row.get(0),
)
.optional()
.into_store_error()
conn.query_row(
"SELECT value FROM settings WHERE scope = $1 AND name = $2",
params![scope.as_u8(), name],
|row| row.get(0),
)
.optional()
.into_store_error()
}
Comment on lines 15 to 27

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the mut Connection and using a transaction aligns with set_setting and remove_setting, so it's also ok.


pub(crate) fn set_setting<T: ToSql>(
Expand Down
Loading