New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0.7 Upgrade with Storage and Readme Updates (for Cosmwasm v1.0) #66
Conversation
…, dequestore and keyset next
…olkit into cw-v1.0-storage syncing my local copy
packages/storage/src/deque_store.rs
Outdated
let indexes = self._get_indexes(storage, indexes_page)?; | ||
let item_data = indexes | ||
.get(&index_pos) | ||
.ok_or_else(|| StdError::generic_err("Item not found at this index."))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the error be "DequeStore out of bounds"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, I think we should only return out of bounds
right after checking pos > len
packages/storage/src/deque_store.rs
Outdated
if let Some(item_data) = indexes.get(&index_pos) { | ||
item = Ser::deserialize(item_data); | ||
} else { | ||
item = Err(StdError::generic_err("Item not found at this index.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here, I think "out of bounds" is a more appropriate message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I only want to return out of bounds
error right after checking pos >= len
…ret-toolkit into scrtlabs-update-dep-versions
Reopening the PR after it was automatically closed when the old branch was deleted. It seems like this needs manual intervention to merge now (probably due to versioning changes)
The following changes were made to the storage as mentioned in release notes, these changes were approved by @reuvenpo conceptually:
Keyset
storage object (A hashset like storage object).KeymapBuilder
andKeysetBuilder
which allow the user to disable the iterator feature (saving gas) or adjust the internal indexes' page size so that the user may determine how many objects are to be stored/loaded together in the iterator.::new_with_page_size(namespace, page_size)
method was added toAppendStore
andDequeStore
so that the user may adjust the internal indexes' page size which determine how many objects are to be stored/loaded together in the iterator.Keymap
,AppendStore
, andDequeStore
.Moreover, I also fixed all the clippy warnings and updated some readme files to reflect cosmwasm 1.0 changes. Cosmwasm v1.0 branch should probably be made default