Merge pull request #1767 from nuttycom/fix/sqlite_pk_i64

Minor fix for sqlite primary key in-memory representation.
This commit is contained in:
Kris Nuttycombe 2025-04-30 18:08:38 -06:00 committed by GitHub
commit 4acb6f59f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -224,7 +224,7 @@ impl AccountUuid {
/// This is an ephemeral value for efficiently and generically working with accounts in a
/// [`WalletDb`]. To reference accounts in external contexts, use [`AccountUuid`].
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Default, PartialOrd, Ord)]
pub(crate) struct AccountRef(u32);
pub(crate) struct AccountRef(i64);
/// This implementation is retained under `#[cfg(test)]` for pre-AccountUuid testing.
#[cfg(test)]

View File

@ -84,7 +84,7 @@ pub(super) fn insert_initial_transparent_addrs<P: consensus::Parameters>(
":key_scope_external": KeyScope::EXTERNAL.encode()
])?;
while let Some(row) = min_addr_rows.next()? {
let account_id = AccountRef(row.get::<_, u32>("account_id")?);
let account_id = AccountRef(row.get("account_id")?);
let min_transparent_idx = row
.get::<_, Option<u32>>("transparent_child_index")?
@ -716,7 +716,7 @@ impl<P: consensus::Parameters, C: Clock, R: RngCore> RusqliteMigration for Migra
generate_gap_addresses(
conn,
&self.params,
AccountRef(account_id.try_into().unwrap()),
AccountRef(account_id),
key_scope,
&GapLimits::default(),
UnifiedAddressRequest::unsafe_custom(Allow, Allow, Require),