Skip to content

Commit

Permalink
Enforce field ordering on JsonRpcRequest
Browse files Browse the repository at this point in the history
while the field ordering is already alphabetical, this enforces the order using the order property of the JsonProperty attribute
  • Loading branch information
AddressXception committed Aug 12, 2022
1 parent 1a7d04c commit bd4abe6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace WalletConnectSharp.Core.Models.Ethereum
{
public sealed class EthSignTypedData<T> : JsonRpcRequest
{
[JsonProperty("params")]
[JsonProperty("params", Order = 4)]
private string[] _parameters;

public EthSignTypedData(string address, T data, EIP712Domain domain)
Expand Down
6 changes: 3 additions & 3 deletions WalletConnectSharp.Core/Models/JsonRpcRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace WalletConnectSharp.Core.Models
{
public class JsonRpcRequest : IEventSource
{
[JsonProperty]
[JsonProperty(Order = 1)]
private long id;
[JsonProperty]
[JsonProperty(Order = 2)]
private string jsonrpc = "2.0";

[JsonProperty("method")]
[JsonProperty("method", Order = 3)]
public virtual string Method { get; protected set; }

public JsonRpcRequest()
Expand Down

0 comments on commit bd4abe6

Please sign in to comment.