refactor: Update public key column type from String
to PublicKey
#29
4 changed files with 8 additions and 8 deletions
|
@ -22,7 +22,7 @@
|
||||||
//! Entity for `in_chat_requests` table
|
//! Entity for `in_chat_requests` table
|
||||||
|
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use oxidetalis_core::types::PublicKey as CorePublicKey;
|
use oxidetalis_core::types::PublicKey;
|
||||||
Amjad50 marked this conversation as resolved
|
|||||||
use sea_orm::entity::prelude::*;
|
use sea_orm::entity::prelude::*;
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
@ -34,7 +34,7 @@ pub struct Model {
|
||||||
pub id: UserId,
|
pub id: UserId,
|
||||||
pub recipient_id: UserId,
|
pub recipient_id: UserId,
|
||||||
/// Public key of the sender
|
/// Public key of the sender
|
||||||
pub sender: CorePublicKey,
|
pub sender: PublicKey,
|
||||||
/// The timestamp of the request, when it was received
|
/// The timestamp of the request, when it was received
|
||||||
pub in_on: chrono::DateTime<Utc>,
|
pub in_on: chrono::DateTime<Utc>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
//! Entity for `out_chat_requests` table
|
//! Entity for `out_chat_requests` table
|
||||||
|
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use oxidetalis_core::types::PublicKey as CorePublicKey;
|
use oxidetalis_core::types::PublicKey;
|
||||||
use sea_orm::entity::prelude::*;
|
use sea_orm::entity::prelude::*;
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
@ -34,7 +34,7 @@ pub struct Model {
|
||||||
pub id: UserId,
|
pub id: UserId,
|
||||||
pub sender_id: UserId,
|
pub sender_id: UserId,
|
||||||
/// Public key of the recipient
|
/// Public key of the recipient
|
||||||
pub recipient: CorePublicKey,
|
pub recipient: PublicKey,
|
||||||
/// The timestamp of the request, when it was sent
|
/// The timestamp of the request, when it was sent
|
||||||
pub out_on: chrono::DateTime<Utc>,
|
pub out_on: chrono::DateTime<Utc>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
//! Entity for `users` table
|
//! Entity for `users` table
|
||||||
|
|
||||||
use oxidetalis_core::types::PublicKey as CorePublicKey;
|
use oxidetalis_core::types::PublicKey;
|
||||||
use sea_orm::entity::prelude::*;
|
use sea_orm::entity::prelude::*;
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
@ -31,7 +31,7 @@ use crate::prelude::*;
|
||||||
pub struct Model {
|
pub struct Model {
|
||||||
#[sea_orm(primary_key)]
|
#[sea_orm(primary_key)]
|
||||||
pub id: UserId,
|
pub id: UserId,
|
||||||
pub public_key: CorePublicKey,
|
pub public_key: PublicKey,
|
||||||
pub is_admin: bool,
|
pub is_admin: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
//! Entity for `users_status` table
|
//! Entity for `users_status` table
|
||||||
|
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use oxidetalis_core::types::PublicKey as CorePublicKey;
|
use oxidetalis_core::types::PublicKey;
|
||||||
use sea_orm::entity::prelude::*;
|
use sea_orm::entity::prelude::*;
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
@ -42,7 +42,7 @@ pub struct Model {
|
||||||
#[sea_orm(primary_key)]
|
#[sea_orm(primary_key)]
|
||||||
pub id: UserId,
|
pub id: UserId,
|
||||||
pub user_id: UserId,
|
pub user_id: UserId,
|
||||||
pub target: CorePublicKey,
|
pub target: PublicKey,
|
||||||
pub status: AccessStatus,
|
pub status: AccessStatus,
|
||||||
pub updated_at: chrono::DateTime<Utc>,
|
pub updated_at: chrono::DateTime<Utc>,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue
Why is it here
CorePublicKey
? while inoxidetails
crate is justPublicKey
, I think it might be confusing as we would think its 2 types.Because
oxidetalis
only work with onePublicKey
from the core, whilethe core work with two
PublicKey
, the first one fromk256
crate andthe second one it its own.
Ah right, didn't notice that
You're right, I was mean if we use it in the core not entities.
I didn't realize that was in entities.