diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..d67b776 --- /dev/null +++ b/TODO.md @@ -0,0 +1,9 @@ +# TODO + +This file tracks planned changes to the project, especially breaking changes that have to wait +until the next major release. + +## Planned changes for next major release + +- Change argument types in `src/service.rs` for public and private keys to use `[u8; 32]` instead + of `[u8]`. This should remove all the `ProgrammingError`s resulting from failed `try_into()` calls. diff --git a/src/service.rs b/src/service.rs index 2cf34fd..26eb6ff 100644 --- a/src/service.rs +++ b/src/service.rs @@ -121,7 +121,6 @@ impl Account { pub fn signup_key(client: Client, user: &User, main_key: &[u8]) -> Result { super::init()?; - // TODO: change argument type to [u8; 32] let main_key: [u8; 32] = main_key .try_into() .map_err(|_| Error::ProgrammingError("Key should be exactly 32 bytes long."))?; @@ -212,7 +211,6 @@ impl Account { pub fn login_key(client: Client, username: &str, main_key: &[u8]) -> Result { super::init()?; - // TODO: change argument type to [u8; 32] let main_key: [u8; 32] = main_key .try_into() .map_err(|_| Error::ProgrammingError("Key should be exactly 32 bytes long."))?; @@ -424,7 +422,6 @@ impl Account { let version = super::CURRENT_VERSION; let encryption_key = if let Some(encryption_key) = encryption_key { - // TODO: change argument type to Option<&[u8; 32]> encryption_key.try_into().map_err(|_| { Error::ProgrammingError("Encryption key must be exactly 32 bytes long") })? @@ -465,7 +462,6 @@ impl Account { encryption_key: Option<&[u8]>, ) -> Result { let encryption_key = if let Some(encryption_key) = encryption_key { - // TODO: change argument type to Option<&[u8; 32]> encryption_key.try_into().map_err(|_| { Error::ProgrammingError("Encryption key must be exactly 32 bytes long") })? @@ -1184,7 +1180,6 @@ impl CollectionInvitationManager { pubkey: &[u8], access_level: CollectionAccessLevel, ) -> Result<()> { - // TODO: change argument type to &[u8; 32] let pubkey: &[u8; 32] = pubkey .try_into() .map_err(|_| Error::ProgrammingError("Public key should be exactly 32 bytes long"))?;