GithubHelp home page GithubHelp logo

forked-near-rust-sdk's People

Contributors

adsick avatar ailisp avatar anshal-savla avatar austinabell avatar bowenwang1996 avatar chadoh avatar chaotictempest avatar chefsale avatar deveusss avatar evgenykuzyakov avatar frol avatar ilblackdragon avatar itegulov avatar janedegtiareva avatar k06a avatar kouprin avatar lexfro avatar maksymzavershynskyi avatar matklad avatar mikedotexe avatar mikhailok avatar olonho avatar rnhttr avatar robert-zaremba avatar sergey-melnychuk avatar telezhnaya avatar think-in-universe avatar willemneal avatar zcstarr avatar zurgl avatar

Watchers

 avatar

forked-near-rust-sdk's Issues

Try to generate openapi files

Given the changes from #1, it may be possible to generate openapi files describing each method, including it's type and docs information. This should make creating/maintaining documentation much easier.


Draft notes:

  • JsonSchema
    • For structs X and Y, with X::y being Y, the X::y documentation shows up but the Y one doesn't.
    • For the mods a and b and structs a::X and b::X, their name X will collide and thus should be able to potentially be named a.X and b.X.
    • Functions from the same trait or from the same impl block could be grouped together by having the same tag. This aligns whit an improvement for grouping the methods together from each impl block in a single trait, instead of each method having it's own trait.
  • OpenAPI
    • The spec 3.0.x forbids the GET http request methods from having a json body.
      • Currently the PATCH is being used instead of the GET.
      • The spec 3.1 allows for that and is thus should be better, but there is less tooling and library support for it. So for now it's advisable to stick to the 3.0.x spec.
    • The files, assuming they will exist as artifacts and can be linked to, can be rendered by third-parties websites such as in this example.

Mature the changes that makes testing more ergonomic

Some changes to the sdk are being worked on, which should make testing more ergonomic.
The current change can be found on 4.0.0-pre.8...556b6dd, from the https://github.com/Seatlab-dev/Forked-Near-Rust-Sdk/tree/seatlab-changes branch.

For the exported methods:

  • The Inputs are made public.
  • A trait is created for each method, giving types that implement it a possibility of getting a method name that equals the actual method name on the contract.
    • This means that tests no longer need to use macros, and the input, the output and the method name are setup automatically.
    • Rust-analyzer also shows all methods available.

In order to mature those changes, the tests and documentations should be updated. Another improved would be that instead of creating one trait for each method, a single trait for all methods from the same module could be created.

Something to consider: to somehow try to merge all traits from different modules into a single super trait, so the tests could import only this unique trait which would imply all methods.


edit: once this is matured, and although the upstream project is getting away from the old simulation testing framework, this changes could still be suggested to the near foundation as (I believe) it could still help on the new workspace testing framework.

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.