o1-labs/o1js

Advanced smart contract testing framework

Trivo25 opened this issue · 4 comments

our current "testing framework" for smart contracts is very simple, we should provide an advanced framework that tests smart contracts á la quick check or fuzzing. I think we already have a good chunk of whats needed to expose this to developers available internally

nicc commented

Testing concurrent user load would also be helpful imo

Testing concurrent user load would also be helpful imo

I think we can emulate this with creating several local blockchain transactions without sending them, and them sending all of them at the same time!

our current "testing framework" for smart contracts is very simple, we should provide an advanced framework that tests smart contracts á la quick check or fuzzing.

what would already be extremely helpful is if we could more easily lay out a succession of interactions (possibly concurrent) & expected state, where boilerplate stuff like creating a zkapp keypair, deploying the zkapp etc is abstracted away

for quickcheck like testing, I think there are three things to add:

  • generators for the initial state of the contract
  • generators for additional interactions on top of that initial state, which depend on the methods the contract has available & their inputs (note: this can in theory be generated from the smart contract-attached metadata, but that's not typed unfortunately. creating a useful type representation of the smart contract intf is something any new smart contract framework should achieve)
  • make our test() framework work with async functions