-
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
Fix native serialize #1988
Fix native serialize #1988
Conversation
@erikzhang I only keep the neoToken changes because it will not be accessible outside of the contract, and we can have more than expected values, I also think we can also change the id of the oracles, because 32 is too small for this list. |
Co-authored-by: Erik Zhang <erik@neo.org>
Co-authored-by: Erik Zhang <erik@neo.org>
@@ -86,7 +87,7 @@ public T GetInteroperable<T>() where T : IInteroperable, new() | |||
if (cache is null) | |||
{ | |||
var interoperable = new T(); | |||
interoperable.FromStackItem(BinarySerializer.Deserialize(value, 16, 34)); | |||
interoperable.FromStackItem(BinarySerializer.Deserialize(value, ExecutionEngineLimits.Default.MaxStackSize, ExecutionEngineLimits.Default.MaxItemSize)); |
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.
Do we still need it?
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 that it's better to preserve the vm limits.
Fix native serialize (neo-project#1988)
* Fix native serialize * Update src/neo/SmartContract/Native/Oracle/OracleContract.cs Co-authored-by: Erik Zhang <erik@neo.org> * Update OracleContract.cs * Remove sorting with BigEndian * Fix foreach without sort * Fix calculate bonus * Remove foreach * Follow roman feedback * Return iterator for GetBlockedAccounts * dotnet format * Remove method and update nuget * Revert ArrayWrapper * Fix UT * Update * Use find range * Remove internal * Store blocked accounts in chunks * Changed to const * Optimize * Change to 200 and optimize * Optimize II * Optimize NeoToken changes * Clean code * One record one key * Clean code * Rename * Update IsBlocked * Remove ordering * Fix ut * Optimization * Revert include endKey * Revert include endKey * add yield break * Update NeoToken.cs * Update src/neo/SmartContract/Native/Tokens/NeoToken.cs Co-authored-by: Erik Zhang <erik@neo.org> * Remove +1 Co-authored-by: Erik Zhang <erik@neo.org>
* Fix native serialize * Update src/neo/SmartContract/Native/Oracle/OracleContract.cs Co-authored-by: Erik Zhang <erik@neo.org> * Update OracleContract.cs * Remove sorting with BigEndian * Fix foreach without sort * Fix calculate bonus * Remove foreach * Follow roman feedback * Return iterator for GetBlockedAccounts * dotnet format * Remove method and update nuget * Revert ArrayWrapper * Fix UT * Update * Use find range * Remove internal * Store blocked accounts in chunks * Changed to const * Optimize * Change to 200 and optimize * Optimize II * Optimize NeoToken changes * Clean code * One record one key * Clean code * Rename * Update IsBlocked * Remove ordering * Fix ut * Optimization * Revert include endKey * Revert include endKey * add yield break * Update NeoToken.cs * Update src/neo/SmartContract/Native/Tokens/NeoToken.cs Co-authored-by: Erik Zhang <erik@neo.org> * Remove +1 Co-authored-by: Erik Zhang <erik@neo.org>
Refactor of #1983