9 changed files with 0 additions and 244 deletions
@ -1,67 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
CPP_ETHEREUM_PATH=$(pwd) |
|||
BUILD_DIR=$CPP_ETHEREUM_PATH/build |
|||
TEST_MODE="" |
|||
|
|||
for i in "$@" |
|||
do |
|||
case $i in |
|||
-builddir) |
|||
shift |
|||
((i++)) |
|||
BUILD_DIR=${!i} |
|||
shift |
|||
;; |
|||
--all) |
|||
TEST_MODE="--all" |
|||
shift |
|||
;; |
|||
--filltests) |
|||
TEST_FILL="--filltests" |
|||
shift |
|||
;; |
|||
esac |
|||
done |
|||
|
|||
which $BUILD_DIR/test/testeth >/dev/null 2>&1 |
|||
if [ $? != 0 ] |
|||
then |
|||
echo "You need to compile and build ethereum with cmake -DPROFILING option to the build dir!" |
|||
exit; |
|||
fi |
|||
|
|||
OUTPUT_DIR=$BUILD_DIR/test/coverage |
|||
if which lcov >/dev/null; then |
|||
if which genhtml >/dev/null; then |
|||
echo Cleaning previous report... |
|||
if [ -d "$OUTPUT_DIR" ]; then |
|||
rm -r $OUTPUT_DIR |
|||
fi |
|||
mkdir $OUTPUT_DIR |
|||
lcov --directory $BUILD_DIR --zerocounters |
|||
lcov --capture --initial --directory $BUILD_DIR --output-file $OUTPUT_DIR/coverage_base.info |
|||
|
|||
echo Running testeth... |
|||
$BUILD_DIR/test/testeth $TEST_MODE $TEST_FILL |
|||
$BUILD_DIR/test/testeth -t StateTests --jit $TEST_MODE |
|||
$BUILD_DIR/test/testeth -t VMTests --jit $TEST_MODE |
|||
|
|||
echo Prepearing coverage info... |
|||
lcov --capture --directory $BUILD_DIR --output-file $OUTPUT_DIR/coverage_test.info |
|||
lcov --add-tracefile $OUTPUT_DIR/coverage_base.info --add-tracefile $OUTPUT_DIR/coverage_test.info --output-file $OUTPUT_DIR/coverage_all.info |
|||
lcov --extract $OUTPUT_DIR/coverage_all.info *cpp-ethereum/* --output-file $OUTPUT_DIR/coverage_export.info |
|||
genhtml $OUTPUT_DIR/coverage_export.info --output-directory $OUTPUT_DIR/testeth |
|||
else |
|||
echo genhtml not found |
|||
exit; |
|||
fi |
|||
else |
|||
echo lcov not found |
|||
exit; |
|||
fi |
|||
|
|||
echo "Coverage info should be located at: $OUTPUT_DIR/testeth" |
|||
echo "Opening index..." |
|||
|
|||
xdg-open $OUTPUT_DIR/testeth/index.html & |
@ -1,19 +0,0 @@ |
|||
{ |
|||
(def 'gav 0x51ba59315b3a95761d0863b05ccc7a7f54703d99) |
|||
|
|||
(def 'alloc (len) (asm msize 0 1 len msize add sub mstore8)) |
|||
|
|||
(def 'send (to value) (call (- (gas) 21) to value 0 0 0 0)) |
|||
(def 'send (gaslimit to value) (call gaslimit to value 0 0 0 0)) |
|||
(def 'msg (gaslimit to value data datasize outsize) { [32]:outsize [0]:(alloc @32) (call gaslimit to value data datasize @0 @32) @0 }) |
|||
(def 'msg (gaslimit to value data datasize) { (call gaslimit to value data datasize 0 32) @0 }) |
|||
(def 'msg (gaslimit to value data) { [0]:data (msg gaslimit to value 0 32) }) |
|||
(def 'create (to value code) { [0]:(msize) (create to value @0 (lll code @0)) }) |
|||
|
|||
(def 'sha3 (val) { [0]:val (sha3 0 32) }) |
|||
(def 'return (val) { [0]:val (return 0 32) }) |
|||
|
|||
(def 'makeperm (name pos) { (def name (sload pos)) (def name (v) (sstore pos v)) } ) |
|||
(def 'permcount 0) |
|||
(def 'perm (name) { (makeperm name permcount) (def 'permcount (+ permcount 1)) } ) |
|||
} |
@ -1,4 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
git checkout "$1+" && git merge --no-ff develop && git push && git tag -f $1 && git push --tags -f && git checkout develop |
|||
|
@ -1,4 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
git checkout master && git merge --no-ff $1+ && git push && git tag -f $1 && git push --tags -f |
|||
|
@ -1,21 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
type="$1" |
|||
path="$2" |
|||
name="$3" |
|||
|
|||
if ! [[ -n $type ]] || ! [[ -n $path ]] || ! [[ -n $name ]]; then |
|||
echo "Usage new.sh <type> <path> <name>" |
|||
echo "e.g. new.sh plugin alethzero MyPlugin" |
|||
exit |
|||
fi |
|||
|
|||
cd templates |
|||
for i in $type.*; do |
|||
n="../$path/${i/$type/$name}" |
|||
cp "$i" "$n" |
|||
perl -i -p -e "s/\\\$NAME/$name/gc" "$n" |
|||
done |
|||
|
|||
|
|||
|
@ -1,39 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE QtCreatorCodeStyle> |
|||
<!-- Written by QtCreator 3.0.1, 2014-10-16T20:02:31. --> |
|||
<qtcreator> |
|||
<data> |
|||
<variable>CodeStyleData</variable> |
|||
<valuemap type="QVariantMap"> |
|||
<value type="bool" key="AlignAssignments">false</value> |
|||
<value type="bool" key="AutoSpacesForTabs">false</value> |
|||
<value type="bool" key="BindStarToIdentifier">true</value> |
|||
<value type="bool" key="BindStarToLeftSpecifier">false</value> |
|||
<value type="bool" key="BindStarToRightSpecifier">false</value> |
|||
<value type="bool" key="BindStarToTypeName">false</value> |
|||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value> |
|||
<value type="bool" key="IndentAccessSpecifiers">false</value> |
|||
<value type="bool" key="IndentBlockBody">true</value> |
|||
<value type="bool" key="IndentBlockBraces">false</value> |
|||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value> |
|||
<value type="bool" key="IndentClassBraces">false</value> |
|||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value> |
|||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value> |
|||
<value type="bool" key="IndentEnumBraces">false</value> |
|||
<value type="bool" key="IndentFunctionBody">true</value> |
|||
<value type="bool" key="IndentFunctionBraces">false</value> |
|||
<value type="bool" key="IndentNamespaceBody">false</value> |
|||
<value type="bool" key="IndentNamespaceBraces">false</value> |
|||
<value type="int" key="IndentSize">4</value> |
|||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value> |
|||
<value type="bool" key="IndentSwitchLabels">false</value> |
|||
<value type="int" key="PaddingMode">2</value> |
|||
<value type="bool" key="SpacesForTabs">false</value> |
|||
<value type="int" key="TabSize">4</value> |
|||
</valuemap> |
|||
</data> |
|||
<data> |
|||
<variable>DisplayName</variable> |
|||
<value type="QString">Gav</value> |
|||
</data> |
|||
</qtcreator> |
@ -1,8 +0,0 @@ |
|||
# Ignore standard library headers. |
|||
src:*/include/c\+\+/* |
|||
|
|||
# Ignore boost libraries headers. |
|||
src:*/include/boost/* |
|||
|
|||
# Ignore Crypto++ library. We plan to remove it in the future. It exploits interger overflow and uses memcpy incorrectly. |
|||
src:*/include/cryptopp/* |
@ -1,30 +0,0 @@ |
|||
var compile = function(name) { return web3.eth.solidity(env.contents("/home/gav/Eth/dapp-bin/" + name + "/" + name + ".sol")); web3.eth.flush(); }; |
|||
var create = function(code) { return web3.eth.transact({ 'code': code }); web3.eth.flush(); }; |
|||
var createVal = function(code, val) { return web3.eth.transact(val ? { 'code': code, 'value': val } : { 'code': code }); web3.eth.flush(); }; |
|||
var send = function(from, val, to) { web3.eth.transact({ 'from': from, 'value': val, 'to': to }); web3.eth.flush(); }; |
|||
var initService = function(name) { return create(compile(name)); }; |
|||
var initServiceVal = function(name, val) { createVal(compile(name), val); }; |
|||
|
|||
var addrConfig = create(compile("config")); |
|||
var addrNameReg = initService("namereg"); |
|||
var addrGavsino = initServiceVal("gavmble", "1000000000000000000"); |
|||
var addrCoinReg = initService("coins"); |
|||
var addrGavCoin = initService("coin"); |
|||
|
|||
var addrRegistrar = initService("registrar"); |
|||
|
|||
var abiNameReg = [{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"getName","outputs":[{"name":"o_name","type":"string32"}]},{"constant":false,"inputs":[{"name":"name","type":"string32"}],"name":"register","outputs":[]},{"constant":true,"inputs":[{"name":"name","type":"string32"}],"name":"addressOf","outputs":[{"name":"addr","type":"address"}]},{"constant":true,"inputs":[{"name":"_name","type":"string32"}],"name":"getAddress","outputs":[{"name":"o_owner","type":"address"}]},{"constant":false,"inputs":[],"name":"unregister","outputs":[]},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"nameOf","outputs":[{"name":"name","type":"string32"}]}]; |
|||
var regName = function(account, name) { return web3.eth.contract(addrNameReg, abiNameReg).transact({'from': account, 'gas': 10000}).register(name); }; |
|||
|
|||
send(web3.eth.accounts[0], '100000000000000000000', web3.eth.accounts[1]); |
|||
regName(web3.eth.accounts[0], 'Gav'); |
|||
regName(web3.eth.accounts[1], 'Gav Would'); |
|||
|
|||
// TODO: once we have the exchange.
|
|||
// var offer = function(account, haveCoin, haveVal, wantCoin, wantVal) { web3.eth.transact({ 'from': account, 'to': exchange, 'gas': '10000', 'data': [web3.fromAscii('new'), haveCoin, haveVal, wantCoin, wantVal] }); };
|
|||
// approve(accounts[0], exchange).then(function(){ offer(accounts[0], coin, '5000', '0', '5000000000000000000'); });
|
|||
// funded.then(function(){ approve(accounts[1], exchange); });
|
|||
|
|||
// TODO: once we have a new implementation of DNSReg.
|
|||
// env.note('Register gav.eth...')
|
|||
// eth.transact({ 'to': dnsReg, 'data': [web3.fromAscii('register'), web3.fromAscii('gav'), web3.fromAscii('opensecrecy.com')] });
|
@ -1,52 +0,0 @@ |
|||
var compile = function(name) { return web3.eth.lll(env.contents("../../dapp-bin/" + name + "/" + name + ".lll")); }; |
|||
var create = function(code) { return web3.eth.transact({ 'code': code }); }; |
|||
var send = function(from, val, to) { return web3.eth.transact({ 'from': from, 'value': val, 'to': to }); }; |
|||
var initService = function(name, index, dep) { return dep.then(function(){ var ret = compile(name).then(create); register(ret, index); return ret; }); }; |
|||
|
|||
var config = compile("config").then(create); |
|||
var register = function(address, index) { return web3.eth.transact({ 'to': config, 'gas': '10000', 'data': [index + '', address] }); }; |
|||
var nameReg = initService("namereg", 0, config); |
|||
var regName = function(account, name) { return web3.eth.transact({ 'from': account, 'to': nameReg, 'gas': '10000', 'data': [ web3.fromAscii('register'), web3.fromAscii(name) ] }); }; |
|||
var coins = initService("coins", 1, nameReg); |
|||
var coin = initService("coin", 2, coins); |
|||
var approve = function(account, approvedAddress) { web3.eth.transact({ 'from': account, 'to': coin, 'gas': '10000', 'data': [ web3.fromAscii('approve'), approvedAddress ] }); }; |
|||
var exchange = initService("exchange", 3, coin); |
|||
var offer = function(account, haveCoin, haveVal, wantCoin, wantVal) { web3.eth.transact({ 'from': account, 'to': exchange, 'gas': '10000', 'data': [web3.fromAscii('new'), haveCoin, haveVal, wantCoin, wantVal] }); }; |
|||
|
|||
config.then(function() { |
|||
web3.eth.accounts.then(function(accounts) |
|||
{ |
|||
var funded = send(accounts[0], '100000000000000000000', accounts[1]); |
|||
funded.then(function(){ regName(accounts[1], 'Gav Would'); approve(accounts[1], exchange); }); |
|||
regName(accounts[0], 'Gav'); |
|||
approve(accounts[0], exchange).then(function(){ offer(accounts[0], coin, '5000', '0', '5000000000000000000'); }); |
|||
|
|||
// TODO: once we have a new implementation of DNSReg.
|
|||
// env.note('Register gav.eth...')
|
|||
// eth.transact({ 'to': dnsReg, 'data': [web3.fromAscii('register'), web3.fromAscii('gav'), web3.fromAscii('opensecrecy.com')] });
|
|||
}); |
|||
}); |
|||
|
|||
// TODO
|
|||
/* |
|||
var nameRegJeff; |
|||
|
|||
env.note('Create NameRegJeff...') |
|||
eth.transact({ 'code': nameRegCode }, function(a) { nameRegJeff = a; }); |
|||
|
|||
env.note('Register NameRegJeff...') |
|||
eth.transact({ 'to': config, 'data': ['4', nameRegJeff] }); |
|||
|
|||
var dnsRegCode = '0x60006000546000600053602001546000600053604001546020604060206020600073661005d2720d855f1d9976f88bb10c1a3398c77f6103e8f17f7265676973746572000000000000000000000000000000000000000000000000600053606001600060200201547f446e735265670000000000000000000000000000000000000000000000000000600053606001600160200201546000600060006000604060606000600053604001536103e8f1327f6f776e65720000000000000000000000000000000000000000000000000000005761011663000000e46000396101166000f20060006000547f72656769737465720000000000000000000000000000000000000000000000006000602002350e0f630000006d596000600160200235560e0f630000006c59600032560e0f0f6300000057596000325657600260200235600160200235576001602002353257007f64657265676973746572000000000000000000000000000000000000000000006000602002350e0f63000000b95960016020023532560e0f63000000b959600032576000600160200235577f6b696c6c000000000000000000000000000000000000000000000000000000006000602002350e0f630000011559327f6f776e6572000000000000000000000000000000000000000000000000000000560e0f63000001155932ff00'; |
|||
|
|||
var dnsReg; |
|||
env.note('Create DnsReg...') |
|||
eth.transact({ 'code': dnsRegCode }, function(a) { dnsReg = a; }); |
|||
|
|||
env.note('DnsReg at address ' + dnsReg) |
|||
|
|||
env.note('Register DnsReg...') |
|||
eth.transact({ 'to': config, 'data': ['4', dnsReg] }); |
|||
*/ |
|||
|
|||
// env.load('/home/gav/Eth/cpp-ethereum/stdserv.js')
|
Loading…
Reference in new issue