Skip to content

Commit

Permalink
renamed to a more appropriate name the return value of the c# wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrizio Cannizzo committed Feb 12, 2024
1 parent 2b0ea9c commit 0127302
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ffi/dotnet-idsdk/IoticsIdLib/src/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ namespace IOTICS;
class Tools {


public static string InvokeGoFunction(Func<IdLib.Return> goFunction)
public static string InvokeGoFunction(Func<IdLib.StringAndError> goFunction)
{
string? error;
IdLib.Return result;
IdLib.StringAndError result;

try
{
Expand Down
4 changes: 2 additions & 2 deletions ffi/dotnet-idsdk/IoticsIdLib/src/id/IdLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Wrapper class that loads the DLL and exposes the methods as C# code.
*/
internal partial class IdLib
{
// Define the struct that matches the return type of CreateDefaultSeed in Go
// Define the struct that matches the return type of most of the functions below
[StructLayout(LayoutKind.Sequential)]
public struct Return
{
Expand Down Expand Up @@ -158,7 +158,7 @@ public static partial Return CreateTwinDidWithControlDelegation(
return null;

string? result = Marshal.PtrToStringAnsi(ptr);
FreeUpCString(ptr); // Assuming your Go library has a function to free the allocated memory
FreeUpCString(ptr);
return result;
}

Expand Down

0 comments on commit 0127302

Please sign in to comment.