Command-line tests for linking in Solidity mode

This commit is contained in:
Kamil Śliwak 2020-11-04 19:25:51 +01:00
parent 06ea7c66f7
commit a0d22422b0
12 changed files with 180 additions and 0 deletions

View File

@ -0,0 +1 @@
--bin --bin-runtime --libraries linking_solidity/input.sol:L:0x1234567890123456789012345678901234567890

View File

@ -0,0 +1,12 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
library L {
function f() external {}
}
contract C {
function foo() public {
L.f();
}
}

View File

@ -0,0 +1,12 @@
======= linking_solidity/input.sol:C =======
Binary:
<BYTECODE REMOVED>
Binary of the runtime part:
<BYTECODE REMOVED>
======= linking_solidity/input.sol:L =======
Binary:
<BYTECODE REMOVED>
Binary of the runtime part:
<BYTECODE REMOVED>

View File

@ -0,0 +1 @@
--bin --bin-runtime --libraries linking_solidity_unresolved_references/input.sol:L1:0x1234567890123456789012345678901234567890

View File

@ -0,0 +1,20 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
library L1 {
function f() external {}
}
library L2 {
function f() external {}
}
contract C {
function foo() public {
L1.f();
L2.f();
L1.f();
L2.f();
L1.f();
}
}

View File

@ -0,0 +1,24 @@
======= linking_solidity_unresolved_references/input.sol:C =======
Binary:
<BYTECODE REMOVED>__$8ef13d1c56d5343bf69cf9444272079aa5$__<BYTECODE REMOVED>__$8ef13d1c56d5343bf69cf9444272079aa5$__<BYTECODE REMOVED>
// $8ef13d1c56d5343bf69cf9444272079aa5$ -> linking_solidity_unresolved_references/input.sol:L2
// $8ef13d1c56d5343bf69cf9444272079aa5$ -> linking_solidity_unresolved_references/input.sol:L2
Binary of the runtime part:
<BYTECODE REMOVED>__$8ef13d1c56d5343bf69cf9444272079aa5$__<BYTECODE REMOVED>__$8ef13d1c56d5343bf69cf9444272079aa5$__<BYTECODE REMOVED>
// $8ef13d1c56d5343bf69cf9444272079aa5$ -> linking_solidity_unresolved_references/input.sol:L2
// $8ef13d1c56d5343bf69cf9444272079aa5$ -> linking_solidity_unresolved_references/input.sol:L2
======= linking_solidity_unresolved_references/input.sol:L1 =======
Binary:
<BYTECODE REMOVED>
Binary of the runtime part:
<BYTECODE REMOVED>
======= linking_solidity_unresolved_references/input.sol:L2 =======
Binary:
<BYTECODE REMOVED>
Binary of the runtime part:
<BYTECODE REMOVED>

View File

@ -0,0 +1,33 @@
{
"language": "Solidity",
"sources": {
"A": {
"content": "
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
library L {
function f() external {}
}
contract C {
function foo() public {
L.f();
}
}
"
}
},
"settings": {
"libraries": {
"contract/test.sol": {
"L": "0x1234567890123456789012345678901234567890"
}
},
"outputSelection": {
"*": {
"C": ["evm.bytecode.object", "evm.bytecode.linkReferences"]
}
}
}
}

View File

@ -0,0 +1 @@
{"contracts":{"A":{"C":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"sources":{"A":{"id":0}}}

View File

@ -0,0 +1,33 @@
{
"language": "Solidity",
"sources": {
"A": {
"content": "
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
library L {
function f() external {}
}
contract C {
function foo() public {
L.f();
}
}
"
}
},
"settings": {
"libraries": {
"contract/test\"test.sol": {
"L": "0x1234567890123456789012345678901234567890"
}
},
"outputSelection": {
"*": {
"C": ["evm.bytecode.object", "evm.bytecode.linkReferences"]
}
}
}
}

View File

@ -0,0 +1 @@
{"contracts":{"A":{"C":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"sources":{"A":{"id":0}}}

View File

@ -0,0 +1,41 @@
{
"language": "Solidity",
"sources": {
"A": {
"content": "
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
library L1 {
function f() external {}
}
library L2 {
function f() external {}
}
contract C {
function foo() public {
L1.f();
L2.f();
L1.f();
L2.f();
L1.f();
}
}
"
}
},
"settings": {
"libraries": {
"contract/test.sol": {
"L1": "0x1234567890123456789012345678901234567890"
}
},
"outputSelection": {
"*": {
"C": ["evm.bytecode.object", "evm.bytecode.linkReferences"]
}
}
}
}

View File

@ -0,0 +1 @@
{"contracts":{"A":{"C":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{"A":{"L2":[{"length":20,"start":184},{"length":20,"start":368}]}},"object":"<BYTECODE REMOVED>__$622b2f540b6a16ff5db7bea656ad8fcf4f$__<BYTECODE REMOVED>__$622b2f540b6a16ff5db7bea656ad8fcf4f$__<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"sources":{"A":{"id":0}}}