mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6757 from ethereum/cmdlineMetadata
Fix cmdline tests that depended on metadata.
This commit is contained in:
commit
38f7cfa0c4
@ -1 +0,0 @@
|
||||
0
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
"A":
|
||||
{
|
||||
"content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
|
||||
}
|
||||
},
|
||||
"settings":
|
||||
{
|
||||
"outputSelection":
|
||||
{
|
||||
"*": { "C": ["evm.bytecode"] }
|
||||
}
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
{"contracts":{"A":{"C":{"evm":{"bytecode":{"linkReferences":{},"object":"6080604052348015600f57600080fd5b50606c80601d6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c806326121ff014602d575b600080fd5b60336035565b005b56fea265627a7a72305820d91fc5bc5e7a1e5b5ed106c35b94a7365c1b7d06c37ca82d76122a098ba5e7c464736f6c63430005090032","opcodes":"PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x6C DUP1 PUSH1 0x1D PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x28 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x26121FF0 EQ PUSH1 0x2D JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x33 PUSH1 0x35 JUMP JUMPDEST STOP JUMPDEST JUMP INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 0xd9 0x1f 0xc5 0xbc 0x5e PUSH27 0x1E5B5ED106C35B94A7365C1B7D06C37CA82D76122A098BA5E7C464 PUSH20 0x6F6C634300050900320000000000000000000000 ","sourceMap":"23:42:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;23:42:0;;;;;;;"}}}}},"sources":{"A":{"id":0}}}
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
":A":
|
||||
{
|
||||
"content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
|
||||
}
|
||||
},
|
||||
"settings":
|
||||
{
|
||||
"outputSelection":
|
||||
{
|
||||
"*": { "C": ["evm.bytecode"] }
|
||||
}
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
{"contracts":{":A":{"C":{"evm":{"bytecode":{"linkReferences":{},"object":"6080604052348015600f57600080fd5b50606c80601d6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c806326121ff014602d575b600080fd5b60336035565b005b56fea265627a7a7230582053216482bf0a55d1517bd2a4924c65599adfd05b9dbf4161ce466fcaa338475464736f6c63430005090032","opcodes":"PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x6C DUP1 PUSH1 0x1D PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x28 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x26121FF0 EQ PUSH1 0x2D JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x33 PUSH1 0x35 JUMP JUMPDEST STOP JUMPDEST JUMP INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 MSTORE8 0x21 PUSH5 0x82BF0A55D1 MLOAD PUSH28 0xD2A4924C65599ADFD05B9DBF4161CE466FCAA338475464736F6C6343 STOP SDIV MULMOD STOP ORIGIN ","sourceMap":"23:42:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;23:42:0;;;;;;;"}}}}},"sources":{":A":{"id":0}}}
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
"":
|
||||
{
|
||||
"content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
|
||||
}
|
||||
},
|
||||
"settings":
|
||||
{
|
||||
"outputSelection":
|
||||
{
|
||||
"*": { "C": ["evm.bytecode"] }
|
||||
}
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
{"contracts":{"":{"C":{"evm":{"bytecode":{"linkReferences":{},"object":"6080604052348015600f57600080fd5b50606c80601d6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c806326121ff014602d575b600080fd5b60336035565b005b56fea265627a7a72305820260cf0d26c996ff6e1c49738e3707ac04282a21819d90818c5558633aa88972064736f6c63430005090032","opcodes":"PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x6C DUP1 PUSH1 0x1D PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x28 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x26121FF0 EQ PUSH1 0x2D JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x33 PUSH1 0x35 JUMP JUMPDEST STOP JUMPDEST JUMP INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 0x26 0xc CREATE 0xd2 PUSH13 0x996FF6E1C49738E3707AC04282 LOG2 XOR NOT 0xd9 ADDMOD XOR 0xc5 SSTORE DUP7 CALLER 0xaa DUP9 SWAP8 KECCAK256 PUSH5 0x736F6C6343 STOP SDIV MULMOD STOP ORIGIN ","sourceMap":"23:42:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;23:42:0;;;;;;;"}}}}},"sources":{"":{"id":0}}}
|
@ -1 +0,0 @@
|
||||
0
|
@ -1,21 +0,0 @@
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
"A":
|
||||
{
|
||||
"content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
|
||||
},
|
||||
"B":
|
||||
{
|
||||
"content": "pragma solidity >=0.0; contract D { function f() public pure {} }"
|
||||
}
|
||||
},
|
||||
"settings":
|
||||
{
|
||||
"outputSelection":
|
||||
{
|
||||
"*": { "D": ["evm.bytecode"] }
|
||||
}
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
{"contracts":{"B":{"D":{"evm":{"bytecode":{"linkReferences":{},"object":"6080604052348015600f57600080fd5b50606c80601d6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c806326121ff014602d575b600080fd5b60336035565b005b56fea265627a7a72305820e1e8556e26c10b39d7440ebbc7a2651c598aa0c54c5482c0850473b0db2f919264736f6c63430005090032","opcodes":"PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x6C DUP1 PUSH1 0x1D PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH1 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH1 0x28 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x26121FF0 EQ PUSH1 0x2D JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x33 PUSH1 0x35 JUMP JUMPDEST STOP JUMPDEST JUMP INVALID LOG2 PUSH6 0x627A7A723058 KECCAK256 0xe1 0xe8 SSTORE PUSH15 0x26C10B39D7440EBBC7A2651C598AA0 0xc5 0x4c SLOAD DUP3 0xc0 DUP6 DIV PUSH20 0xB0DB2F919264736F6C6343000509003200000000 ","sourceMap":"23:42:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;23:42:1;;;;;;;"}}}}},"sources":{"A":{"id":0},"B":{"id":1}}}
|
@ -1166,6 +1166,172 @@ BOOST_AUTO_TEST_CASE(use_stack_optimization)
|
||||
BOOST_CHECK(result["errors"][0]["type"] == "InternalCompilerError");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(standard_output_selection_wildcard)
|
||||
{
|
||||
char const* input = R"(
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
"A":
|
||||
{
|
||||
"content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
|
||||
}
|
||||
},
|
||||
"settings":
|
||||
{
|
||||
"outputSelection":
|
||||
{
|
||||
"*": { "C": ["evm.bytecode"] }
|
||||
}
|
||||
}
|
||||
}
|
||||
)";
|
||||
|
||||
Json::Value parsedInput;
|
||||
BOOST_REQUIRE(jsonParseStrict(input, parsedInput));
|
||||
|
||||
dev::solidity::StandardCompiler compiler;
|
||||
Json::Value result = compiler.compile(parsedInput);
|
||||
|
||||
BOOST_REQUIRE(result["contracts"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"].size() == 1);
|
||||
BOOST_REQUIRE(result["contracts"]["A"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"]["A"].size() == 1);
|
||||
BOOST_REQUIRE(result["contracts"]["A"]["C"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"]["A"]["C"]["evm"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"]["A"]["C"]["evm"]["bytecode"].isObject());
|
||||
BOOST_REQUIRE(result["sources"].isObject());
|
||||
BOOST_REQUIRE(result["sources"].size() == 1);
|
||||
BOOST_REQUIRE(result["sources"]["A"].isObject());
|
||||
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(standard_output_selection_wildcard_colon_source)
|
||||
{
|
||||
char const* input = R"(
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
":A":
|
||||
{
|
||||
"content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
|
||||
}
|
||||
},
|
||||
"settings":
|
||||
{
|
||||
"outputSelection":
|
||||
{
|
||||
"*": { "C": ["evm.bytecode"] }
|
||||
}
|
||||
}
|
||||
}
|
||||
)";
|
||||
|
||||
Json::Value parsedInput;
|
||||
BOOST_REQUIRE(jsonParseStrict(input, parsedInput));
|
||||
|
||||
dev::solidity::StandardCompiler compiler;
|
||||
Json::Value result = compiler.compile(parsedInput);
|
||||
|
||||
BOOST_REQUIRE(result["contracts"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"].size() == 1);
|
||||
BOOST_REQUIRE(result["contracts"][":A"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"][":A"].size() == 1);
|
||||
BOOST_REQUIRE(result["contracts"][":A"]["C"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"][":A"]["C"]["evm"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"][":A"]["C"]["evm"]["bytecode"].isObject());
|
||||
BOOST_REQUIRE(result["sources"].isObject());
|
||||
BOOST_REQUIRE(result["sources"].size() == 1);
|
||||
BOOST_REQUIRE(result["sources"][":A"].isObject());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(standard_output_selection_wildcard_empty_source)
|
||||
{
|
||||
char const* input = R"(
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
"":
|
||||
{
|
||||
"content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
|
||||
}
|
||||
},
|
||||
"settings":
|
||||
{
|
||||
"outputSelection":
|
||||
{
|
||||
"*": { "C": ["evm.bytecode"] }
|
||||
}
|
||||
}
|
||||
}
|
||||
)";
|
||||
|
||||
Json::Value parsedInput;
|
||||
BOOST_REQUIRE(jsonParseStrict(input, parsedInput));
|
||||
|
||||
dev::solidity::StandardCompiler compiler;
|
||||
Json::Value result = compiler.compile(parsedInput);
|
||||
|
||||
BOOST_REQUIRE(result["contracts"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"].size() == 1);
|
||||
BOOST_REQUIRE(result["contracts"][""].isObject());
|
||||
BOOST_REQUIRE(result["contracts"][""].size() == 1);
|
||||
BOOST_REQUIRE(result["contracts"][""]["C"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"][""]["C"]["evm"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"][""]["C"]["evm"]["bytecode"].isObject());
|
||||
BOOST_REQUIRE(result["sources"].isObject());
|
||||
BOOST_REQUIRE(result["sources"].size() == 1);
|
||||
BOOST_REQUIRE(result["sources"][""].isObject());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(standard_output_selection_wildcard_multiple_sources)
|
||||
{
|
||||
char const* input = R"(
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
"A":
|
||||
{
|
||||
"content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
|
||||
},
|
||||
"B":
|
||||
{
|
||||
"content": "pragma solidity >=0.0; contract D { function f() public pure {} }"
|
||||
}
|
||||
},
|
||||
"settings":
|
||||
{
|
||||
"outputSelection":
|
||||
{
|
||||
"*": { "D": ["evm.bytecode"] }
|
||||
}
|
||||
}
|
||||
}
|
||||
)";
|
||||
|
||||
Json::Value parsedInput;
|
||||
BOOST_REQUIRE(jsonParseStrict(input, parsedInput));
|
||||
|
||||
dev::solidity::StandardCompiler compiler;
|
||||
Json::Value result = compiler.compile(parsedInput);
|
||||
|
||||
BOOST_REQUIRE(result["contracts"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"].size() == 1);
|
||||
BOOST_REQUIRE(result["contracts"]["B"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"]["B"].size() == 1);
|
||||
BOOST_REQUIRE(result["contracts"]["B"]["D"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"]["B"]["D"]["evm"].isObject());
|
||||
BOOST_REQUIRE(result["contracts"]["B"]["D"]["evm"]["bytecode"].isObject());
|
||||
BOOST_REQUIRE(result["sources"].isObject());
|
||||
BOOST_REQUIRE(result["sources"].size() == 2);
|
||||
BOOST_REQUIRE(result["sources"]["A"].isObject());
|
||||
BOOST_REQUIRE(result["sources"]["B"].isObject());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user