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

Changing Transaction::V1 json serialization #4975

Merged

Conversation

zajko
Copy link

@zajko zajko commented Nov 22, 2024

TransactionV1Payload::fields from now will be serialized as a human-readable JSON. Uptill now it was a map of <u16, Bytes>, currently it will be serialized as <String, serde_json::Value>. An example Transaction::V1 json representation will look like:

{
  "Version1": {
    "hash": "5e8d4e9ad52a4aad34515fc4a8620166e37de362054b7916ea5d01c671217101",
    "payload": {
      "initiator_addr": {
        "PublicKey": "0126c6506b6e200c8a5501571bbed5de32c44b979a8f1fb36f36f585d823562935"
      },
      "timestamp": "2020-08-07T01:31:28.867Z",
      "ttl": "5m 1s 253ms",
      "chain_name": "cjain-1",
      "pricing_mode": {
        "Fixed": {
          "additional_computation_factor": 0,
          "gas_price_tolerance": 5
        }
      },
      "fields": {
        "args": {
          "Named": [
            [
              "xyz",
              {
                "bytes": "0d0000001af81d860f238f832b8f8e648c",
                "cl_type": {
                  "List": "U8"
                }
              }
            ]
          ]
        },
        "entry_point": "AddBid",
        "scheduling": {
          "FutureEra": 195120
        },
        "target": "Native"
      }
    },
    "approvals": [
      {
        "signer": "0126c6506b6e200c8a5501571bbed5de32c44b979a8f1fb36f36f585d823562935",
        "signature": "015d5c48f6dbc44ba6ca7202fc5bc9cf9861586f1762343fe29812bac0b96b63b89f4daa97ff37423e75a127cef163bcd9f6fcbe94e3743160814b12a8407fa107"
      }
    ]
  }
}

@zajko zajko force-pushed the v1_json_serialization branch 8 times, most recently from f1c8ec0 to 6dea3d1 Compare November 23, 2024 00:49
@zajko
Copy link
Author

zajko commented Nov 23, 2024

bors r+

Copy link
Contributor

Build succeeded:

@casperlabs-bors-ng casperlabs-bors-ng bot merged commit ef376e6 into casper-network:feat-2.0 Nov 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants