mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #14327 from ethereum/cmdline-tests-sanitize-metadata-in-standard-json-output
Sanitize metadata in Standard JSON output in command-line tests
This commit is contained in:
commit
c2e97369d9
@ -221,6 +221,7 @@ EOF
|
||||
# shellcheck disable=SC1003
|
||||
sed -i.bak -E -e 's/\\n/\'$'\n/g' "$stdout_path"
|
||||
sed -i.bak -e 's/\(^[ ]*auxdata:[[:space:]]\)0x[0-9a-f]*$/\1<AUXDATA REMOVED>/' "$stdout_path"
|
||||
sed -i.bak -e 's/\(\\"version\\":[ ]*\\"\)[^"\\]*\(\\"\)/\1<VERSION REMOVED>\2/' "$stdout_path"
|
||||
rm "$stdout_path.bak"
|
||||
else
|
||||
sed -i.bak -e '/^Warning: This is a pre-release compiler version, please do not use it in production./d' "$stderr_path"
|
||||
|
1
test/cmdlineTests/metadata/args
Normal file
1
test/cmdlineTests/metadata/args
Normal file
@ -0,0 +1 @@
|
||||
--metadata
|
4
test/cmdlineTests/metadata/input.sol
Normal file
4
test/cmdlineTests/metadata/input.sol
Normal file
@ -0,0 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity *;
|
||||
|
||||
contract C {}
|
4
test/cmdlineTests/metadata/output
Normal file
4
test/cmdlineTests/metadata/output
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
======= metadata/input.sol:C =======
|
||||
Metadata:
|
||||
{"compiler":{"version": "<VERSION REMOVED>"},"language":"Solidity","output":{"abi":[],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"metadata/input.sol":"C"},"evmVersion":"shanghai","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"metadata/input.sol":{"keccak256":"0x5cf617b1707a484e3c4bd59643013dec76ab7d75900b46855214729ae3e0ceb0","license":"GPL-3.0","urls":["bzz-raw://ac418a02dfadf87234150d3568f33269e3f49460345cb39300e017a6d755eff2","dweb:/ipfs/QmQq3owBu25x2WV46HB1WyKzJpxiAPecU7eMKqtXCF7eeS"]}},"version":1}
|
1
test/cmdlineTests/standard_metadata/args
Normal file
1
test/cmdlineTests/standard_metadata/args
Normal file
@ -0,0 +1 @@
|
||||
--allow-paths .
|
4
test/cmdlineTests/standard_metadata/in.sol
Normal file
4
test/cmdlineTests/standard_metadata/in.sol
Normal file
@ -0,0 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity *;
|
||||
|
||||
contract C {}
|
11
test/cmdlineTests/standard_metadata/input.json
Normal file
11
test/cmdlineTests/standard_metadata/input.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"C": {"urls": ["standard_metadata/in.sol"]}
|
||||
},
|
||||
"settings": {
|
||||
"outputSelection": {
|
||||
"*": {"*": ["metadata"]}
|
||||
}
|
||||
}
|
||||
}
|
19
test/cmdlineTests/standard_metadata/output.json
Normal file
19
test/cmdlineTests/standard_metadata/output.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"contracts":
|
||||
{
|
||||
"C":
|
||||
{
|
||||
"C":
|
||||
{
|
||||
"metadata": "{\"compiler\":{\"version\":\"<VERSION REMOVED>\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"C\":\"C\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"C\":{\"keccak256\":\"0x5cf617b1707a484e3c4bd59643013dec76ab7d75900b46855214729ae3e0ceb0\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://ac418a02dfadf87234150d3568f33269e3f49460345cb39300e017a6d755eff2\",\"dweb:/ipfs/QmQq3owBu25x2WV46HB1WyKzJpxiAPecU7eMKqtXCF7eeS\"]}},\"version\":1}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sources":
|
||||
{
|
||||
"C":
|
||||
{
|
||||
"id": 0
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user