Browse Source

Fix trust promotion migration type and attributes

onyinyang 1 month ago
parent
commit
d7c44eaecf
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/proto/trust_promotion.rs

+ 4 - 3
src/proto/trust_promotion.rs

@@ -59,8 +59,8 @@ pub const UNTRUSTED_INTERVAL: u32 = 30;
 
 muCMZProtocol! { trust_promotion<credential_expiry, eligibility_max_age>,
     L: Lox { id: R, bucket: H, trust_level: R, level_since: H, invites_remaining: R, blockages: R },
-    M: MigrationKey { lox_id: J, from_bucket: H} ,
-    L.bucket = M.from_bucket,
+    M: MigrationKey { lox_id: R, from_bucket: H} ,
+    M.from_bucket = L.bucket,
     (credential_expiry..eligibility_max_age).contains(L.level_since),
 }
 
@@ -139,6 +139,7 @@ impl BridgeAuth {
             |L: &mut Lox, M: &mut MigrationKey| {
                 L.set_privkey(&self.lox_priv);
                 M.set_privkey(&self.migrationkey_priv);
+                M.lox_id = L.id;
                 let eligibility_max_age = today - UNTRUSTED_INTERVAL;
                 Ok(trust_promotion::Params {
                     credential_expiry: (eligibility_max_age - 511).into(),
@@ -184,7 +185,7 @@ pub fn handle_response(
     };
     match migration_table::decrypt_cred(
         migkey,
-        migration_table::MigrationType::Blockage,
+        migration_table::MigrationType::TrustUpgrade,
         migration_pubkey,
         &enc_migration_table,
     ) {