Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions clarity-types/src/errors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ pub enum RuntimeError {
BadBlockHash(Vec<u8>),
/// Failed to unwrap an `Optional` (`none`) or `Response` (`err` or `ok`) Clarity value.
UnwrapFailure,
/// Attempt to set metadata (e.g., for NFTs or tokens) that was already initialized.
MetadataAlreadySet,
/// Interaction with a deprecated or inactive Proof of Transfer (PoX) contract.
DefunctPoxContract,
/// Attempt to lock STX for stacking when already locked in an active PoX cycle.
Expand Down
19 changes: 0 additions & 19 deletions clarity/src/vm/database/clarity_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,25 +686,6 @@ impl<'a> ClarityDatabase<'a> {
.map_err(|e| e.into())
}

/// Set a metadata entry if it hasn't already been set, yielding
/// a runtime error if it was. This should only be called by post-nakamoto
/// contexts.
pub fn try_set_metadata(
&mut self,
contract_identifier: &QualifiedContractIdentifier,
key: &str,
data: &str,
) -> Result<(), VmExecutionError> {
if self.store.has_metadata_entry(contract_identifier, key) {
Err(VmExecutionError::Runtime(
RuntimeError::MetadataAlreadySet,
None,
))
} else {
Ok(self.store.insert_metadata(contract_identifier, key, data)?)
}
}

fn insert_metadata<T: ClaritySerializable>(
&mut self,
contract_identifier: &QualifiedContractIdentifier,
Expand Down
Loading