Skip to content

Commit

Permalink
fix BigInteger0 storage outputs null (neo-project#1471)
Browse files Browse the repository at this point in the history
  • Loading branch information
cn1010 committed Mar 17, 2020
1 parent be8ff99 commit 7df68fc
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/neo/SmartContract/InteropService.Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,10 @@ private static bool PutExInternal(ApplicationEngine engine, StorageContext conte

if (engine.Snapshot.Storages.TryGet(skey)?.IsConstant == true) return false;

if (value.Length == 0 && !flags.HasFlag(StorageFlags.Constant))
{
// If put 'value' is empty (and non-const), we remove it (implicit `Storage.Delete`)
engine.Snapshot.Storages.Delete(skey);
}
else
{
StorageItem item = engine.Snapshot.Storages.GetAndChange(skey, () => new StorageItem());
item.Value = value;
item.IsConstant = flags.HasFlag(StorageFlags.Constant);
}
StorageItem item = engine.Snapshot.Storages.GetAndChange(skey, () => new StorageItem());
item.Value = value;
item.IsConstant = flags.HasFlag(StorageFlags.Constant);

return true;
}

Expand Down

0 comments on commit 7df68fc

Please sign in to comment.