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

Integer stack value JSON marshalling doesn't follow C# format #770

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

Integer stack value JSON marshalling doesn't follow C# format #770

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

Comments

@roman-khimov
Copy link
Member

Ours (getapplicationlog):

{
   "result" : {
      "executions" : [
         {
            "stack" : [
               {
                  "type" : "Integer",
                  "value" : 1
               }
            ],
            "vmstate" : "HALT",
            "gas_consumed" : "5.435",
            "trigger" : "Application",
            "notifications" : [
               {
                  "state" : {
                     "type" : "Array",
                     "value" : [
                        {
                           "type" : "ByteArray",
                           "value" : "7472616e73666572"
                        },
                        {
                           "type" : "ByteArray",
                           "value" : ""
                        },
                        {
                           "value" : "3131a3a8b37b95ffa7d771fa9a20e903045e7843",
                           "type" : "ByteArray"
                        },
                        {
                           "value" : 1000000000,
                           "type" : "Integer"
                        }
                     ]
                  },
                  "contract" : "0xbe0da5478954f03c44c06d63bf613dc98c621e96"
               }
            ],
            "contract" : "0x8b97d0ad65ffd62ca74cebdc4ae5776515c68897"
         }
      ],
      "txid" : "0x13ce0645e911f556a381964580c09d750213f888eb8f10d0a90b9a0c43f75952"
   },
   "jsonrpc" : "2.0",
   "id" : 1
}

Theirs:

{
   "jsonrpc" : "2.0",
   "id" : 1,
   "result" : {
      "txid" : "0x13ce0645e911f556a381964580c09d750213f888eb8f10d0a90b9a0c43f75952",
      "executions" : [
         {
            "trigger" : "Application",
            "stack" : [
               {
                  "type" : "Integer",
                  "value" : "1"
               }
            ],
            "vmstate" : "HALT",
            "contract" : "0x9788c6156577e54adceb4ca72cd6ff65add0978b",
            "gas_consumed" : "5.435",
            "notifications" : [
               {
                  "state" : {
                     "type" : "Array",
                     "value" : [
                        {
                           "type" : "ByteArray",
                           "value" : "7472616e73666572"
                        },
                        {
                           "type" : "ByteArray",
                           "value" : ""
                        },
                        {
                           "value" : "3131a3a8b37b95ffa7d771fa9a20e903045e7843",
                           "type" : "ByteArray"
                        },
                        {
                           "value" : "1000000000",
                           "type" : "Integer"
                        }
                     ]
                  },
                  "contract" : "0x961e628cc93d61bf636dc0443cf0548947a50dbe"
               }
            ]
         }
      ]
   }
}

Notice that C# node wraps Integer values in strings for some reason, so even though it looks a little strange we probably should follow this convention as we don't have any better standard at the moment.

@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
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