Skip to content

Commit

Permalink
Update Neo (#793)
Browse files Browse the repository at this point in the history
* Update StdLib

* Add CurrentSigners

* Update src/Neo.SmartContract.Framework/Native/StdLib.cs

Co-authored-by: Jimmy <jinghui@wayne.edu>

* Update StdLib.cs

---------

Co-authored-by: Jimmy <jinghui@wayne.edu>
  • Loading branch information
shargon and Jim8y committed Sep 16, 2023
1 parent 9a14e2d commit a77456b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Neo.Compiler.CSharp/Neo.Compiler.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageReference Include="Neo" Version="3.6.0" />
<PackageReference Include="Neo" Version="3.6.0-CI01416" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta4.22272.1" />
</ItemGroup>
Expand Down
12 changes: 12 additions & 0 deletions src/Neo.SmartContract.Framework/Native/StdLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,17 @@ public static class StdLib
public static extern string[] StringSplit(string str, string separator);

public static extern string[] StringSplit(string str, string separator, bool removeEmptyEntries);

/// <summary>
/// Get the string length by elements
/// </summary>
/// <param name="str">String value</param>
/// <returns>Number of elements in the string</returns>
/// <example>
/// string a = "A"; // return 1
/// string tilde = "ã"; // return 1
/// string duck = "🦆"; //return 1
/// </example>
public static extern int StrLen(string str);
}
}
4 changes: 4 additions & 0 deletions src/Neo.SmartContract.Framework/Services/Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// modifications are permitted.

using Neo.SmartContract.Framework.Attributes;
using Neo.SmartContract.Framework.Native;
using System.Numerics;

namespace Neo.SmartContract.Framework.Services
Expand Down Expand Up @@ -108,5 +109,8 @@ public static class Runtime

[Syscall("System.Runtime.LoadScript")]
public static extern object LoadScript(ByteString script, CallFlags flags, params object[] args);

[Syscall("System.Runtime.CurrentSigners")]
public static extern Signer[] CurrentSigners();
}
}

0 comments on commit a77456b

Please sign in to comment.