Skip to content
/ snek Public
forked from ricobank/snek

the tiny vyper helper command

Notifications You must be signed in to change notification settings

raddy/snek

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

snek

the tiny vyper helper command

snek make
  compile all vyper contracts in source folder,
snek test
  compile and test all vyper contracts in source and test folders

Plan of attack

snek test
  we want test contracts to work like this:

      def __init__(snek : Snek):
          self.coin = snek.make('Coin', 'rico')
          self.size = 'with'

      def testSize():
          assert self.coin.balanceOf(self) == 0
          assert self.size == 'with'

      event Transfer(...)
      def testEvent():
          log echo()
          log Transfer(...)
          self.coin.transfer(...)

  make multifab
    add - add a type (bytecode)
    new - create new instance (codehash -> new address)

  make snektest helper
    _bind(typename, bytecode) - pretest setup, add the types for user
    make(typename, objectname) - get new instance

  make snek.js test harness
    - compile all contracts
    - deploy multifab
    - put all types in multifab
    - deploy snek
    - for each test contract
        - deploy it
        - call each test function
        - for each echo event, check events match

About

the tiny vyper helper command

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vyper 100.0%