Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

fix storage layout deserialization #860

Merged
merged 1 commit into from
Feb 4, 2022

Conversation

joshieDo
Copy link
Contributor

@joshieDo joshieDo commented Feb 3, 2022

Motivation

Adding storageLayout to output selection on contracts without any storage variables is triggering the following error:

compiling...
Error: 
   0: invalid type: null, expected a map at line 1 column 4542

Location:
   /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/result.rs:1911

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Solution

Add deserialization method default_for_null and apply it to StorageLayout.types

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

@joshieDo joshieDo changed the title fix storage deserialization fix storage layout deserialization Feb 3, 2022
@joshieDo
Copy link
Contributor Author

joshieDo commented Feb 3, 2022

unrelated test failure?

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!
unrelated test failure

@gakonst gakonst merged commit 0526e92 into gakonst:master Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants