Skip to content

Commit

Permalink
Update client tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ameba23 committed Nov 21, 2024
1 parent 2583312 commit 07f87e0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions crates/client/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::{
update_programs,
};

use entropy_shared::{QuoteContext, QuoteInputData};
use entropy_testing_utils::{
constants::{TEST_PROGRAM_WASM_BYTECODE, TSS_ACCOUNTS, X25519_PUBLIC_KEYS},
helpers::encode_verifying_key,
Expand Down Expand Up @@ -54,11 +55,8 @@ async fn test_change_endpoint() {
let signing_key = tdx_quote::SigningKey::random(&mut OsRng);
let public_key = sr25519::Public(tss_account_id.0);

// We need to add `1` here since the quote is being checked in the next block
let block_number = rpc.chain_get_header(None).await.unwrap().unwrap().number + 1;

let input_data =
entropy_shared::QuoteInputData::new(public_key, x25519_public_key, nonce, block_number);
QuoteInputData::new(public_key, x25519_public_key, nonce, QuoteContext::ChangeEndpoint);

let mut pck_seeder = StdRng::from_seed(public_key.0);
let pck = tdx_quote::SigningKey::random(&mut pck_seeder);
Expand Down Expand Up @@ -129,14 +127,11 @@ async fn test_change_threshold_accounts() {
let pck_certificate_chain = vec![tss_public_key.0.to_vec()];

let quote = {
// We need to add `1` here since the quote is being checked in the next block
let block_number = rpc.chain_get_header(None).await.unwrap().unwrap().number + 1;

let input_data = entropy_shared::QuoteInputData::new(
tss_public_key,
*x25519_public_key.as_bytes(),
nonce,
block_number,
QuoteContext::ChangeThresholdAccounts,
);

let signing_key = tdx_quote::SigningKey::random(&mut OsRng);
Expand Down

0 comments on commit 07f87e0

Please sign in to comment.