Skip to content

Commit

Permalink
node: change METADATA_KEYS to be slice
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia committed Feb 12, 2024
1 parent 1d5f366 commit e38d14c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions node/src/chain/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ impl<DB: database::DB, VM: vm::VMExecution> Operations for Executor<DB, VM> {
elapsed: Duration,
) -> Result<(), Error> {
let db_key = match step_name {
StepName::Proposal => &MD_AVG_PROPOSAL[..],
StepName::Validation => &MD_AVG_VALIDATION[..],
StepName::Ratification => &MD_AVG_RATIFICATION[..],
StepName::Proposal => MD_AVG_PROPOSAL,
StepName::Validation => MD_AVG_VALIDATION,
StepName::Ratification => MD_AVG_RATIFICATION,
};

let db = self.db.read().await;
Expand Down
10 changes: 5 additions & 5 deletions node/src/database/rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ const MAX_MEMPOOL_SIZE: usize = 64 * 1024 * 1024; // 64 MiB
const DB_FOLDER_NAME: &str = "chain.db";

// List of supported metadata keys
pub const MD_HASH_KEY: &[u8; 8] = b"hash_key";
pub const MD_STATE_ROOT_KEY: &[u8; 14] = b"state_hash_key";
pub const MD_AVG_VALIDATION: &[u8; 19] = b"avg_validation_time";
pub const MD_AVG_RATIFICATION: &[u8; 21] = b"avg_ratification_time";
pub const MD_AVG_PROPOSAL: &[u8; 17] = b"avg_proposal_time";
pub const MD_HASH_KEY: &[u8] = b"hash_key";
pub const MD_STATE_ROOT_KEY: &[u8] = b"state_hash_key";
pub const MD_AVG_VALIDATION: &[u8] = b"avg_validation_time";
pub const MD_AVG_RATIFICATION: &[u8] = b"avg_ratification_time";
pub const MD_AVG_PROPOSAL: &[u8] = b"avg_proposal_time";

#[derive(Clone)]
pub struct Backend {
Expand Down

0 comments on commit e38d14c

Please sign in to comment.