Esempio n. 1
0
def test_namespace_collisions(solc5source):
    # contract collision
    with pytest.raises(NamespaceCollision):
        sources.Sources({"foo.sol": solc5source, "bar.sol": solc5source}, {})
    # interface collision
    with pytest.raises(NamespaceCollision):
        sources.Sources({}, {"foo.sol": solc5source, "bar.sol": solc5source})
    # solc / vyper collision
    with pytest.raises(NamespaceCollision):
        sources.Sources({"foo.sol": solc5source, "Foo.vy": "@external\ndef bar(): pass"}, {})
Esempio n. 2
0
def test_contract_interface_collisions(solc5source):
    # contract / interface collision
    sources.Sources({"foo.sol": solc5source}, {"bar.sol": solc5source})
    sources.Sources({"foo.sol": solc5source},
                    {"Foo.vy": "@external\ndef bar(): pass"})
Esempio n. 3
0
def sourceobj(solc5source):
    yield sources.Sources({"path/to/Foo.sol": solc5source},
                          {"interfaces/Baz.vy": "@external\ndef bar(): pass"})