Add SVM/CFG test

pull/22/head
Bernhard Mueller 7 years ago
parent 6dbf651adb
commit 96986960a5
  1. 1
      myth
  2. 10
      tests/disassembler_test.py
  3. 2
      tests/evm_test.py
  4. 1
      tests/ipc_test.py
  5. 2
      tests/rpc_test.py
  6. 15
      tests/svm_test.py
  7. 2
      tests/util_test.py

@ -162,6 +162,7 @@ elif (args.graph):
modules = []
for contract in contracts:
print(str(contract.as_dict()))
modules.append(contract.as_dict())
html = generate_callgraph(modules, args.enable_physics)

File diff suppressed because one or more lines are too long

@ -1,2 +0,0 @@
import unittest

@ -1 +0,0 @@
import unittest

@ -1,2 +0,0 @@
import unittest

@ -0,0 +1,15 @@
import unittest
from mythril.disassembler.callgraph import generate_callgraph
from mythril.disassembler.disassembly import Disassembly
class SVMTestCase(unittest.TestCase):
def runTest(self):
contract = {'name': 'coinCaller', 'address': '0x0000000000000000000000000000000000000000', 'creation_code': '', 'code': '606060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806390b98a1114610046575b600080fd5b341561005157600080fd5b610086600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610088565b005b60008073cd912af5286dc0b0a23edb30209734ecb60838b391508173ffffffffffffffffffffffffffffffffffffffff1663412664ae85856000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561014d57600080fd5b6102c65a03f1151561015e57600080fd5b505050604051805190509050505050505600a165627a7a723058207ee3ba7d05ac95dae526efd929324ab3185c3a50cb85e147e79bccc90db1eb360029'}
contract['disassembly'] = Disassembly(contract['code'])
html = generate_callgraph([contract], False)
self.assertTrue("var nodes = [\n{id: 0, size: 150" in html)

@ -1,2 +0,0 @@
import unittest
Loading…
Cancel
Save