Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseAbram committed Jul 11, 2024
1 parent 5fcacb0 commit 8917d32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/threshold-signature-server/src/user/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pub async fn sign_tx(

check_stale(user_sig_req.block_number, block_number).await?;
// Probably impossible but block signing from parent key anyways
if user_sig_req.signature_verifying_key.encode() == NETWORK_PARENT_KEY.encode() {
if user_sig_req.signature_verifying_key == NETWORK_PARENT_KEY.encode() {
return Err(UserErr::NoSigningFromMasterKey);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/threshold-signature-server/src/user/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub enum UserErr {
EncryptionOrAuthentication(#[from] EncryptedSignedMessageErr),
#[error("Custom hash choice out of bounds")]
CustomHashOutOfBounds,
#[error("No signing from master key")]
#[error("No signing from parent key")]
NoSigningFromMasterKey,
#[error("Listener: {0}")]
Listener(#[from] entropy_protocol::errors::ListenerErr),
Expand Down
9 changes: 5 additions & 4 deletions crates/threshold-signature-server/src/user/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use entropy_protocol::{
use entropy_shared::{
HashingAlgorithm, KeyVisibility, OcwMessageDkg, DAVE_VERIFYING_KEY, DEFAULT_VERIFYING_KEY,
DEFAULT_VERIFYING_KEY_NOT_REGISTERED, DEVICE_KEY_HASH, EVE_VERIFYING_KEY, FERDIE_VERIFYING_KEY,
NETWORK_PARENT_KEY,
};
use entropy_testing_utils::{
chain_api::{
Expand Down Expand Up @@ -364,15 +365,15 @@ async fn test_sign_tx_no_chain() {
}

generic_msg.block_number = rpc.chain_get_header(None).await.unwrap().unwrap().number;
generic_msg.signature_verifying_key = H256::zero().0.to_vec();
generic_msg.signature_verifying_key = NETWORK_PARENT_KEY.0.to_vec();
let test_user_sign_with_parent_key = submit_transaction_requests(
vec![validator_ips_and_keys[1].clone()],
generic_msg.clone(),
one,
)
.await;
for res in test_user_sign_with_parent_key {
assert_eq!(res.unwrap().text().await.unwrap(), "No signing from master key");
assert_eq!(res.unwrap().text().await.unwrap(), "No signing from parent key");
}
clean_tests();
}
Expand Down Expand Up @@ -840,7 +841,7 @@ async fn test_jumpstart_network() {
let block_hash = rpc.chain_get_block_hash(None).await.unwrap();
let events = EventsClient::new(api.clone()).at(block_hash.unwrap()).await.unwrap();
let jump_start_event = events.find::<entropy::registry::events::FinishedNetworkJumpStart>();
for event in jump_start_event.flatten() {
for _event in jump_start_event.flatten() {
break;
}
}
Expand Down Expand Up @@ -2026,7 +2027,7 @@ async fn test_mutiple_confirm_done() {
.await;

let (signer_alice, _) = get_signer_and_x25519_secret_from_mnemonic(DEFAULT_MNEMONIC).unwrap();
let parent_key = H256::zero().encode();

confirm_registered(
&api,
&rpc,
Expand Down

0 comments on commit 8917d32

Please sign in to comment.