pub trait StorageBackend {
// Required methods
fn read_32(&self, key: &[u8; 32]) -> Result<[u8; 32]>;
fn write_32(&mut self, key: [u8; 32], value: [u8; 32]) -> Result<()>;
}Expand description
Trait for storage backends that support 32-byte slot read/write operations.
All storage in TruthLinked contracts operates on fixed 32-byte slots. This trait abstracts the underlying storage mechanism, allowing contracts to work with both on-chain storage (via WASM host) and in-memory storage (for testing).