mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-03 05:43:08 +00:00
feat: AccountPublicData struct changed
This commit is contained in:
parent
5172a95f53
commit
8e987847ee
@ -1,29 +1,13 @@
|
||||
use accounts::account_core::{AccountAddress, PublicKey};
|
||||
use k256::AffinePoint;
|
||||
use accounts::account_core::AccountAddress;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct AccountPublicData {
|
||||
pub nullifier_public_key: PublicKey,
|
||||
pub viewing_public_key: PublicKey,
|
||||
pub balance: u64,
|
||||
pub address: AccountAddress,
|
||||
}
|
||||
|
||||
impl AccountPublicData {
|
||||
pub fn from_raw(
|
||||
address: AccountAddress,
|
||||
nullifier_public_key: Vec<u8>,
|
||||
viewing_public_key: Vec<u8>,
|
||||
) -> Self {
|
||||
Self {
|
||||
nullifier_public_key: serde_json::from_slice::<AffinePoint>(&nullifier_public_key)
|
||||
.unwrap(),
|
||||
viewing_public_key: serde_json::from_slice::<AffinePoint>(&viewing_public_key).unwrap(),
|
||||
address,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct SequencerAccountsStore {
|
||||
pub accounts: HashMap<AccountAddress, AccountPublicData>,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user