Skip to content

net7 and support IOS, Android, Windows, Mac OS #63

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@
/EosSharp/EosSharp.UnitTests.Unity3D/UnityTester/Assets/Plugins
/EosSharp/EosSharp.UnitTests.Unity3D/UnityTester/.vs/UnityTester/v15
/EosSharp/EosSharp.UnitTests.Unity3D/UnityTester/obj/Debug
.vs/eos-sharp-maui/v17/.wsuo
.vs/VSWorkspaceState.json
.vs/eos-sharp-maui/v17/.wsuo
.vs/eos-sharp-maui/v17/.wsuo
Binary file added .vs/eos-sharp-maui/v17/.wsuo
Binary file not shown.
2 changes: 1 addition & 1 deletion EosSharp/EosSharp.Core/EosSharp.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
18 changes: 12 additions & 6 deletions EosSharp/EosSharp.Core/Helpers/SerializationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace EosSharp.Core.Helpers
{
Expand Down Expand Up @@ -214,15 +216,19 @@ public static byte[] ObjectToByteArray(object obj)
{
if (obj == null)
return null;
return Encoding.UTF8.GetBytes(JsonSerializer.Serialize(obj, GetJsonSerializerOptions()));
}

BinaryFormatter bf = new BinaryFormatter();
using (MemoryStream ms = new MemoryStream())
private static JsonSerializerOptions GetJsonSerializerOptions()
{
return new JsonSerializerOptions()
{
bf.Serialize(ms, obj);
return ms.ToArray();
}
PropertyNamingPolicy = null,
WriteIndented = true,
AllowTrailingCommas = true,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
};
}

/// <summary>
/// Encode byte array to hexadecimal string
/// </summary>
Expand Down
3 changes: 2 additions & 1 deletion EosSharp/EosSharp.Core/Providers/AbiSerializationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public async Task<byte[]> SerializePackedTransaction(Transaction trx)
int actionIndex = 0;
var abiResponses = await GetTransactionAbis(trx);


using (MemoryStream ms = new MemoryStream())
{
//trx headers
Expand Down Expand Up @@ -310,7 +311,7 @@ public async Task<Abi> GetAbi(string accountName)
var result = await Api.GetRawAbi(new GetRawAbiRequest()
{
account_name = accountName
});
},true);

return DeserializePackedAbi(result.abi);
}
Expand Down
Loading