forked from aptos-labs/aptos-core
-
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.
[Global Constants] Created a global-constants crate in the configurat…
…ion directory. Closes: aptos-labs#3788 Approved by: davidiw
- Loading branch information
1 parent
9437320
commit 84e2450
Showing
9 changed files
with
105 additions
and
84 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 @@ | ||
[package] | ||
name = "libra-global-constants" | ||
version = "0.1.0" | ||
authors = ["Libra Association <[email protected]>"] | ||
description = "Libra's global constant crate: the source of truth for constant definitions that span multiple crates" | ||
repository = "https://github.com/libra/libra" | ||
homepage = "https://libra.org" | ||
license = "Apache-2.0" | ||
publish = false | ||
edition = "2018" |
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,23 @@ | ||
// Copyright (c) The Libra Core Contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//! The purpose of this crate is to offer a single source of truth for the definitions of shared | ||
//! constants within the Libra codebase. This is useful because many different components within | ||
//! Libra often require access to global constant definitions (e.g., Libra Safety Rules, | ||
//! the Key Manager, and Secure Storage). To avoid duplicating these definitions across crates | ||
//! (and better allow these constants to be updated in a single location), we define them here. | ||
#![forbid(unsafe_code)] | ||
|
||
/// Definitions of global cryptographic keys (e.g., as held in secure storage) | ||
pub const ASSOCIATION_KEY: &str = "association"; | ||
pub const CONSENSUS_KEY: &str = "consensus"; | ||
pub const FULLNODE_NETWORK_KEY: &str = "fullnode_network"; | ||
pub const OPERATOR_KEY: &str = "operator"; | ||
pub const OWNER_KEY: &str = "owner"; | ||
pub const VALIDATOR_NETWORK_KEY: &str = "validator_network"; | ||
|
||
/// Definitions of global data items (e.g., as held in secure storage) | ||
pub const EPOCH: &str = "epoch"; | ||
pub const LAST_VOTED_ROUND: &str = "last_voted_round"; | ||
pub const PREFERRED_ROUND: &str = "preferred_round"; | ||
pub const WAYPOINT: &str = "waypoint"; |
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
Oops, something went wrong.