From 4eea96290bc70a52640b5c54bd7d68f1cb788c9a Mon Sep 17 00:00:00 2001 From: Gabriele Picco Date: Tue, 7 May 2024 00:15:05 +0100 Subject: [PATCH] :bug: Fix Solana.Unity.Tool command line --- Solana.Unity.Anchor.Examples/Program.cs | 6 +++--- .../Solana.Unity.Anchor.Examples.csproj | 6 +++--- Solana.Unity.Anchor.Tool/AnchorSourceGenerator.cs | 6 +----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Solana.Unity.Anchor.Examples/Program.cs b/Solana.Unity.Anchor.Examples/Program.cs index 7c3a2cd..fd281ba 100644 --- a/Solana.Unity.Anchor.Examples/Program.cs +++ b/Solana.Unity.Anchor.Examples/Program.cs @@ -3,12 +3,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using Solnet.Rpc; -using Solnet.Wallet; +using Solana.Unity.Rpc; +using Solana.Unity.Wallet; using SequenceEnforcer; using Jet; -using Solnet.Wallet.Bip39; +using Solana.Unity.Wallet.Bip39; using SwitchboardV2; /// diff --git a/Solana.Unity.Anchor.Examples/Solana.Unity.Anchor.Examples.csproj b/Solana.Unity.Anchor.Examples/Solana.Unity.Anchor.Examples.csproj index e10215f..abd33fc 100644 --- a/Solana.Unity.Anchor.Examples/Solana.Unity.Anchor.Examples.csproj +++ b/Solana.Unity.Anchor.Examples/Solana.Unity.Anchor.Examples.csproj @@ -24,9 +24,9 @@ - - - + + + diff --git a/Solana.Unity.Anchor.Tool/AnchorSourceGenerator.cs b/Solana.Unity.Anchor.Tool/AnchorSourceGenerator.cs index 47513d3..2b30744 100644 --- a/Solana.Unity.Anchor.Tool/AnchorSourceGenerator.cs +++ b/Solana.Unity.Anchor.Tool/AnchorSourceGenerator.cs @@ -1,16 +1,11 @@ using CommandLine; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Text; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using Solana.Unity.Anchor; using Solana.Unity.Rpc; using System.IO; using Solana.Unity.Anchor.Models; -using Newtonsoft.Json; using Newtonsoft.Json.Linq; public class AnchorSourceGenerator @@ -54,6 +49,7 @@ static int Main(string[] args) foreach (JToken account in (JArray)val) { JToken accountType = account["type"]; + if(accountType == null) continue; foreach (JObject fields in (JArray)accountType["fields"]) { if (fields["type"] != null && fields["type"].Type.ToString() == "Object" && fields["type"]["defined"] != null && fields["type"]["defined"].ToString() == "UnixTimestamp")