Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes a bug where (Signal) receiver_receipts could not be decoded with view_only FS. #958

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions full-service/src/db/txo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use diesel::{
dsl::{count, exists, not},
prelude::*,
};
use mc_account_keys::{AccountKey, PublicAddress};
use mc_account_keys::{ViewAccountKey, AccountKey, PublicAddress};
use mc_common::{logger::global_log, HashMap};
use mc_crypto_digestible::{Digestible, MerlinTranscript};
use mc_crypto_keys::{CompressedRistrettoPublic, RistrettoPublic};
Expand Down Expand Up @@ -1953,7 +1953,7 @@ impl TxoModel for Txo {
let txo = Txo::get(txo_id_hex, conn)?;
let public_key: RistrettoPublic = mc_util_serial::decode(&txo.public_key)?;
let account = Account::get(account_id, conn)?;
let account_key: AccountKey = mc_util_serial::decode(&account.account_key)?;
let account_key: ViewAccountKey = mc_util_serial::decode(&account.account_key)?;
Ok(confirmation.validate(&public_key, account_key.view_private_key()))
}

Expand Down
4 changes: 2 additions & 2 deletions full-service/src/service/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
WalletService,
};
use displaydoc::Display;
use mc_account_keys::AccountKey;
use mc_account_keys::ViewAccountKey;
use mc_connection::{BlockchainConnection, UserTxConnection};
use mc_crypto_keys::{CompressedRistrettoPublic, RistrettoPublic};
use mc_fog_report_validation::FogPubkeyResolver;
Expand Down Expand Up @@ -237,7 +237,7 @@ where
}

// Decrypt the amount to get the expected value
let account_key: AccountKey = mc_util_serial::decode(&account.account_key)?;
let account_key: ViewAccountKey = mc_util_serial::decode(&account.account_key)?;
let public_key: RistrettoPublic = RistrettoPublic::try_from(&receiver_receipt.public_key)?;
let shared_secret = get_tx_out_shared_secret(account_key.view_private_key(), &public_key);
let expected_value = match receiver_receipt.amount.get_value(&shared_secret) {
Expand Down