Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
{
  "alloc::string::String": "String",
  "bool": "Bool"
}


23Built-in containers 

  • Option / Result / Map / Vec : basically we are interested in only inner values of the container

    Code Block
    languagejs
    {
      "core::option::Option<iroha_data_model::isi::Instruction>": {
        "Option": "iroha_data_model::isi::Instruction"
      },
      "core::result::Result<i32, i32>": {
        "Result": {
          "ok": "i32",
          "err": "i32"
        }
      },
      "alloc::collections::BTreeMap<alloc::string::String, i32>": {
        "Map": {
          "key": "alloc::string::String",
          "value": "i32"
        }
      },
      "alloc::vec::Vec<i32>": {
        "Vec": "i32"
      }
    }


34Custom containers 

  • Named structures – structures which have field names
  • Unnamed structures – structures with no field names (like zero sized structures in rust, or tuples, or struct WrappedTuple(i32, i32))
  • Enums


    Code Block
    languagejs
    {
      "iroha_crypto::PublicKey": {
        "NamedStruct": {
          "declarations": [
            {
              "name": "digest_function",
              "ty": "alloc::string::String"
            },
            {
              "name": "payload",
              "ty": "alloc::vec::Vec<u8>"
            }
          ]
        }
      },
      "iroha_data_model::account::SignatureCheckCondition": {
        "UnnamedStruct": {
          "types": [
            "iroha_data_model::expression::EvaluatesTo<bool>"
          ]
        }
      },
      "iroha_data_model::events::pipeline::EntityType": {
        "Enum": {
          "variants": [
            {
              "name": "Block",
              "discriminant": 0,
              "ty": null
            },
            {
              "name": "Transaction",
              "discriminant": 1,
              "ty": null
            }
          ]
        }
      },
    }


...