Skip to content
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

Remove Concat APIs #2170

Merged
merged 2 commits into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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