MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / insert

Method insert

chain/src/storage.rs:29–35  ·  view source on GitHub ↗
(&self, key: &[u8], value: Vec<u8>)

Source from the content-addressed store, hash-verified

27 }
28
29 fn insert(&self, key: &[u8], value: Vec<u8>) -> Result<()> {
30 self.db
31 .put(key, value)
32 .map_err(|_| ChainError::StoragePutError(Storage::key_string(key)))?;
33
34 Ok(())
35 }
36
37 // noop
38 fn remove(&self, _key: &[u8]) -> Result<()> {

Callers 4

to_trieMethod · 0.80
upsertMethod · 0.80
process_transactionsMethod · 0.80

Calls

no outgoing calls

Tested by 1