forked from 0LNetworkCommunity/libra-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
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
8b20710
commit c57d5d5
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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,29 @@ | ||
use crate::version_five::move_resource_v5::MoveStructTypeV5; | ||
use anyhow::Result; | ||
use move_core_types::{ident_str, identifier::IdentStr}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// Struct that represents a NewEpochEvent. | ||
#[derive(Debug, Serialize, Deserialize)] | ||
pub struct NewEpochEventV5 { | ||
epoch: u64, | ||
} | ||
|
||
impl NewEpochEventV5 { | ||
pub fn new(epoch: u64) -> Self { | ||
NewEpochEventV5 { epoch } | ||
} | ||
|
||
pub fn epoch(&self) -> u64 { | ||
self.epoch | ||
} | ||
|
||
pub fn try_from_bytes(bytes: &[u8]) -> Result<Self> { | ||
bcs::from_bytes(bytes).map_err(Into::into) | ||
} | ||
} | ||
|
||
impl MoveStructTypeV5 for NewEpochEventV5 { | ||
const MODULE_NAME: &'static IdentStr = ident_str!("DiemConfig"); | ||
const STRUCT_NAME: &'static IdentStr = ident_str!("NewEpochEvent"); | ||
} |