-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a33076d
commit 432dd42
Showing
7 changed files
with
103 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use libra_types::exports::AccountAddress; | ||
|
||
#[derive(Debug, Clone)] | ||
/// The basic information for an account | ||
pub struct WarehouseAccState { | ||
pub address: AccountAddress, | ||
pub time: WarehouseTime, | ||
pub sequence_num: u64, | ||
pub balance: Option<u64>, | ||
} | ||
|
||
impl WarehouseAccState { | ||
pub fn new(address: AccountAddress) -> Self { | ||
Self { | ||
address, | ||
sequence_num: 0, | ||
time: WarehouseTime::default(), | ||
balance: None, | ||
} | ||
} | ||
pub fn set_time(&mut self, timestamp: u64, version: u64, epoch: u64) { | ||
self.time.timestamp = timestamp; | ||
self.time.version = version; | ||
self.time.epoch = epoch; | ||
} | ||
} | ||
// holds timestamp, chain height, and epoch | ||
#[derive(Debug, Clone, Default)] | ||
pub struct WarehouseTime { | ||
pub timestamp: u64, | ||
pub version: u64, | ||
pub epoch: u64, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters