Giter Club home page Giter Club logo

dapple's Introduction

ATTENTION: Dapple has been deprecated in favor of a new tool called Dapp. Please use that instead.

js-semistandard-style Build status Chat Documentation Stories in Ready Dependencies

Dapple is a Solidity developer multitool designed to manage the growing complexity of interconnected smart contract systems.

Its core functionality encompasses three main areas:

  • Package management
  • Contract building
  • Deployment scripting

These concepts are related in a way unique to the smart contract ecosystem, due to each blockchain's universal singleton nature.

The central data model for Dapple is the dappfile, whose definition will normally reference IPFS objects and Ethereum contract addresses.

Installation

The normal way to install Dapple is through npm:

$ npm install -g dapple
$ dapple --help

You can read about detailed system specific installation on the documentation.

Basic usage

Use dapple init to generate a project skeleton:

mkdir foo;
cd foo;
dapple init

By default, build/ is where the output of dapple build gets put, and contracts/ is where Dapple looks for your contract source files. Both of these are configured in your dappfile and can be overridden.

Now try writing a contract and a test (see Dapple test harness docs):

$ vim contracts/dapp.sol
$ vim contracts/dapp_test.sol
$ dapple test

Finally, try building your project:

$ dapple build

By default, dapple build builds the entire contracts/ tree, and emits the following:

  • cached build objects
  • classes.json — a list of type definitions
  • js_module.js — a JavaScript module which wraps classes.json and adds Contract objects instantiated from web3.js for each object in the dappfile

Example packages

  • Dappsys — a contract system framework (Nexus's "standard library")
  • Feedbase — a simple paid feed app
  • stringutils — string manipulation library
  • RanDAOPlus - Experimental Ethereum RNG based on PoW

More information

Not yet documented

  • Aliasing and imports
  • Environments and object linking
  • Ignore/add

dapple's People

Contributors

apmilen avatar arachnid avatar c055 avatar cassiopaia avatar dbrock avatar ethernomad avatar gitter-badger avatar jorpic avatar juanfranblanco avatar julian1 avatar mhhf avatar nanexcool avatar nicksavers avatar nmushegian avatar ramosi avatar uzyn avatar vessenes avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dapple's Issues

[brainstorm] usability and conventions

  • Move default source dir from src/sol to contracts?
  • Maybe dist and build should be separated: dist could contain the js module and pure solidity packages specific to an environment. build could contain the files used during linking and classes.json

add rpc/integration tests

We need a way to test functions that are not callable from solidity

This will also let us control a few factors we can't yet (msg.* and block.*)

Milestone v0.2 Parent Issue

Milestone v0.2

0.2 is a cleanup and review of the stuff we did to make dapple-js usable for real dev work. Work on 0.2 should be done with the vision for 0.3 in mind, also described here

  • dapple build

collects sources form package dependency hierarchy and feeds it into solc. v0.2 does not need to deal with namespaces (re-throw solc's error if there are class name collisions), but does deal with aliasing packages so solidity imports work as expected.

Currently build emits 2 things:

  • a bundle containing all the output from solc that isn't totally redundant (filter opcodes and others) called classes.json
  • a js module you can import to node directly or run through browserify in a UI package

build should export the types and objects described directly or indirectly in the dappfile. Right now that means it bundles the class definitions and interfaces. For 0.2 it should also ship a manually configured set of named object with a classname (type), like a simple .json file in the env repo

  • dapple test

run vm tests from build output against testrpc or any other "instant" eth rpc implementation.

Looking ahead

0.3 will include chain, env, and step commands.

  • chain is a process manager for clients which expose rpc/ipc interfaces used by dapple. When I do something in the context of ethereum, the chain module will tell me how to actually talk to ethereum
  • env is for managing environments. An environment is a named set of object descriptions, which is an address and/or interface and/or definition (bytecode/source). Depending on what the module exports, people that import the package can refer to specific addresses in the deploy sequence, interact with deployed objects, or deploy new instances of defined classes.
  • step takes a Step definition, an environment, and a chain connection, and applies the step to the blockchain, using the environment to resolve variables. An example is deploy SomeContract($my_proxy_contact), where the environment would map $my_proxy_contract to an address and the chain would specify that you can talk to the chain at the default URL.

bool `HexTranslator` is not defined

/Users/nikolai/devenv/dapple/node_modules/solc/bin/soljson-latest.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](f

ReferenceError: that is not defined
    at Object.hexTranslators.bool [as val] (/Users/nikolai/devenv/dapple/lib/logtranslator.js:10:30)
    at /Users/nikolai/devenv/dapple/lib/logtranslator.js:54:48
    at /Users/nikolai/devenv/dapple/node_modules/lodash/index.js:3395:24
    at /Users/nikolai/devenv/dapple/node_modules/lodash/index.js:3073:15
    at baseForOwn (/Users/nikolai/devenv/dapple/node_modules/lodash/index.js:2046:14)
    at Function.mapValues (/Users/nikolai/devenv/dapple/node_modules/lodash/index.js:3394:9)
    at LogTranslator.translate (/Users/nikolai/devenv/dapple/lib/logtranslator.js:53:26)
    at arrayMap (/Users/nikolai/devenv/dapple/node_modules/lodash/index.js:1406:25)
    at Function.map (/Users/nikolai/devenv/dapple/node_modules/lodash/index.js:6710:14)
    at LogTranslator.translateAll (/Users/nikolai/devenv/dapple/lib/logtranslator.js:62:23)

subpackage ignore lists are not respected

to reproduce:

  1. create a package and ignore a file which doesn't compile. The package will build.
  2. add it as a subpackage and try to build. It tries to compile the ignored file in the subpackage.

[proposal] Use "Javascript Standard" style

Right now Dapple's code style is a bit inconsistent. I'd like to propose adopting a style guide of some sort. I've seen the Javascript Standard style floating around, and it looks as good as any other to me. Plus it has the advantage of having tools available that would allow us to incorporate style checking into our workflow.

Looking for feedback from @nmushegian @mhhf @drupalnomad and anyone else who might consider themselves a stakeholder in this decision.

Unable to publish dapp

  File "/usr/local/bin/dapple", line 9, in <module>
    load_entry_point('dapple==0.0.1a0', 'console_scripts', 'dapple')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 521, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2632, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2312, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2318, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.linux-x86_64/egg/dapple/__main__.py", line 11, in <module>
  File "/usr/local/lib/python2.7/dist-packages/click-5.1-py2.7.egg/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click-5.1-py2.7.egg/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click-5.1-py2.7.egg/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click-5.1-py2.7.egg/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click-5.1-py2.7.egg/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "build/bdist.linux-x86_64/egg/dapple_core/install.py", line 136, in cli_publish_package
  File "build/bdist.linux-x86_64/egg/ipfsApi/client.py", line 108, in add
  File "build/bdist.linux-x86_64/egg/ipfsApi/commands.py", line 48, in request
    def getoutput(cmd):
  File "build/bdist.linux-x86_64/egg/ipfsApi/commands.py", line 89, in directory
    s = s + '"'
  File "build/bdist.linux-x86_64/egg/ipfsApi/http.py", line 24, in wrapper
  File "build/bdist.linux-x86_64/egg/ipfsApi/http.py", line 85, in request
  File "/usr/lib/python2.7/dist-packages/requests/models.py", line 825, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found

excessive test error output

When dapple test emits a build error it is a bit much:

[nikolai:~/devenv/dappsys]$ dapple test                                                                                                            (master✱)
Testing...
Using local solc installation...
_b808a79698a9b8d6895e865d5dec7832670e167c5756db6e759ce55ee6f9b269.sol:30:9: Error: Expected token Semicolon
        assertFalse( t.transferFrom(bob, self, 1) );
        ^
/Users/nikolai/devenv/dapple/node_modules/solc/bin/soljson-latest.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](f

Error: Command failed: solc -o - --combined-json abi,bin,interface _0e7651d36fab71690040c9d5de72fe671fed5af6b8fceb77c7ba2d40cf9aafd0.sol _445d9c43b67e37734b3fa54a3528ebd7af75c5ca2f58f9d3637beb68993f100a.sol _25f1e8fafd9c4905611b2e5e759d4457fc544f4af3ea91ea7eebad75143af8f7.sol _e7d9842fd028e7425e024f58e9002a8d82b549bf121aed3eb47be6eb937546cd.sol _b563e0077003af2ede798715d41307b6f27b88a078f67bd142b17cc3459bf5f0.sol _fcfd119cc6ee85730870b00396f38db771798ba6638cb730f1e245a807a99c8e.sol _39acb140924d1e4463d794d2ca1365f84d358026f369e376e8d528e2c9697061.sol _27c8590c6c7eaeee572d5f1d4e8a01675f469f7ef5b2936be1be5f6e5f832eb9.sol _574b8f3e43b1844e442dfc169c287437b2293e4c3cd546a733af71d76cdbc3ed.sol _7570c66cb2a4431cc3c3f761402aa73d177d0ec3fb34fe7c8dd6e6f21b24ef64.sol _c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470.sol _632ccef2bc2191dfeab57df193b0b8405976fae20cb2afef08e29285b3be6f26.sol _ac0a349729e3a8f0a19533c0cba38f1b00a8eada10ca65020818122ee4c247c0.sol _5b5520af27b82c1c06fd265af80fe7b50e68f342a380e610b724ad338e044ccf.sol _ecf575f1656c23b160768d409a882a5115a2abc122e0d11e858ee0b713fa1447.sol _bbefd701cc4d2ba5fccc681e3fad8eed60dd57ee35a73977a75eb5dbd19eda22.sol _0b4b74e02af60cf0f72f23e7fc84c38d980c3a8c1f7903058265acf1b0626711.sol _d1cbebf6f0303bc8c586f2e7d746641e21e1f412e55b4aac95170d718adc286a.sol _b7109fc099c93e70adb790483c0e191d75ef689df2e3eef50dea01ac25add6b3.sol _02aa44cbe600160256e5e5a59948ecbefba554bfe630e741df96df5623e0d302.sol _e5b559a11138df60e4ac5f082613946c118824ed4e083135fe2e377b8685ad5d.sol _2fce2b7a65c313cc73c4be2dd31ef13628587066e64e9b5adc2aebd067be5a96.sol _d7889cca302ecbaf847095d9a8d6255bdb759614e836049d0886197b22341bd3.sol _7d038c773c083d6b0b4f23ca84825ddd528bec31b0dbfe025f3e861121397b14.sol _307ff7e5f8c37d941a0392a805fff33f5f1a4b8afb4fdbb3ba226b78985fd00e.sol _b003af82fed413abdfd9a4979d98c877b6854875363cb9f74bd08cbf182395ac.sol _c3f7dedff685db95d20db267a5f627bc52d0bb3f2bdef0ec9b66fa37428b862b.sol _00e28e241a47dc15a3331b1a9fea91e1b8e25f154df600f8b9866a8edc88322d.sol _dca36c003e7f54365159d1de79853d26284726bee2e9d954f80555cf23d11bce.sol _a8f84a5d1f37047759545c924862d856377743981e2f453ed0fa86e1bc232212.sol _731d02e0d953f0229cf98b8576054c0d186bd82e729e273d59b58d1c9afe5655.sol _4d5ad5e29fd61425b2c9c1a5dd10e724fa8d827465637c6476cb58a440ac229b.sol _e7ae51985df4a8c0d4ad3cf06de9a4150761175bfafae21ac2c0a66ee094fc45.sol _8e424b62c347dbf7b3b12d59c6c9f62b866253c05e4b5a4320f59d0bdbce6d8a.sol _d5bdfd742dab919aaea7b42f240221adc54cd010b6be0fc1a616d241d81ee9e2.sol _23222f6940c2d21ebdd5cf00254ce70e35d18c4134b98659c95cc20a3872388d.sol _7f1f3102e32cbca7bd9439ce74cca169315b62d63e5275e19b227b14112b4aa4.sol _f809b572cfa54b1e0e4c31bd492f6577f862007994b857222f93b8f2fbf73ec4.sol _b808a79698a9b8d6895e865d5dec7832670e167c5756db6e759ce55ee6f9b269.sol _59676097b1165e387f9fb863fd19c6588c4a2dbf794271bec6e309ad31dc8777.sol _c49b3b0d54d4cf127f662d9d5fafea154c0603e5837bb2d210f752433ff08549.sol _e9d5714a9f5d36d96f7ad560b14cb5e0a2b0a150b4051a70b986b74163b1507b.sol _3f3c8ee65e5e97d9719bcebb1dc16f092af6640192d9fbec7ecad54cc1d426f1.sol _b280bf1c87d442fe49a7786e86bf217c4cc2b41b5ae0f1d569a7bdd9f968d987.sol
_b808a79698a9b8d6895e865d5dec7832670e167c5756db6e759ce55ee6f9b269.sol:30:9: Error: Expected token Semicolon
        assertFalse( t.transferFrom(bob, self, 1) );
        ^

    at checkExecSyncError (child_process.js:441:13)
    at Object.execSync (child_process.js:481:13)
    at Function.compile (/Users/nikolai/devenv/dapple/lib/native_compiler.js:29:47)
    at Function.buildSources (/Users/nikolai/devenv/dapple/lib/build.js:45:33)
    at DestroyableTransform._flush (/Users/nikolai/devenv/dapple/lib/streams/build.js:19:32)
    at DestroyableTransform.<anonymous> (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_transform.js:123:12)
    at DestroyableTransform.g (events.js:260:16)
    at emitNone (events.js:67:13)
    at DestroyableTransform.emit (events.js:166:7)
    at prefinish (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_writable.js:501:12)
    at finishMaybe (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_writable.js:509:7)

"Test class definition has no bytecode"

try building this: https://github.com/NexusDevelopment/dappsys/releases/tag/0.2-audit-part2

/Users/nikolai/devenv/dapple/node_modules/solc/bin/soljson-latest.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](f

Error: Test class definition has no bytecode
    at new Contract (/Users/nikolai/devenv/dapple/lib/contract.js:8:19)
    at DestroyableTransform._transform (/Users/nikolai/devenv/dapple/lib/streams/test.js:42:32)
    at DestroyableTransform.Transform._read (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_transform.js:172:10)
    at DestroyableTransform.Transform._write (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_transform.js:160:12)
    at doWrite (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_writable.js:335:12)
    at writeOrBuffer (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_writable.js:321:5)
    at DestroyableTransform.Writable.write (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_writable.js:248:11)
    at Stream.method [as write] (/Users/nikolai/devenv/dapple/node_modules/duplexer/index.js:47:39)
    at DestroyableTransform.ondata (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_readable.js:583:20)

problems with setup script, can't run tests

Testing DSUpdateChainTest
  testBasicUpdate
Traceback (most recent call last):
  File "/Users/nikolai/.virtualenvs/makerdao/bin/dapple", line 9, in <module>
    load_entry_point('dapple==0.0.1a0', 'console_scripts', 'dapple')()
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "build/bdist.macosx-10.10-intel/egg/dapple/__main__.py", line 24, in test
  File "build/bdist.macosx-10.10-intel/egg/dapple/__init__.py", line 172, in test
TypeError: __init__() got an unexpected keyword argument 'log_listener'

transaction fail during `dapple test`

(makerdao)[nikolai:~/maker-project/ens]$ dapple test                                                                                                                                                                               (master✱)
No handlers could be found for logger "eth.pow"
Testing ENSTest
  testCuratedNameregGet
Traceback (most recent call last):
  File "/Users/nikolai/.virtualenvs/makerdao/bin/dapple", line 9, in <module>
    load_entry_point('dapple==0.0.1a0', 'console_scripts', 'dapple')()
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
    return ep.load()
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2355, in load
    return self.resolve()
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2361, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.macosx-10.10-intel/egg/dapple/__main__.py", line 11, in <module>
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "build/bdist.macosx-10.10-intel/egg/dapple_core/__init__.py", line 494, in test
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/ethertdd/__init__.py", line 53, in kall
    'value', 'output'))
  File "/Users/nikolai/.virtualenvs/makerdao/lib/python2.7/site-packages/ethereum/tester.py", line 201, in _send
    raise TransactionFailed()
ethereum.tester.TransactionFailed

cannot read property `secretKey` of undefined account

Look at NexusDevelopment/dappsys @ 35888f3

/Users/nikolai/devenv/dapple/node_modules/solc/bin/soljson-latest.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](f

TypeError: Cannot read property 'secretKey' of undefined
    at Blockchain.processCall (/Users/nikolai/devenv/dapple/node_modules/ethersim/lib/blockchain.js:495:50)
    at Blockchain.processNextAction (/Users/nikolai/devenv/dapple/node_modules/ethersim/lib/blockchain.js:382:10)
    at intermediary (/Users/nikolai/devenv/dapple/node_modules/ethersim/lib/blockchain.js:370:12)
    at /Users/nikolai/devenv/dapple/node_modules/ethersim/lib/blockchain.js:415:9
    at parseBlockResults (/Users/nikolai/devenv/dapple/node_modules/ethereumjs-vm/lib/runBlock.js:142:7)
    at /Users/nikolai/devenv/dapple/node_modules/async/lib/async.js:721:13
    at /Users/nikolai/devenv/dapple/node_modules/async/lib/async.js:52:16
    at /Users/nikolai/devenv/dapple/node_modules/async/lib/async.js:264:21
    at /Users/nikolai/devenv/dapple/node_modules/async/lib/async.js:44:16
    at /Users/nikolai/devenv/dapple/node_modules/async/lib/async.js:718:17

package usability improvements

I think dependencies should be in a file that is visible by default. I think packages should be in a folder that is either visible at the top level or git ignored by default.

very slow startup time

Starting dapple with no args just to get the usage takes over 1 second. This is longer than it takes solc to compile the package

Unable to run latest dapple

/usr/lib/node_modules/dapple/lib/workspace.js:21
module.exports = class Workspace {
                 ^^^^^
SyntaxError: Unexpected reserved word
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/lib/node_modules/dapple/cmd/main.js:5:17)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

complete example dappfile

the dappfile in the example package is missing some use cases (specifying root contract src, for example)

the naming things issue

.dapple: It is a bit annoying that this is invisible. The dappfile or at least the packages subtree should be in a visible file

core could be called something which implies that it's not used in deployed contracts and it's specific to dapple

`dapple init` requires sudo

dapple init requires sudo, and then it sets the dappfile to be read-only (requiring sudo to edit).

Neither should be necessary

clean up python environment

There are some implicit dependencies. The setup guide should show you how to put them into a virtualenv.

dapple should use standard pythons setup.py instead of being a shebanged script

`dapple step` design issue

dapple step and dapple run commands run transaction steps / sequences written in a DSL. For now, we will use json files much like Embark.

The purpose is to rigorously manage contract system manipulations on chain. By creating a DSL and an engine that executes it instead of simply promoting the use of JS-based deploy scripts we can stop the "sysadmin" from making any mistakes.

The step types are not defined in the most recent usage proposal: https://github.com/NexusDevelopment/dapple/blob/master/docs-old/usage-proposal.md

step context

Each step is run in the context of a named chain connection ("morden") and a partial environment (the constant mapping in the dappfile)

Brainstorming distinct step types

TODO distinguish between variables that are to be saved to environment and ones that are used during script execution. Maybe there is no distinction, because where should the "transient" variables be stored? The script should be able to fail at any point and recover the exact state of the system.

$var1 = deploy TypeName arg1 arg2 ... [value:N] [gas:M]

$var2 = send [TypeName] <address> args ...

tmp_result = call $addr args <- save transient variables for args / asserts

assert* mirroring VMTest. Fail as early as possible if the system enters unexpected state.

run ... run sub-sequence

useKey ... use a specific private key

export varName [as objectKeyName] If as objectKeyName is omitted, the exported name defaults to the name of the variable.

[brainstorm] vm test enhancements

  • Right now debug events are only tracked for the test contract itself. They should be tracked either for all contracts, or by selectively watching them with a new Debug function
  • The Test contract should be able to manipulate VM state like block height or timestamp
  • The Test contract should get an endowment from the test origin
  • expectEvent method that expects the next sequence of events fired by the test contract to exactly match the sequence of events fired by all contracts afterwards

So VMTest needs to maintain test harness state

dependencies still not linking properly

[nikolai:~/maker-project/maker-core]$ dapple build                                                           (master✱)
Building...
/Users/nikolai/devenv/dapple/lib/workspace.js:103
        for (let glob of this.dappfile.ignore) {
                                      ^

TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
    at Workspace.getIgnoreGlobs (/Users/nikolai/devenv/dapple/lib/workspace.js:103:39)
    at Object.<anonymous> (/Users/nikolai/devenv/dapple/cmd/main.js:89:31)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:136:18)
    at node.js:972:3

Allow excluding test classes from build output

There should be a way to exclude classes from the build output via regex, similar to the way that we can skip tests by regex. I'm particularly interested in being able to remove test classes from the build output. While we could do this via an interface check like the one @mhhf wrote, leveraging the same flag used by the test command seems like a better option than introducing a new one.

measure gas costs during tests

It would be neat to have a history of what changes caused gas price increases.

First step would be to create new time* (gas_?) functions to go with the test_ functions in the harness

excessive test error output

When dapple test emits a build error it is a bit much:

[nikolai:~/devenv/dappsys]$ dapple test                                                                                                            (master✱)
Testing...
Using local solc installation...
_b808a79698a9b8d6895e865d5dec7832670e167c5756db6e759ce55ee6f9b269.sol:30:9: Error: Expected token Semicolon
        assertFalse( t.transferFrom(bob, self, 1) );
        ^
/Users/nikolai/devenv/dapple/node_modules/solc/bin/soljson-latest.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](f

Error: Command failed: solc -o - --combined-json abi,bin,interface _0e7651d36fab71690040c9d5de72fe671fed5af6b8fceb77c7ba2d40cf9aafd0.sol _445d9c43b67e37734b3fa54a3528ebd7af75c5ca2f58f9d3637beb68993f100a.sol _25f1e8fafd9c4905611b2e5e759d4457fc544f4af3ea91ea7eebad75143af8f7.sol _e7d9842fd028e7425e024f58e9002a8d82b549bf121aed3eb47be6eb937546cd.sol _b563e0077003af2ede798715d41307b6f27b88a078f67bd142b17cc3459bf5f0.sol _fcfd119cc6ee85730870b00396f38db771798ba6638cb730f1e245a807a99c8e.sol _39acb140924d1e4463d794d2ca1365f84d358026f369e376e8d528e2c9697061.sol _27c8590c6c7eaeee572d5f1d4e8a01675f469f7ef5b2936be1be5f6e5f832eb9.sol _574b8f3e43b1844e442dfc169c287437b2293e4c3cd546a733af71d76cdbc3ed.sol _7570c66cb2a4431cc3c3f761402aa73d177d0ec3fb34fe7c8dd6e6f21b24ef64.sol _c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470.sol _632ccef2bc2191dfeab57df193b0b8405976fae20cb2afef08e29285b3be6f26.sol _ac0a349729e3a8f0a19533c0cba38f1b00a8eada10ca65020818122ee4c247c0.sol _5b5520af27b82c1c06fd265af80fe7b50e68f342a380e610b724ad338e044ccf.sol _ecf575f1656c23b160768d409a882a5115a2abc122e0d11e858ee0b713fa1447.sol _bbefd701cc4d2ba5fccc681e3fad8eed60dd57ee35a73977a75eb5dbd19eda22.sol _0b4b74e02af60cf0f72f23e7fc84c38d980c3a8c1f7903058265acf1b0626711.sol _d1cbebf6f0303bc8c586f2e7d746641e21e1f412e55b4aac95170d718adc286a.sol _b7109fc099c93e70adb790483c0e191d75ef689df2e3eef50dea01ac25add6b3.sol _02aa44cbe600160256e5e5a59948ecbefba554bfe630e741df96df5623e0d302.sol _e5b559a11138df60e4ac5f082613946c118824ed4e083135fe2e377b8685ad5d.sol _2fce2b7a65c313cc73c4be2dd31ef13628587066e64e9b5adc2aebd067be5a96.sol _d7889cca302ecbaf847095d9a8d6255bdb759614e836049d0886197b22341bd3.sol _7d038c773c083d6b0b4f23ca84825ddd528bec31b0dbfe025f3e861121397b14.sol _307ff7e5f8c37d941a0392a805fff33f5f1a4b8afb4fdbb3ba226b78985fd00e.sol _b003af82fed413abdfd9a4979d98c877b6854875363cb9f74bd08cbf182395ac.sol _c3f7dedff685db95d20db267a5f627bc52d0bb3f2bdef0ec9b66fa37428b862b.sol _00e28e241a47dc15a3331b1a9fea91e1b8e25f154df600f8b9866a8edc88322d.sol _dca36c003e7f54365159d1de79853d26284726bee2e9d954f80555cf23d11bce.sol _a8f84a5d1f37047759545c924862d856377743981e2f453ed0fa86e1bc232212.sol _731d02e0d953f0229cf98b8576054c0d186bd82e729e273d59b58d1c9afe5655.sol _4d5ad5e29fd61425b2c9c1a5dd10e724fa8d827465637c6476cb58a440ac229b.sol _e7ae51985df4a8c0d4ad3cf06de9a4150761175bfafae21ac2c0a66ee094fc45.sol _8e424b62c347dbf7b3b12d59c6c9f62b866253c05e4b5a4320f59d0bdbce6d8a.sol _d5bdfd742dab919aaea7b42f240221adc54cd010b6be0fc1a616d241d81ee9e2.sol _23222f6940c2d21ebdd5cf00254ce70e35d18c4134b98659c95cc20a3872388d.sol _7f1f3102e32cbca7bd9439ce74cca169315b62d63e5275e19b227b14112b4aa4.sol _f809b572cfa54b1e0e4c31bd492f6577f862007994b857222f93b8f2fbf73ec4.sol _b808a79698a9b8d6895e865d5dec7832670e167c5756db6e759ce55ee6f9b269.sol _59676097b1165e387f9fb863fd19c6588c4a2dbf794271bec6e309ad31dc8777.sol _c49b3b0d54d4cf127f662d9d5fafea154c0603e5837bb2d210f752433ff08549.sol _e9d5714a9f5d36d96f7ad560b14cb5e0a2b0a150b4051a70b986b74163b1507b.sol _3f3c8ee65e5e97d9719bcebb1dc16f092af6640192d9fbec7ecad54cc1d426f1.sol _b280bf1c87d442fe49a7786e86bf217c4cc2b41b5ae0f1d569a7bdd9f968d987.sol
_b808a79698a9b8d6895e865d5dec7832670e167c5756db6e759ce55ee6f9b269.sol:30:9: Error: Expected token Semicolon
        assertFalse( t.transferFrom(bob, self, 1) );
        ^

    at checkExecSyncError (child_process.js:441:13)
    at Object.execSync (child_process.js:481:13)
    at Function.compile (/Users/nikolai/devenv/dapple/lib/native_compiler.js:29:47)
    at Function.buildSources (/Users/nikolai/devenv/dapple/lib/build.js:45:33)
    at DestroyableTransform._flush (/Users/nikolai/devenv/dapple/lib/streams/build.js:19:32)
    at DestroyableTransform.<anonymous> (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_transform.js:123:12)
    at DestroyableTransform.g (events.js:260:16)
    at emitNone (events.js:67:13)
    at DestroyableTransform.emit (events.js:166:7)
    at prefinish (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_writable.js:501:12)
    at finishMaybe (/Users/nikolai/devenv/dapple/node_modules/readable-stream/lib/_stream_writable.js:509:7)

utilize solidity linking feature

Heads up for solc integrators: It will soon be possible to automatically import files that are not explicitly specified on the commandline. This might compromise the integrity of your server. Please contact me if you have such a use case.

This should let us delete some linker code. Also serves as a sanity check on our linking design.

add `testharness` class

extends Test and takes testees and dependencies as arguments. To test derived contracts that mess with internals

`dapple test` broken

TypeError: provider.manager.blockchain.setGasLimit is not a function
    at Object.module.exports.EVM (/Users/nikolai/devenv/dapple/lib/web3Factory.js:33:37)
    at DestroyableTransform._transform (/Users/nikolai/devenv/dapple/lib/streams.js:177:36)
    at DestroyableTransform.Transform._read (/Users/nikolai/devenv/dapple/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:10)
    at DestroyableTransform.Transform._write (/Users/nikolai/devenv/dapple/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:160:12)
    at doWrite (/Users/nikolai/devenv/dapple/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:333:12)
    at writeOrBuffer (/Users/nikolai/devenv/dapple/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:319:5)
    at DestroyableTransform.Writable.write (/Users/nikolai/devenv/dapple/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:246:11)
    at Stream.method [as write] (/Users/nikolai/devenv/dapple/node_modules/duplexer/index.js:47:39)
    at DestroyableTransform.ondata (/Users/nikolai/devenv/dapple/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:581:20)
    at emitOne (events.js:77:13)

change dappfile to new context definition

Old version:

name: 'dappsys'
version: '0.0.1a'
source_dir: 'contracts'
dependencies:
    core: 'latest'
ignore:
    - kern/perm_db.sol
    - control/proxy_actor_test.sol
constants:
    ds_static_math_singleton: '0x0'
environments:
    dev.constants.ds_static_math_singleton: '0x1'
    prod.constants.ds_static_math_singleton: '0x2'

new version

name: 'my_dapple_package'
version: '0.0.1a'
source_dir: 'contracts'
ignore:
    - admin.sol
dependencies:
    core:
context:
    ethereum:
        "ens_app": 0x0
        "dappsys.ds_static_math": 0x2
    dev:
        "ens_app": 0x4

Incorrect aliasing of subpackages

Subpackage building does not work - the subpackages look for their imports from parent package root, it seems. To reproduce, put dappsys inside dapple_packages and try to build.

add `dapple new test` command

dapple new test ExampleContract

should generate:

example_contract.sol:

contract ExampleContract {
}

example_contract_test.sol:

contract ExampleContractTest is Test {
    ExampleContract target;
    function setUp() {
        target = new ExampleContract(  );
    }
    function test___ () {

    }
}

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.