contract/deployooor: Avoid unnecessary db key serialization

This commit is contained in:
parazyd
2023-12-19 17:11:44 +01:00
parent c8ee6e4af2
commit 7de072f0cd
2 changed files with 2 additions and 6 deletions

View File

@@ -68,11 +68,7 @@ fn init_contract(cid: ContractId, _ix: &[u8]) -> ContractResult {
}
// Update db version
db_set(
info_db,
&serialize(&DEPLOY_CONTRACT_DB_VERSION),
&serialize(&env!("CARGO_PKG_VERSION")),
)?;
db_set(info_db, DEPLOY_CONTRACT_DB_VERSION, &serialize(&env!("CARGO_PKG_VERSION")))?;
Ok(())
}

View File

@@ -54,7 +54,7 @@ pub const DEPLOY_CONTRACT_INFO_TREE: &str = "info";
pub const DEPLOY_CONTRACT_LOCK_TREE: &str = "lock";
// These are keys inside the info tree
pub const DEPLOY_CONTRACT_DB_VERSION: &str = "db_version";
pub const DEPLOY_CONTRACT_DB_VERSION: &[u8] = b"db_version";
/// zkas derive circuit namespace
pub const DEPLOY_CONTRACT_ZKAS_DERIVE_NS_V1: &str = "DeriveContractID";