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

chore: fix build and osp #6415

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 1 deletion base_layer/core/src/transactions/key_manager/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ where TBackend: KeyManagerBackend<PublicKey> + 'static
let index = 0;

match self.wallet_type {
WalletType::Software | WalletType::Imported(_) => {
WalletType::DerivedKeys | WalletType::ProvidedKeys(_) => {
self.get_private_key(&TariKeyId::Managed {
branch: branch.clone(),
index,
Expand Down
29 changes: 16 additions & 13 deletions base_layer/wallet/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,18 @@ where
} else {
None
};

persist_one_sided_payment_script_for_node_identity(&mut output_manager_handle, &node_identity)
.await
.map_err(|e| {
error!(target: LOG_TARGET, "{:?}", e);
e
})?;
let spend_key = key_manager_handle.get_spend_key().await?;

persist_one_sided_payment_script_for_node_identity(
&mut output_manager_handle,
&spend_key.pub_key,
spend_key.key_id,
)
.await
.map_err(|e| {
error!(target: LOG_TARGET, "{:?}", e);
e
})?;

wallet_database.set_node_features(comms.node_identity().features())?;
let identity_sig = comms.node_identity().identity_signature_read().as_ref().cloned();
Expand Down Expand Up @@ -835,18 +840,16 @@ pub fn derive_comms_secret_key(master_seed: &CipherSeed) -> Result<CommsSecretKe
/// using old node identities.
async fn persist_one_sided_payment_script_for_node_identity(
output_manager_service: &mut OutputManagerHandle,
node_identity: &Arc<NodeIdentity>,
spend_key: &PublicKey,
spend_key_id: TariKeyId,
) -> Result<(), WalletError> {
let script = push_pubkey_script(node_identity.public_key());
let wallet_node_key_id = TariKeyId::Imported {
key: node_identity.public_key().clone(),
};
let script = push_pubkey_script(spend_key);
let known_script = KnownOneSidedPaymentScript {
script_hash: script
.as_hash::<Blake2b<U32>>()
.map_err(|e| WalletError::OutputManagerError(OutputManagerError::ScriptError(e)))?
.to_vec(),
script_key_id: wallet_node_key_id.clone(),
script_key_id: spend_key_id,
script,
input: ExecutionStack::default(),
script_lock_height: 0,
Expand Down
Loading