Skip to content

Commit

Permalink
Update metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
ameba23 committed Dec 13, 2024
1 parent 20d57e6 commit 072b411
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
Binary file modified crates/client/entropy_metadata.scale
Binary file not shown.
2 changes: 0 additions & 2 deletions crates/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ pub async fn change_threshold_accounts(
user_keypair: sr25519::Pair,
new_tss_account: String,
new_x25519_public_key: String,
new_pck_certificate_chain: Vec<Vec<u8>>,
quote: Vec<u8>,
) -> anyhow::Result<ThresholdAccountChanged> {
let tss_account = SubxtAccountId32::from_str(&new_tss_account)?;
Expand All @@ -373,7 +372,6 @@ pub async fn change_threshold_accounts(
let change_threshold_accounts = entropy::tx().staking_extension().change_threshold_accounts(
tss_account,
x25519_public_key,
new_pck_certificate_chain,
quote,
);
let in_block =
Expand Down
15 changes: 7 additions & 8 deletions crates/client/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ async fn test_change_endpoint() {

let mut pck_seeder = StdRng::from_seed(public_key.0);
let pck = tdx_quote::SigningKey::random(&mut pck_seeder);
let pck_encoded = tdx_quote::encode_verifying_key(pck.verifying_key()).unwrap().to_vec();

tdx_quote::Quote::mock(signing_key.clone(), pck, input_data.0).as_bytes().to_vec()
tdx_quote::Quote::mock(signing_key.clone(), pck, input_data.0, pck_encoded)
.as_bytes()
.to_vec()
};

let result =
Expand Down Expand Up @@ -120,11 +123,6 @@ async fn test_change_threshold_accounts() {
let pck = tdx_quote::SigningKey::random(&mut pck_seeder);
let encoded_pck = encode_verifying_key(&pck.verifying_key()).unwrap().to_vec();

// Our runtime is using the mock `PckCertChainVerifier`, which means that the expected
// "certificate" basically is just our TSS account ID. This account needs to match the one
// used to sign the following `quote`.
let pck_certificate_chain = vec![tss_public_key.0.to_vec()];

let quote = {
let input_data = entropy_shared::QuoteInputData::new(
tss_public_key,
Expand All @@ -134,7 +132,9 @@ async fn test_change_threshold_accounts() {
);

let signing_key = tdx_quote::SigningKey::random(&mut OsRng);
tdx_quote::Quote::mock(signing_key.clone(), pck.clone(), input_data.0).as_bytes().to_vec()
tdx_quote::Quote::mock(signing_key.clone(), pck.clone(), input_data.0, encoded_pck)
.as_bytes()
.to_vec()
};

let result = change_threshold_accounts(
Expand All @@ -143,7 +143,6 @@ async fn test_change_threshold_accounts() {
one.into(),
tss_public_key.to_string(),
hex::encode(*x25519_public_key.as_bytes()),
pck_certificate_chain,
quote,
)
.await
Expand Down

0 comments on commit 072b411

Please sign in to comment.