Skip to content

Commit

Permalink
Store derivation_path in RegisteredInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
HCastano committed Aug 7, 2024
1 parent 016ab57 commit 77ed456
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pallets/registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ pub mod pallet {
pub struct RegisteredInfo<T: Config> {
pub programs_data: BoundedVec<ProgramInstance<T>, T::MaxProgramHashes>,
pub program_modification_account: T::AccountId,
/// TODO (Nando): We're just going to store the `count` for now, but we should consider
/// storing the full derivation path here in the future (as a `Vec<u8>`).
pub derivation_path: Option<u32>,
pub version_number: u8,
}

Expand All @@ -140,6 +143,7 @@ pub mod pallet {
RegisteredInfo {
programs_data: BoundedVec::default(),
program_modification_account: account_id.clone(),
derivation_path: None,
version_number: T::KeyVersionNumber::get(),
},
);
Expand All @@ -149,6 +153,7 @@ pub mod pallet {
RegisteredInfo {
programs_data: BoundedVec::default(),
program_modification_account: account_id.clone(),
derivation_path: None, // TODO (Nando): What `count` should we use here?
version_number: T::KeyVersionNumber::get(),
},
);
Expand Down Expand Up @@ -665,6 +670,7 @@ pub mod pallet {
RegisteredInfo {
programs_data: registering_info.programs_data,
program_modification_account: registering_info.program_modification_account,
derivation_path: None,
version_number: registering_info.version_number,
},
);
Expand Down Expand Up @@ -778,6 +784,7 @@ pub mod pallet {
programs_data,
program_modification_account: program_modification_account.clone(),
version_number: T::KeyVersionNumber::get(),
derivation_path: Some(count),
},
);

Expand Down

0 comments on commit 77ed456

Please sign in to comment.