Skip to content
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

#86drpne63 - Add new methods on storage to get/put arrays, maps and objects without the need of stdlib convertion #1250

Merged
merged 1 commit into from
May 10, 2024

Conversation

meevee98
Copy link
Contributor

@meevee98 meevee98 commented May 9, 2024

Summary or solution description
Implemented typed get and put storage methods to handle storage data with less verbosity.
Refinement of #1231, included methods for better handling list, dict and object storage serialization

How to Reproduce

def store(prefix: bytes, value: Any):
storage.put_object(prefix, value)

auth = cast(list[UInt160], storage.get_list(AUTH_ADDRESSES, storage.get_read_only_context()))
if authorized:
found = False
for i in auth:
if i == address:
found = True
break
if not found:
auth.append(address)
storage.put_list(AUTH_ADDRESSES, auth)
on_auth(address, 0, True)

…bjects without the need of stdlib convertion
@meevee98 meevee98 self-assigned this May 9, 2024
@melanke
Copy link
Contributor

melanke commented May 9, 2024

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 91.667% (-0.1%) from 91.766%
when pulling 8e679cd on CU-86drpne63
into 95775e7 on development.

@luc10921 luc10921 merged commit 581571c into development May 10, 2024
5 checks passed
@luc10921 luc10921 deleted the CU-86drpne63 branch May 10, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants