Skip to content
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

Contract hash (Uint160) JSONification problem #769

Closed
roman-khimov opened this issue Mar 17, 2020 · 0 comments · Fixed by #785
Closed

Contract hash (Uint160) JSONification problem #769

roman-khimov opened this issue Mar 17, 2020 · 0 comments · Fixed by #785
Assignees
Labels
bug Something isn't working rpc RPC server and client
Milestone

Comments

@roman-khimov
Copy link
Member

roman-khimov commented Mar 17, 2020

Ours (getapplicationlog):

{
   "jsonrpc" : "2.0",
   "id" : 1,
   "result" : {
      "txid" : "0x36b9839d6c4f2a873065c024ec99a216c8ad26d3937f803d51fac7a8276cd67e",
      "executions" : [
         {
            "gas_consumed" : "2.077",
            "trigger" : "Application",
            "contract" : "0x06895ada0ad6c685cfb11d59dd7e6eba429c0f5b",
            "vmstate" : "HALT",
            "notifications" : [],
            "stack" : [
               {
                  "value" : "",
                  "type" : "ByteArray"
               }
            ]
         }
      ]
   }
}

Theirs:

{
   "id" : 1,
   "jsonrpc" : "2.0",
   "result" : {
      "txid" : "0x36b9839d6c4f2a873065c024ec99a216c8ad26d3937f803d51fac7a8276cd67e",
      "executions" : [
         {
            "gas_consumed" : "2.077",
            "notifications" : [],
            "vmstate" : "HALT",
            "stack" : [
               {
                  "type" : "ByteArray",
                  "value" : ""
               }
            ],
            "trigger" : "Application",
            "contract" : "0x5b0f9c42ba6e7edd591db1cf85c6d60ada5a8906"
         }
      ]
   }
}

Notice that we're using different byte order for the contract field. I think that by default we should JSONify using LE (as C# does), but doing so breaks some other things at the moment, so we need to carefully go through them and decide which one should be the default and which one should be done manually when needed using some wrappers (basically minimizing the need for them).

@roman-khimov roman-khimov added bug Something isn't working rpc RPC server and client labels Mar 17, 2020
@roman-khimov roman-khimov added this to the v0.74.1 milestone Mar 17, 2020
@AnnaShaleva AnnaShaleva self-assigned this Mar 20, 2020
AnnaShaleva added a commit that referenced this issue Mar 23, 2020
AnnaShaleva added a commit that referenced this issue Mar 23, 2020
AnnaShaleva added a commit that referenced this issue Mar 23, 2020
AnnaShaleva added a commit that referenced this issue Mar 23, 2020
AnnaShaleva added a commit that referenced this issue Mar 23, 2020
AnnaShaleva added a commit that referenced this issue Mar 23, 2020
AnnaShaleva added a commit that referenced this issue Mar 23, 2020
AnnaShaleva added a commit that referenced this issue Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rpc RPC server and client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants