From a2ea3343c1b1c5a715030c8965e4390e9452e144 Mon Sep 17 00:00:00 2001 From: Stanimal Date: Fri, 10 Jun 2022 09:12:08 +0200 Subject: [PATCH] update wallet code --- .../output_manager_service/storage/sqlite_db/output_sql.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/base_layer/wallet/src/output_manager_service/storage/sqlite_db/output_sql.rs b/base_layer/wallet/src/output_manager_service/storage/sqlite_db/output_sql.rs index 1c5bb59703..523918b893 100644 --- a/base_layer/wallet/src/output_manager_service/storage/sqlite_db/output_sql.rs +++ b/base_layer/wallet/src/output_manager_service/storage/sqlite_db/output_sql.rs @@ -70,6 +70,7 @@ pub struct OutputSql { #[derivative(Debug = "ignore")] pub spending_key: Vec, pub value: i64, + // TODO: Rename this to output_type pub flags: i32, pub maturity: i64, pub recovery_byte: i32, @@ -123,8 +124,8 @@ impl OutputSql { tip_height: i64, conn: &SqliteConnection, ) -> Result, OutputManagerStorageError> { - let no_flags = i32::from(OutputFlags::empty().bits()); - let coinbase_flag = i32::from(OutputFlags::COINBASE_OUTPUT.bits()); + let no_flags = i32::from(OutputType::Standard.as_byte()); + let coinbase_flag = i32::from(OutputType::Coinbase.as_byte()); if strategy == UTXOSelectionStrategy::Default { // lets get the max value for all utxos @@ -511,7 +512,7 @@ impl TryFrom for DbUnblindedOutput { .flags .try_into() .map_err(|_| OutputManagerStorageError::ConversionError { - reason: format!("Unable to convert flag bits with value {} to OutputFlags", o.flags), + reason: format!("Unable to convert flag bits with value {} to OutputType", o.flags), })?; features.output_type = OutputType::from_byte(flags).ok_or(OutputManagerStorageError::ConversionError { reason: "Flags could not be converted from bits".to_string(),