Coder Social home page Coder Social logo

SIMP Based Test Framework about sapio HOT 3 OPEN

sapio-lang avatar sapio-lang commented on August 22, 2024
SIMP Based Test Framework

from sapio.

Comments (3)

JeremyRubin avatar JeremyRubin commented on August 22, 2024

Updating this issue.

Now that SIMPs exist, we do have the "contract controller" framework, sort of.

This issue should now be considered "Define SIMP for analysis and testing"

from sapio.

ProofOfKeags avatar ProofOfKeags commented on August 22, 2024

What do you mean here by saying "SIMP for analysis and testing". Are these hints that tell the test framework how to drive the contract? Can that not be inferred from the ABI without SIMPs? Am I misunderstanding the issue?

from sapio.

JeremyRubin avatar JeremyRubin commented on August 22, 2024

it's a bit different. A basic example is if you have a SIMP ProveAvailableForNBlocksBefore(Target, u64) and a SIMP Target(&'static str).

You lable one template as ProveAvailableForNBlocksBefore(Target("counter_spend"), 10) and a another as Target("counter_spend")

Then, while testing, you could parse the contract for the ProveAvailableForNBlocksBefore and Target labels and try to constraint solve to check that the first template has a 10 block lead on the other.

Obviously, you can get really in the weeds on designing these types of attributes, as well as a test runner environment that can automate checking these properties, but right now contracts are barely testable at all, so basic testing hooks would really help.

These do differ from normal runtime things because you might include all sorts of stuff in them including labels for e.g. specific test scenarios (e.g., TestPoint(Scenarion(String), Box)), which can then be used for things like "Assume this transaction has been reached, then show that...".

Sorry if that's a bit vague, but this is a wide problem space.

from sapio.

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.