예제 #1
0
def test_builder_with_pinner(owned_package, dummy_ipfs_backend):
    root, expected_manifest, compiler_output = owned_package
    ipfs_backend = get_ipfs_backend()
    pinner = source_pinner(compiler_output, ipfs_backend, root)
    manifest = build(
        {},
        package_name("owned"),
        manifest_version("2"),
        version("1.0.0"),
        authors("Piper Merriam <*****@*****.**>"),
        description(
            "Reusable contracts which implement a privileged 'owner' model for authorization."
        ),
        keywords("authorization"),
        license("MIT"),
        links(documentation=
              "ipfs://QmUYcVzTfSwJoigggMxeo2g5STWAgJdisQsqcXHws7b1FW"),
        pinner("Owned"),
        validate(),
    )

    assert manifest == expected_manifest
예제 #2
0
def test_builder_with_link_references(registry_package, dummy_ipfs_backend,
                                      monkeypatch):
    root, expected_manifest, compiler_output = registry_package
    ipfs_backend = get_ipfs_backend()
    monkeypatch.chdir(root)
    pinner = source_pinner(compiler_output, ipfs_backend)
    inliner = source_inliner(compiler_output)
    manifest = build(
        {},
        package_name("solidity-registry"),
        manifest_version("2"),
        version("2.0.0"),
        inliner("Authorized"),
        inliner("IndexedOrderedSetLib"),
        inliner("PackageDB"),
        inliner("PackageRegistry"),
        inliner("PackageRegistryInterface"),
        inliner("ReleaseDB"),
        inliner("ReleaseValidator"),
        contract_type(
            "AuthorityInterface",
            compiler_output,
            abi=True,
            deployment_bytecode=True,
            runtime_bytecode=True,
            natspec=True,
        ),
        contract_type(
            "Authorized",
            compiler_output,
            abi=True,
            deployment_bytecode=True,
            runtime_bytecode=True,
            natspec=True,
            compiler=True,
        ),
        contract_type(
            "AuthorizedInterface",
            compiler_output,
            abi=True,
            deployment_bytecode=True,
            runtime_bytecode=True,
            natspec=True,
        ),
        contract_type(
            "WhitelistAuthority",
            compiler_output,
            abi=True,
            deployment_bytecode=True,
            runtime_bytecode=True,
            natspec=True,
            compiler=True,
        ),
        contract_type(
            "WhitelistAuthorityInterface",
            compiler_output,
            abi=True,
            deployment_bytecode=True,
            runtime_bytecode=True,
            natspec=True,
        ),
        contract_type(
            "IndexedOrderedSetLib",
            compiler_output,
            abi=True,
            deployment_bytecode=True,
            runtime_bytecode=True,
            natspec=True,
            compiler=True,
        ),
        contract_type(
            "PackageDB",
            compiler_output,
            abi=True,
            deployment_bytecode=True,
            runtime_bytecode=True,
            natspec=True,
            compiler=True,
        ),
        contract_type(
            "PackageRegistry",
            compiler_output,
            abi=True,
            deployment_bytecode=True,
            runtime_bytecode=True,
            natspec=True,
            compiler=True,
        ),
        contract_type(
            "PackageRegistryInterface",
            compiler_output,
            abi=True,
            deployment_bytecode=True,
            runtime_bytecode=True,
            natspec=True,
        ),
        contract_type(
            "ReleaseDB",
            compiler_output,
            abi=True,
            deployment_bytecode=True,
            runtime_bytecode=True,
            natspec=True,
            compiler=True,
        ),
        contract_type(
            "ReleaseValidator",
            compiler_output,
            abi=True,
            deployment_bytecode=True,
            runtime_bytecode=True,
            natspec=True,
            compiler=True,
        ),
        validate(),
    )
    assert manifest == expected_manifest