From d8c21daf45074e6bc9c6696bc738d256388ce16d Mon Sep 17 00:00:00 2001 From: Alexander Remie Date: Thu, 1 Nov 2018 03:40:56 +0100 Subject: [PATCH] regenrate expected json for tests --- .../arbitrary_send.arbitrary-send.json | 24 +-- tests/expected_json/backdoor.backdoor.json | 10 +- tests/expected_json/backdoor.suicidal.json | 14 +- ...onst_state_variables.constable-states.json | 68 +++---- .../external_function.external-function.json | 56 +++--- .../inline_assembly_contract.assembly.json | 10 +- .../inline_assembly_library.assembly.json | 20 +-- .../locked_ether.locked-ether.json | 12 +- .../low_level_calls.low-level-calls.json | 10 +- .../naming_convention.naming-convention.json | 166 +++++++++--------- .../old_solc.sol.json.solc-version.json | 10 +- tests/expected_json/pragma.0.4.24.pragma.json | 18 +- .../expected_json/reentrancy.reentrancy.json | 24 +-- tests/expected_json/tx_origin.tx-origin.json | 20 +-- .../uninitialized.uninitialized-state.json | 88 +++++----- ...storage_pointer.uninitialized-storage.json | 22 +-- .../unused_state.unused-state.json | 14 +- 17 files changed, 293 insertions(+), 293 deletions(-) diff --git a/tests/expected_json/arbitrary_send.arbitrary-send.json b/tests/expected_json/arbitrary_send.arbitrary-send.json index abb73a3a3..fa6299fa1 100644 --- a/tests/expected_json/arbitrary_send.arbitrary-send.json +++ b/tests/expected_json/arbitrary_send.arbitrary-send.json @@ -2,25 +2,25 @@ { "calls": [ "msg.sender.send(this.balance)" - ], - "contract": "Test", - "filename": "tests/arbitrary_send.sol", - "func": "direct", + ], + "contract": "Test", + "filename": "tests/arbitrary_send.sol", + "func": "direct", "sourceMapping": [ null - ], + ], "vuln": "SuicidalFunc" - }, + }, { "calls": [ "destination.send(this.balance)" - ], - "contract": "Test", - "filename": "tests/arbitrary_send.sol", - "func": "indirect", + ], + "contract": "Test", + "filename": "tests/arbitrary_send.sol", + "func": "indirect", "sourceMapping": [ null - ], + ], "vuln": "SuicidalFunc" } -] +] \ No newline at end of file diff --git a/tests/expected_json/backdoor.backdoor.json b/tests/expected_json/backdoor.backdoor.json index 87ae303b3..5a68afb9b 100644 --- a/tests/expected_json/backdoor.backdoor.json +++ b/tests/expected_json/backdoor.backdoor.json @@ -1,11 +1,11 @@ [ { - "contract": "C", + "contract": "C", "sourceMapping": { - "filename": "tests/backdoor.sol", - "length": 74, + "filename": "tests/backdoor.sol", + "length": 74, "start": 42 - }, + }, "vuln": "backdoor" } -] +] \ No newline at end of file diff --git a/tests/expected_json/backdoor.suicidal.json b/tests/expected_json/backdoor.suicidal.json index e8dd6d8c8..16099e748 100644 --- a/tests/expected_json/backdoor.suicidal.json +++ b/tests/expected_json/backdoor.suicidal.json @@ -1,13 +1,13 @@ [ { - "contract": "C", - "filename": "tests/backdoor.sol", - "func": "i_am_a_backdoor", + "contract": "C", + "filename": "tests/backdoor.sol", + "func": "i_am_a_backdoor", "sourceMapping": { - "filename": "tests/backdoor.sol", - "length": 74, + "filename": "tests/backdoor.sol", + "length": 74, "start": 42 - }, + }, "vuln": "SuicidalFunc" } -] +] \ No newline at end of file diff --git a/tests/expected_json/const_state_variables.constable-states.json b/tests/expected_json/const_state_variables.constable-states.json index 2060fe3d7..3f8bd9552 100644 --- a/tests/expected_json/const_state_variables.constable-states.json +++ b/tests/expected_json/const_state_variables.constable-states.json @@ -1,64 +1,64 @@ [ { - "contract": "B", - "filename": "tests/const_state_variables.sol", + "contract": "B", + "filename": "tests/const_state_variables.sol", "sourceMapping": [ { - "filename": "tests/const_state_variables.sol", - "length": 76, + "filename": "tests/const_state_variables.sol", + "length": 76, "start": 130 - }, + }, { - "filename": "tests/const_state_variables.sol", - "length": 20, + "filename": "tests/const_state_variables.sol", + "length": 20, "start": 235 - }, + }, { - "filename": "tests/const_state_variables.sol", - "length": 20, + "filename": "tests/const_state_variables.sol", + "length": 20, "start": 331 - }, + }, { - "filename": "tests/const_state_variables.sol", - "length": 76, + "filename": "tests/const_state_variables.sol", + "length": 76, "start": 494 } - ], + ], "unusedVars": [ - "myFriendsAddress", - "test", + "myFriendsAddress", + "test", "text2" - ], + ], "vuln": "ConstStateVariableCandidates" - }, + }, { - "contract": "B", - "filename": "tests/const_state_variables.sol", + "contract": "B", + "filename": "tests/const_state_variables.sol", "sourceMapping": [ { - "filename": "tests/const_state_variables.sol", - "length": 76, + "filename": "tests/const_state_variables.sol", + "length": 76, "start": 130 - }, + }, { - "filename": "tests/const_state_variables.sol", - "length": 20, + "filename": "tests/const_state_variables.sol", + "length": 20, "start": 235 - }, + }, { - "filename": "tests/const_state_variables.sol", - "length": 20, + "filename": "tests/const_state_variables.sol", + "length": 20, "start": 331 - }, + }, { - "filename": "tests/const_state_variables.sol", - "length": 76, + "filename": "tests/const_state_variables.sol", + "length": 76, "start": 494 } - ], + ], "unusedVars": [ "mySistersAddress" - ], + ], "vuln": "ConstStateVariableCandidates" } -] +] \ No newline at end of file diff --git a/tests/expected_json/external_function.external-function.json b/tests/expected_json/external_function.external-function.json index d6cfdbed9..6e5023fcd 100644 --- a/tests/expected_json/external_function.external-function.json +++ b/tests/expected_json/external_function.external-function.json @@ -1,46 +1,46 @@ [ { - "contract": "ContractWithFunctionNotCalled", - "filename": "tests/external_function.sol", - "func": "funcNotCalled", + "contract": "ContractWithFunctionNotCalled", + "filename": "tests/external_function.sol", + "func": "funcNotCalled", "sourceMapping": { - "filename": "tests/external_function.sol", - "length": 40, + "filename": "tests/external_function.sol", + "length": 40, "start": 351 - }, + }, "vuln": "ExternalFunc" - }, + }, { - "contract": "ContractWithFunctionNotCalled", - "filename": "tests/external_function.sol", - "func": "funcNotCalled2", + "contract": "ContractWithFunctionNotCalled", + "filename": "tests/external_function.sol", + "func": "funcNotCalled2", "sourceMapping": { - "filename": "tests/external_function.sol", - "length": 41, + "filename": "tests/external_function.sol", + "length": 41, "start": 304 - }, + }, "vuln": "ExternalFunc" - }, + }, { - "contract": "ContractWithFunctionNotCalled", - "filename": "tests/external_function.sol", - "func": "funcNotCalled3", + "contract": "ContractWithFunctionNotCalled", + "filename": "tests/external_function.sol", + "func": "funcNotCalled3", "sourceMapping": { - "filename": "tests/external_function.sol", - "length": 41, + "filename": "tests/external_function.sol", + "length": 41, "start": 257 - }, + }, "vuln": "ExternalFunc" - }, + }, { - "contract": "ContractWithFunctionNotCalled2", - "filename": "tests/external_function.sol", - "func": "funcNotCalled", + "contract": "ContractWithFunctionNotCalled2", + "filename": "tests/external_function.sol", + "func": "funcNotCalled", "sourceMapping": { - "filename": "tests/external_function.sol", - "length": 304, + "filename": "tests/external_function.sol", + "length": 304, "start": 552 - }, + }, "vuln": "ExternalFunc" } -] +] \ No newline at end of file diff --git a/tests/expected_json/inline_assembly_contract.assembly.json b/tests/expected_json/inline_assembly_contract.assembly.json index 0d02458c6..f51ae2918 100644 --- a/tests/expected_json/inline_assembly_contract.assembly.json +++ b/tests/expected_json/inline_assembly_contract.assembly.json @@ -1,11 +1,11 @@ [ { - "contract": "GetCode", - "filename": "tests/inline_assembly_contract.sol", - "function_name": "at", + "contract": "GetCode", + "filename": "tests/inline_assembly_contract.sol", + "function_name": "at", "sourceMapping": [ null - ], + ], "vuln": "Assembly" } -] +] \ No newline at end of file diff --git a/tests/expected_json/inline_assembly_library.assembly.json b/tests/expected_json/inline_assembly_library.assembly.json index 5c62a4e1d..0e7bc1df8 100644 --- a/tests/expected_json/inline_assembly_library.assembly.json +++ b/tests/expected_json/inline_assembly_library.assembly.json @@ -1,20 +1,20 @@ [ { - "contract": "VectorSum", - "filename": "tests/inline_assembly_library.sol", - "function_name": "sumAsm", + "contract": "VectorSum", + "filename": "tests/inline_assembly_library.sol", + "function_name": "sumAsm", "sourceMapping": [ null - ], + ], "vuln": "Assembly" - }, + }, { - "contract": "VectorSum", - "filename": "tests/inline_assembly_library.sol", - "function_name": "sumPureAsm", + "contract": "VectorSum", + "filename": "tests/inline_assembly_library.sol", + "function_name": "sumPureAsm", "sourceMapping": [ null - ], + ], "vuln": "Assembly" } -] +] \ No newline at end of file diff --git a/tests/expected_json/locked_ether.locked-ether.json b/tests/expected_json/locked_ether.locked-ether.json index bdab33b8f..50b0dbbf4 100644 --- a/tests/expected_json/locked_ether.locked-ether.json +++ b/tests/expected_json/locked_ether.locked-ether.json @@ -1,16 +1,16 @@ [ { - "contract": "OnlyLocked", + "contract": "OnlyLocked", "functions_payable": [ "receive" - ], + ], "sourceMapping": [ { - "filename": "tests/locked_ether.sol", - "length": 72, + "filename": "tests/locked_ether.sol", + "length": 72, "start": 46 } - ], + ], "vuln": "LockedEther" } -] +] \ No newline at end of file diff --git a/tests/expected_json/low_level_calls.low-level-calls.json b/tests/expected_json/low_level_calls.low-level-calls.json index e3b7ce1e2..460535875 100644 --- a/tests/expected_json/low_level_calls.low-level-calls.json +++ b/tests/expected_json/low_level_calls.low-level-calls.json @@ -1,11 +1,11 @@ [ { - "contract": "Sender", - "filename": "tests/low_level_calls.sol", - "function_name": "send", + "contract": "Sender", + "filename": "tests/low_level_calls.sol", + "function_name": "send", "sourceMapping": [ null - ], + ], "vuln": "Low level call" } -] +] \ No newline at end of file diff --git a/tests/expected_json/naming_convention.naming-convention.json b/tests/expected_json/naming_convention.naming-convention.json index f7cb8026c..52e34ddc8 100644 --- a/tests/expected_json/naming_convention.naming-convention.json +++ b/tests/expected_json/naming_convention.naming-convention.json @@ -1,131 +1,131 @@ [ { - "argument": "_used", - "contract": "T", - "filename": "tests/naming_convention.sol", - "function": "test", + "argument": "_used", + "contract": "T", + "filename": "tests/naming_convention.sol", + "function": "test", "sourceMapping": { - "filename": "tests/naming_convention.sol", - "length": 10, + "filename": "tests/naming_convention.sol", + "length": 10, "start": 748 - }, + }, "vuln": "NamingConvention" - }, + }, { - "contract": "T", - "filename": "tests/naming_convention.sol", + "contract": "T", + "filename": "tests/naming_convention.sol", "sourceMapping": { - "filename": "tests/naming_convention.sol", - "length": 17, + "filename": "tests/naming_convention.sol", + "length": 17, "start": 695 - }, - "variable": "_myPublicVar", + }, + "variable": "_myPublicVar", "vuln": "NamingConvention" - }, + }, { - "constant": "l", - "contract": "T", - "filename": "tests/naming_convention.sol", + "constant": "l", + "contract": "T", + "filename": "tests/naming_convention.sol", "sourceMapping": { - "filename": "tests/naming_convention.sol", - "length": 10, + "filename": "tests/naming_convention.sol", + "length": 10, "start": 847 - }, + }, "vuln": "NamingConvention" - }, + }, { - "contract": "naming", - "filename": "tests/naming_convention.sol", + "contract": "naming", + "filename": "tests/naming_convention.sol", "sourceMapping": { - "filename": "tests/naming_convention.sol", - "length": 598, + "filename": "tests/naming_convention.sol", + "length": 598, "start": 26 - }, + }, "vuln": "NamingConvention" - }, + }, { - "contract": "naming", - "filename": "tests/naming_convention.sol", + "contract": "naming", + "filename": "tests/naming_convention.sol", "sourceMapping": { - "filename": "tests/naming_convention.sol", - "length": 20, + "filename": "tests/naming_convention.sol", + "length": 20, "start": 227 - }, - "struct": "test", + }, + "struct": "test", "vuln": "NamingConvention" - }, + }, { - "contract": "naming", - "event": "event_", - "filename": "tests/naming_convention.sol", - "sourceMapping": null, + "contract": "naming", + "event": "event_", + "filename": "tests/naming_convention.sol", + "sourceMapping": null, "vuln": "NamingConvention" - }, + }, { - "contract": "naming", - "filename": "tests/naming_convention.sol", - "function": "GetOne", + "contract": "naming", + "filename": "tests/naming_convention.sol", + "function": "GetOne", "sourceMapping": { - "filename": "tests/naming_convention.sol", - "length": 71, + "filename": "tests/naming_convention.sol", + "length": 71, "start": 405 - }, + }, "vuln": "NamingConvention" - }, + }, { - "argument": "Number2", - "contract": "naming", - "filename": "tests/naming_convention.sol", - "function": "setInt", + "argument": "Number2", + "contract": "naming", + "filename": "tests/naming_convention.sol", + "function": "setInt", "sourceMapping": { - "filename": "tests/naming_convention.sol", - "length": 12, + "filename": "tests/naming_convention.sol", + "length": 12, "start": 512 - }, + }, "vuln": "NamingConvention" - }, + }, { - "constant": "MY_other_CONSTANT", - "contract": "naming", - "filename": "tests/naming_convention.sol", + "constant": "MY_other_CONSTANT", + "contract": "naming", + "filename": "tests/naming_convention.sol", "sourceMapping": { - "filename": "tests/naming_convention.sol", - "length": 35, + "filename": "tests/naming_convention.sol", + "length": 35, "start": 141 - }, + }, "vuln": "NamingConvention" - }, + }, { - "contract": "naming", - "filename": "tests/naming_convention.sol", + "contract": "naming", + "filename": "tests/naming_convention.sol", "sourceMapping": { - "filename": "tests/naming_convention.sol", - "length": 16, + "filename": "tests/naming_convention.sol", + "length": 16, "start": 183 - }, - "variable": "Var_One", + }, + "variable": "Var_One", "vuln": "NamingConvention" - }, + }, { - "contract": "naming", - "enum": "numbers", - "filename": "tests/naming_convention.sol", + "contract": "naming", + "enum": "numbers", + "filename": "tests/naming_convention.sol", "sourceMapping": { - "filename": "tests/naming_convention.sol", - "length": 23, + "filename": "tests/naming_convention.sol", + "length": 23, "start": 77 - }, + }, "vuln": "NamingConvention" - }, + }, { - "contract": "naming", - "filename": "tests/naming_convention.sol", - "modifier": "CantDo", + "contract": "naming", + "filename": "tests/naming_convention.sol", + "modifier": "CantDo", "sourceMapping": { - "filename": "tests/naming_convention.sol", - "length": 36, + "filename": "tests/naming_convention.sol", + "length": 36, "start": 545 - }, + }, "vuln": "NamingConvention" } -] +] \ No newline at end of file diff --git a/tests/expected_json/old_solc.sol.json.solc-version.json b/tests/expected_json/old_solc.sol.json.solc-version.json index 4d950e0c4..44e536156 100644 --- a/tests/expected_json/old_solc.sol.json.solc-version.json +++ b/tests/expected_json/old_solc.sol.json.solc-version.json @@ -2,14 +2,14 @@ { "pragma": [ "0.4.21" - ], + ], "sourceMapping": [ { - "filename": "old_solc.sol", - "length": 23, + "filename": "old_solc.sol", + "length": 23, "start": 0 } - ], + ], "vuln": "OldPragma" } -] +] \ No newline at end of file diff --git a/tests/expected_json/pragma.0.4.24.pragma.json b/tests/expected_json/pragma.0.4.24.pragma.json index 74922475c..e70a6253c 100644 --- a/tests/expected_json/pragma.0.4.24.pragma.json +++ b/tests/expected_json/pragma.0.4.24.pragma.json @@ -2,20 +2,20 @@ { "sourceMapping": [ { - "filename": "tests/pragma.0.4.23.sol", - "length": 24, + "filename": "tests/pragma.0.4.23.sol", + "length": 24, "start": 0 - }, + }, { - "filename": "tests/pragma.0.4.24.sol", - "length": 23, + "filename": "tests/pragma.0.4.24.sol", + "length": 23, "start": 0 } - ], + ], "versions": [ - "0.4.24", + "0.4.24", "^0.4.23" - ], + ], "vuln": "ConstantPragma" } -] +] \ No newline at end of file diff --git a/tests/expected_json/reentrancy.reentrancy.json b/tests/expected_json/reentrancy.reentrancy.json index e5c1b4597..aefa64c1a 100644 --- a/tests/expected_json/reentrancy.reentrancy.json +++ b/tests/expected_json/reentrancy.reentrancy.json @@ -2,25 +2,25 @@ { "calls": [ "! (msg.sender.call.value(userBalance[msg.sender])())" - ], - "contract": "Reentrancy", - "filename": "tests/reentrancy.sol", - "function_name": "withdrawBalance()", + ], + "contract": "Reentrancy", + "filename": "tests/reentrancy.sol", + "function_name": "withdrawBalance()", "send_eth": [ "! (msg.sender.call.value(userBalance[msg.sender])())" - ], + ], "sourceMapping": [ { - "filename": "tests/reentrancy.sol", - "length": 37, + "filename": "tests/reentrancy.sol", + "length": 37, "start": 52 - }, - null, + }, + null, null - ], + ], "varsWritten": [ "userBalance" - ], + ], "vuln": "Reentrancy" } -] +] \ No newline at end of file diff --git a/tests/expected_json/tx_origin.tx-origin.json b/tests/expected_json/tx_origin.tx-origin.json index 0be0cdad4..53b387f22 100644 --- a/tests/expected_json/tx_origin.tx-origin.json +++ b/tests/expected_json/tx_origin.tx-origin.json @@ -1,20 +1,20 @@ [ { - "contract": "TxOrigin", - "filename": "tests/tx_origin.sol", - "function_name": "bug0", + "contract": "TxOrigin", + "filename": "tests/tx_origin.sol", + "function_name": "bug0", "sourceMapping": [ null - ], + ], "vuln": "TxOrigin" - }, + }, { - "contract": "TxOrigin", - "filename": "tests/tx_origin.sol", - "function_name": "bug2", + "contract": "TxOrigin", + "filename": "tests/tx_origin.sol", + "function_name": "bug2", "sourceMapping": [ null - ], + ], "vuln": "TxOrigin" } -] +] \ No newline at end of file diff --git a/tests/expected_json/uninitialized.uninitialized-state.json b/tests/expected_json/uninitialized.uninitialized-state.json index 9981962dc..fd0f88386 100644 --- a/tests/expected_json/uninitialized.uninitialized-state.json +++ b/tests/expected_json/uninitialized.uninitialized-state.json @@ -1,86 +1,86 @@ [ { - "contract": "Test", - "filename": "tests/uninitialized.sol", + "contract": "Test", + "filename": "tests/uninitialized.sol", "functions": [ "use" - ], + ], "sourceMapping": [ { - "filename": "tests/uninitialized.sol", - "length": 34, + "filename": "tests/uninitialized.sol", + "length": 34, "start": 189 - }, + }, { - "filename": "tests/uninitialized.sol", - "length": 143, + "filename": "tests/uninitialized.sol", + "length": 143, "start": 356 } - ], - "variable": "balances", + ], + "variable": "balances", "vuln": "UninitializedStateVars" - }, + }, { - "contract": "Test2", - "filename": "tests/uninitialized.sol", + "contract": "Test2", + "filename": "tests/uninitialized.sol", "functions": [ "use" - ], + ], "sourceMapping": [ { - "filename": "tests/uninitialized.sol", - "length": 15, + "filename": "tests/uninitialized.sol", + "length": 15, "start": 695 - }, + }, { - "filename": "tests/uninitialized.sol", - "length": 117, + "filename": "tests/uninitialized.sol", + "length": 117, "start": 875 } - ], - "variable": "st", + ], + "variable": "st", "vuln": "UninitializedStateVars" - }, + }, { - "contract": "Test2", - "filename": "tests/uninitialized.sol", + "contract": "Test2", + "filename": "tests/uninitialized.sol", "functions": [ "init" - ], + ], "sourceMapping": [ { - "filename": "tests/uninitialized.sol", - "length": 6, + "filename": "tests/uninitialized.sol", + "length": 6, "start": 748 - }, + }, { - "filename": "tests/uninitialized.sol", - "length": 52, + "filename": "tests/uninitialized.sol", + "length": 52, "start": 817 } - ], - "variable": "v", + ], + "variable": "v", "vuln": "UninitializedStateVars" - }, + }, { - "contract": "Uninitialized", - "filename": "tests/uninitialized.sol", + "contract": "Uninitialized", + "filename": "tests/uninitialized.sol", "functions": [ "transfer" - ], + ], "sourceMapping": [ { - "filename": "tests/uninitialized.sol", - "length": 19, + "filename": "tests/uninitialized.sol", + "length": 19, "start": 55 - }, + }, { - "filename": "tests/uninitialized.sol", - "length": 82, + "filename": "tests/uninitialized.sol", + "length": 82, "start": 81 } - ], - "variable": "destination", + ], + "variable": "destination", "vuln": "UninitializedStateVars" } -] +] \ No newline at end of file diff --git a/tests/expected_json/uninitialized_storage_pointer.uninitialized-storage.json b/tests/expected_json/uninitialized_storage_pointer.uninitialized-storage.json index 50fd5c7f8..442c2bcdf 100644 --- a/tests/expected_json/uninitialized_storage_pointer.uninitialized-storage.json +++ b/tests/expected_json/uninitialized_storage_pointer.uninitialized-storage.json @@ -1,21 +1,21 @@ [ { - "contract": "Uninitialized", - "filename": "tests/uninitialized_storage_pointer.sol", - "function": "func", + "contract": "Uninitialized", + "filename": "tests/uninitialized_storage_pointer.sol", + "function": "func", "sourceMapping": [ { - "filename": "tests/uninitialized_storage_pointer.sol", - "length": 138, + "filename": "tests/uninitialized_storage_pointer.sol", + "length": 138, "start": 67 - }, + }, { - "filename": "tests/uninitialized_storage_pointer.sol", - "length": 9, + "filename": "tests/uninitialized_storage_pointer.sol", + "length": 9, "start": 171 } - ], - "variable": "st_bug", + ], + "variable": "st_bug", "vuln": "UninitializedStorageVars" } -] +] \ No newline at end of file diff --git a/tests/expected_json/unused_state.unused-state.json b/tests/expected_json/unused_state.unused-state.json index ab82de585..0b2854aef 100644 --- a/tests/expected_json/unused_state.unused-state.json +++ b/tests/expected_json/unused_state.unused-state.json @@ -1,17 +1,17 @@ [ { - "contract": "B", - "filename": "tests/unused_state.sol", + "contract": "B", + "filename": "tests/unused_state.sol", "sourceMapping": [ { - "filename": "tests/unused_state.sol", - "length": 14, + "filename": "tests/unused_state.sol", + "length": 14, "start": 41 } - ], + ], "unusedVars": [ "unused" - ], + ], "vuln": "unusedStateVars" } -] +] \ No newline at end of file