Closed deuszx closed 1 year ago
Hi, thanks for your input. We are currently finishing a new major update of OB and also removing unnecessary code from ink! 3
Hi @deuszx , in OB we have introduced our own restricted version of Mapping
and also a MultiMapping
struct, and RawMapping
is used to ease the implementation of these structs.
Hey @coreggon11 , can you give an example where OB's Mapping
is superior to ink! ?
RawMapping
might be replaceable with pure ink!Mapping
since ink! 4 .It seems like
RawMapping
was introduced back in ink!3 times to fix some ofink::storage::Mapping
's deficiencies. Now, eachMapping
value in contract's struct will get its own and unique (within that contract's scope) key in the underlying blockchain storage while just that key will be stored in the contract struct itself.Looking at the code of
RawMapping::insert
andRawMapping::get
it behaves similarly toMapping::insert
/Mapping::get
- ie each entry will be stored in the enclosing contract's storage (ink_env::set_contract_storage
) but also use itsMapping
's unique key - similarly to howRawMapping
uses itsprefix
.If that's true, I'd suggest removal of
RawMapping
and using ink's built-inMapping
instead - the less complex code the better.