Skip to content

Commit

Permalink
Add TODO.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiretza committed Jun 21, 2022
1 parent 25de264 commit 6753479
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 9 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 0 additions & 5 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ impl Account {
pub fn signup_key(client: Client, user: &User, main_key: &[u8]) -> Result<Self> {
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."))?;
Expand Down Expand Up @@ -212,7 +211,6 @@ impl Account {
pub fn login_key(client: Client, username: &str, main_key: &[u8]) -> Result<Self> {
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."))?;
Expand Down Expand Up @@ -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")
})?
Expand Down Expand Up @@ -465,7 +462,6 @@ impl Account {
encryption_key: Option<&[u8]>,
) -> Result<Self> {
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")
})?
Expand Down Expand Up @@ -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"))?;
Expand Down

0 comments on commit 6753479

Please sign in to comment.