|
|
@ -9,16 +9,11 @@ def output_of(command): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CommandLineToolTestCase(BaseTestCase): |
|
|
|
class CommandLineToolTestCase(BaseTestCase): |
|
|
|
def install_solc_test_version(self): |
|
|
|
|
|
|
|
# This initializes the solc v0.4.24 |
|
|
|
|
|
|
|
command = "python3 {} MYTH -d --solv 0.4.24".format(MYTH) |
|
|
|
|
|
|
|
output_of(command) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_disassemble_code_correctly(self): |
|
|
|
def test_disassemble_code_correctly(self): |
|
|
|
command = "python3 {} MYTH -d --bin-runtime -c 0x5050 --solv 0.4.24".format( |
|
|
|
command = "python3 {} MYTH -d --bin-runtime -c 0x5050 --solv 0.4.24".format( |
|
|
|
MYTH |
|
|
|
MYTH |
|
|
|
) |
|
|
|
) |
|
|
|
self.assertEqual("0 POP\n1 POP\n", output_of(command)) |
|
|
|
self.assertIn("0 POP\n1 POP\n", output_of(command)) |
|
|
|
|
|
|
|
|
|
|
|
def test_disassemble_solidity_file_correctly(self): |
|
|
|
def test_disassemble_solidity_file_correctly(self): |
|
|
|
solidity_file = str(TESTDATA / "input_contracts" / "metacoin.sol") |
|
|
|
solidity_file = str(TESTDATA / "input_contracts" / "metacoin.sol") |
|
|
@ -27,7 +22,7 @@ class CommandLineToolTestCase(BaseTestCase): |
|
|
|
|
|
|
|
|
|
|
|
def test_hash_a_function_correctly(self): |
|
|
|
def test_hash_a_function_correctly(self): |
|
|
|
command = "python3 {} --solv 0.4.24 --hash 'setOwner(address)'".format(MYTH) |
|
|
|
command = "python3 {} --solv 0.4.24 --hash 'setOwner(address)'".format(MYTH) |
|
|
|
self.assertEqual("0x13af4035\n", output_of(command)) |
|
|
|
self.assertIn("0x13af4035\n", output_of(command)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TruffleTestCase(BaseTestCase): |
|
|
|
class TruffleTestCase(BaseTestCase): |
|
|
|