mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-05 23:03:06 +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 accounts::account_core::AccountAddress;
|
||||||
use k256::AffinePoint;
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct AccountPublicData {
|
pub struct AccountPublicData {
|
||||||
pub nullifier_public_key: PublicKey,
|
pub balance: u64,
|
||||||
pub viewing_public_key: PublicKey,
|
|
||||||
pub address: AccountAddress,
|
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)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct SequencerAccountsStore {
|
pub struct SequencerAccountsStore {
|
||||||
pub accounts: HashMap<AccountAddress, AccountPublicData>,
|
pub accounts: HashMap<AccountAddress, AccountPublicData>,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user