rosetta_types/
call_response.rs

1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// CallResponse : CallResponse contains the result of a `/call` invocation.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct CallResponse {
15    /// Result contains the result of the `/call` invocation. This result will not be inspected or interpreted by Rosetta tooling and is left to the caller to decode.
16    #[serde(rename = "result")]
17    pub result: serde_json::Value,
18    /// Idempotent indicates that if `/call` is invoked with the same CallRequest again, at any point in time, it will return the same CallResponse.  Integrators may cache the CallResponse if this is set to true to avoid making unnecessary calls to the Rosetta implementation. For this reason, implementers should be very conservative about returning true here or they could cause issues for the caller.
19    #[serde(rename = "idempotent")]
20    pub idempotent: bool,
21}
22
23impl CallResponse {
24    /// CallResponse contains the result of a `/call` invocation.
25    pub fn new(result: serde_json::Value, idempotent: bool) -> CallResponse {
26        CallResponse { result, idempotent }
27    }
28}