-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Export contract's storage to json #3129
Conversation
var jsonData = new JObject(); | ||
foreach (var entry in snapshot.Find(prefix, Persistence.SeekDirection.Forward)) | ||
{ | ||
jsonData[Convert.ToBase64String(entry.Key.Key.ToArray())] = Convert.ToBase64String(entry.Value.Value.ToArray()); |
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.
I believe there is a limit in json that doesn't allow super long properties.
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.
We don't have extremely big data because of gas
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.
I am talking about keys for the property names.
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.
in ASP.Net, there's "MaxJsonLength". The default is 2097152 characters, which is equivalent to 4 MB of Unicode string data.
I think that it's enough, and in our json version, we don't have this limit.
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.
I think its 3 characters per one byte of base64 encode. Isn't it? Maybe add a check? for that length?
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.
4 bytes long for 3 bytes charadters.
It will me moved to a testing plugin |
Description
Related to #3127
Type of change