Skip to content

Instantly share code, notes, and snippets.

@hugo-dc
hugo-dc / sshot.hs
Created February 18, 2015 19:04
Screenshot with Haskell
import Graphics.Win32.Window
import Graphics.Win32.GDI.Bitmap
import Graphics.Win32.GDI.HDC
import Graphics.Win32.GDI.Graphics2D
main = do desktop <- getDesktopWindow -- Grab the Hwnd of the desktop, GetDC 0, GetDC NULL etc all work too
hdc <- getWindowDC (Just desktop) -- Get the dc handle of the desktop
(x,y,r,b) <- getWindowRect desktop -- Find the size of the desktop so we can know which size the destination bitmap should be
-- (left, top, right, bottom)
newDC <- createCompatibleDC (Just hdc) -- Create a new DC to hold the copied image. It should be compatible with the source DC
@hugo-dc
hugo-dc / puzzle.py
Last active August 29, 2015 14:18 — forked from jdavis/puzzle.py
def cons(x, y):
return lambda f: f(x, y)
def car(x):
# Fill out this function
pass
if car(cons(1, 5)) == 1:
print 'Solved!'
else:

Welcome

This guide is intended to provide resources for those wanting to help test Metropolis EIPs. The CPP team is currently in the middle of a migration from EthDocs to a documentation site that is more dedicated to CPP-Ethereum so the documentation on creating tests for Ethereum using testeth is scattered. Everything you will need to get started should be compiled below.

Suggested skill sets needed to create and run tests

  1. Ability to compile/build testeth and LLL compiler or run a docker file.
  2. Ability to understand the LLL Ethereum language.
  3. Ability to understand EIPs, particuarly [those that are going to be going into t

Keybase proof

I hereby claim:

  • I am hugo-dc on github.
  • I am hugo_dc (https://keybase.io/hugo_dc) on keybase.
  • I have a public key ASBn7MHl-WLMUwI_gwYYZb1CjwaWKjjbXlaB6kIFyM4zsAo

To claim this, I am signing this object:

[test](develop)$ ETHEREUM_TEST_PATH=/Users/hugo/workspace/EWASM/GasUsage/tests ./testeth -t GeneralStateTests/stEWASMTests -- --filltests --vm hera --singlenet "Byzantium"
Running 1 test case...
Test Case "stEWASMTests":
Executing...
$callDelegate 3e8 0 0 14 2
Executing...
getAddress 20
storageStore 0 20
Out of gas :(
DEBUG printMemHex(0x36:0x20): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
@hugo-dc
hugo-dc / cpp-ethereum_brk.md
Last active April 27, 2018 04:33
cpp-ethereum breakpoints
| Testcase | Passing | Failures |
|--------------------------------------+---------+----------|
| stArgsZeroOneBalance | | 28 |
| stAttackTest | | 1 |
| stBadOpcode | X | |
| stBugs | | 2 |
| stCallCodes | | 1 |
| stCallCreateCallCodeTest | | 1 |
| stCallDelegateCodesCallCodeHomestead | | 2 |
| stCallDelegateCodesHomestead | | 33 |
@hugo-dc
hugo-dc / call_OOG_additionalGasCosts1.txt
Last active May 29, 2018 18:21
stCallCodes failing tests
test/testeth -t GeneralStateTests/stCallCodes -- --testpath /home/ewasm/hugo-dc/cpp-ethereum/test/jsontests --singlenet "Byzantium" --singletest "call_OOG_additionalGasCosts1" --jsontrace ''
Running tests using path: "/home/ewasm/hugo-dc/cpp-ethereum/test/jsontests"
Running 1 test case...
Test Case "stCallCodes":
100%
[{"depth":"0","gas":"9000","gasCost":"3","memory":[],"op":"PUSH1","pc":"0","stack":[],"storage":{}},
{"depth":"0","gas":"8997","gasCost":"3","op":"PUSH1","pc":"2","stack":["0x40"]},
{"depth":"0","gas":"8994","gasCost":"3","op":"PUSH1","pc":"4","stack":["0x40","0x00"]},
{"depth":"0","gas":"8991","gasCost":"3","op":"PUSH1","pc":"6","stack":["0x40","0x00","0x40"]},
test/testeth -t GeneralStateTests/stCallCodes -- --testpath /home/ewasm/hugo-dc/cpp-ethereum/test/jsontests --singlenet "Byzantium" --singletest callcall_00_OOGE_valueTransfer --jsontrace ''
Running tests using path: "/home/ewasm/hugo-dc/cpp-ethereum/test/jsontests"
Running 1 test case...
Test Case "stCallCodes":
100%
[{"depth":"0","gas":"150744","gasCost":"3","memory":[],"op":"PUSH1","pc":"0","stack":[],"storage":{}},
{"depth":"0","gas":"150741","gasCost":"3","op":"CALLDATALOAD","pc":"2","stack":["0x00"]},
{"depth":"0","gas":"150738","gasCost":"3","op":"PUSH1","pc":"3","stack":["0x01f4"]},
{"depth":"0","gas":"150735","gasCost":"3","op":"MSTORE","pc":"5","stack":["0x01f4","0x00"]},
{"depth":"0","gas":"150729","gasCost":"3","memory":["00000000000000000000000000000000000000000000000000000000000001f4"],"op":"PUSH1","pc":"6","stack":[]},
Running tests using path: "/home/ewasm/hugo-dc/cpp-ethereum/test/jsontests"
Running 1 test case...
Test Case "stCallCodes":
100%
[{"depth":"0","gas":"29979000","gasCost":"3","memory":[],"op":"PUSH1","pc":"0","stack":[],"storage":{}},
{"depth":"0","gas":"29978997","gasCost":"3","op":"PUSH1","pc":"2","stack":["0x40"]},
{"depth":"0","gas":"29978994","gasCost":"3","op":"PUSH1","pc":"4","stack":["0x40","0x00"]},
{"depth":"0","gas":"29978991","gasCost":"3","op":"PUSH1","pc":"6","stack":["0x40","0x00","0x40"]},
{"depth":"0","gas":"29978988","gasCost":"3","op":"PUSH1","pc":"8","stack":["0x40","0x00","0x40","0x00"]},
{"depth":"0","gas":"29978985","gasCost":"3","op":"PUSHC","pc":"10","stack":["0x40","0x00","0x40","0x00","0x00"]},