Giter VIP home page Giter VIP logo

Comments (2)

slowli avatar slowli commented on May 27, 2024

@boguslavsky @defuz @gisochre Are you OK with this interface? Maybe, ListView or MapView need to have other methods? As for JSON for constructors, I see it slightly more verbose than it is currently, in order to be parseable within generic Exonum type spec:

ListView (3 items, proofs for 1st and 3rd):

{
  "root": {
    "@type": "branch",
    "left": {
      "@type": "branch",
      "left": {
        "val": ...
      },
      "right": {
        "stub": "abcdef..."
      }
    },
    "right": {
      "@type": "sprout",
      "child": {
        "val": ...
      }
    }
  },
  "length": 3
}

MapView (proof for key 01101...; the bits field is embedded into variants):

{
  "@type": "branch",
  "bits": "",
  "left": {
    "@type": "branch",
    "bits": "0",
    "left": {
      "stub": {
        "bits": "01",
        "hash": "..."
      }
    },
    "right": {
      "val": {
        "bits": "1101...",
        "item": ...
      }
    }
  },
  "right": {
    "stub": {
      "bits": "1",
      "hash": "..."
    }
  }
}

This assumes that oneOf can be encoded either as {<tag>: <value>} or {"@type": <tag>, ...<value>}.

As for implementation, it could be first implemented with custom JSON parsing logic, and then integrated into the Exonum type system.

from exonum-client.

slowli avatar slowli commented on May 27, 2024

I've implemented a PoC for type defs, which includes possibility of tree implementation, among other things. Very rough, but you probably get the general idea.

from exonum-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.