Skip to content

Commit

Permalink
Fix RpcNativeContract
Browse files Browse the repository at this point in the history
Close #850
  • Loading branch information
shargon authored Nov 24, 2023
1 parent 64a1ae4 commit bb5038a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/RpcClient/Models/RpcNativeContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public class RpcNativeContract
public UInt160 Hash { get; set; }
public NefFile Nef { get; set; }
public ContractManifest Manifest { get; set; }
public uint[] UpdateHistory { get; set; }

public static RpcNativeContract FromJson(JObject json)
{
Expand All @@ -30,8 +29,7 @@ public static RpcNativeContract FromJson(JObject json)
Id = (int)json["id"].AsNumber(),
Hash = UInt160.Parse(json["hash"].AsString()),
Nef = RpcNefFile.FromJson((JObject)json["nef"]),
Manifest = ContractManifest.FromJson((JObject)json["manifest"]),
UpdateHistory = ((JArray)json["updatehistory"]).Select(u => (uint)u.GetInt32()).ToArray()
Manifest = ContractManifest.FromJson((JObject)json["manifest"])
};
}

Expand All @@ -42,8 +40,7 @@ public JObject ToJson()
["id"] = Id,
["hash"] = Hash.ToString(),
["nef"] = Nef.ToJson(),
["manifest"] = Manifest.ToJson(),
["updatehistory"] = new JArray(UpdateHistory.Select(u => new JNumber(u)).ToArray())
["manifest"] = Manifest.ToJson()
};
}
}
Expand Down

0 comments on commit bb5038a

Please sign in to comment.