Skip to content

Commit

Permalink
Remove Concat APIs (neo-project#2170)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang authored and cloud8little committed Jan 24, 2021
1 parent 971dd85 commit 37363d3
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 253 deletions.
6 changes: 0 additions & 6 deletions src/neo/SmartContract/ApplicationEngine.Enumerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ partial class ApplicationEngine
public static readonly InteropDescriptor System_Enumerator_Create = Register("System.Enumerator.Create", nameof(CreateEnumerator), 1 << 4, CallFlags.None, false);
public static readonly InteropDescriptor System_Enumerator_Next = Register("System.Enumerator.Next", nameof(EnumeratorNext), 1 << 15, CallFlags.None, false);
public static readonly InteropDescriptor System_Enumerator_Value = Register("System.Enumerator.Value", nameof(EnumeratorValue), 1 << 4, CallFlags.None, false);
public static readonly InteropDescriptor System_Enumerator_Concat = Register("System.Enumerator.Concat", nameof(ConcatEnumerators), 1 << 4, CallFlags.None, false);

protected internal IEnumerator CreateEnumerator(StackItem item)
{
Expand All @@ -33,10 +32,5 @@ protected internal StackItem EnumeratorValue(IEnumerator enumerator)
{
return enumerator.Value();
}

protected internal IEnumerator ConcatEnumerators(IEnumerator first, IEnumerator second)
{
return new ConcatenatedEnumerator(first, second);
}
}
}
6 changes: 0 additions & 6 deletions src/neo/SmartContract/ApplicationEngine.Iterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ partial class ApplicationEngine
public static readonly InteropDescriptor System_Iterator_Key = Register("System.Iterator.Key", nameof(IteratorKey), 1 << 4, CallFlags.None, false);
public static readonly InteropDescriptor System_Iterator_Keys = Register("System.Iterator.Keys", nameof(IteratorKeys), 1 << 4, CallFlags.None, false);
public static readonly InteropDescriptor System_Iterator_Values = Register("System.Iterator.Values", nameof(IteratorValues), 1 << 4, CallFlags.None, false);
public static readonly InteropDescriptor System_Iterator_Concat = Register("System.Iterator.Concat", nameof(ConcatIterators), 1 << 4, CallFlags.None, false);

protected internal IIterator CreateIterator(StackItem item)
{
Expand Down Expand Up @@ -40,10 +39,5 @@ protected internal IEnumerator IteratorValues(IIterator iterator)
{
return new IteratorValuesWrapper(iterator);
}

protected internal IIterator ConcatIterators(IIterator first, IIterator second)
{
return new ConcatenatedIterator(first, second);
}
}
}
34 changes: 0 additions & 34 deletions src/neo/SmartContract/Enumerators/ConcatenatedEnumerator.cs

This file was deleted.

34 changes: 0 additions & 34 deletions src/neo/SmartContract/Iterators/ConcatenatedIterator.cs

This file was deleted.

This file was deleted.

This file was deleted.

38 changes: 0 additions & 38 deletions tests/neo.UnitTests/SmartContract/UT_InteropService.NEO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,25 +323,6 @@ public void TestEnumerator_Value()
engine.EnumeratorValue(wrapper).GetSpan().ToHexString().Should().Be(new byte[] { 0x01 }.ToHexString());
}

[TestMethod]
public void TestEnumerator_Concat()
{
var engine = GetEngine();
var arr1 = new VMArray {
new byte[]{ 0x01 },
new byte[]{ 0x02 }
};
var arr2 = new VMArray {
new byte[]{ 0x03 },
new byte[]{ 0x04 }
};
var wrapper1 = new ArrayWrapper(arr1);
var wrapper2 = new ArrayWrapper(arr2);
var ret = engine.ConcatEnumerators(wrapper1, wrapper2);
ret.Next().Should().BeTrue();
ret.Value().GetSpan().ToHexString().Should().Be(new byte[] { 0x01 }.ToHexString());
}

[TestMethod]
public void TestIterator_Create()
{
Expand Down Expand Up @@ -409,25 +390,6 @@ public void TestIterator_Values()
ret.Value().GetSpan().ToHexString().Should().Be(new byte[] { 0x01 }.ToHexString());
}

[TestMethod]
public void TestIterator_Concat()
{
var engine = GetEngine();
var arr1 = new VMArray {
new byte[]{ 0x01 },
new byte[]{ 0x02 }
};
var arr2 = new VMArray {
new byte[]{ 0x03 },
new byte[]{ 0x04 }
};
var wrapper1 = new ArrayWrapper(arr1);
var wrapper2 = new ArrayWrapper(arr2);
var ret = engine.ConcatIterators(wrapper1, wrapper2);
ret.Next().Should().BeTrue();
ret.Value().GetSpan().ToHexString().Should().Be(new byte[] { 0x01 }.ToHexString());
}

[TestMethod]
public void TestJson_Deserialize()
{
Expand Down

0 comments on commit 37363d3

Please sign in to comment.