Skip to content

Commit

Permalink
Merge pull request #1652 from njgheorghita/ethpm-v3
Browse files Browse the repository at this point in the history
Ethpm v3
  • Loading branch information
njgheorghita authored Jul 7, 2020
2 parents 9d2374b + f276ff5 commit b680d52
Show file tree
Hide file tree
Showing 93 changed files with 744 additions and 1,728 deletions.
10 changes: 8 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ common: &common
- restore_cache:
keys:
- cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
- run:
name: checkout ethpm-spec submodule
command: git submodule update --init --recursive
- run:
name: install dependencies
command: pip install --user tox
Expand Down Expand Up @@ -116,14 +119,17 @@ ethpm_steps: &ethpm_steps
- run:
name: install ipfs
command:
wget https://dist.ipfs.io/go-ipfs/v0.4.19/go-ipfs_v0.4.19_linux-amd64.tar.gz &&
tar xvfz go-ipfs_v0.4.19_linux-amd64.tar.gz &&
wget https://dist.ipfs.io/go-ipfs/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz &&
tar xvfz go-ipfs_v0.4.22_linux-amd64.tar.gz &&
sudo cp go-ipfs/ipfs /usr/local/bin &&
ipfs init
- run:
name: start ipfs node in background
command: ipfs daemon
background: true
- run:
name: checkout ethpm-spec submodule
command: git submodule update --init --recursive
- run:
name: install dependencies
command: pip install --user tox
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "ethpm/ethpm-spec"]
path = ethpm/ethpm-spec
url = https://github.com/ethpm/ethpm-spec.git
182 changes: 104 additions & 78 deletions docs/ethpm.rst

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docs/web3.pm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Package Manager API

The ``web3.pm`` object exposes methods to interact with Packages as defined by `ERC 1123 <https://github.com/ethereum/EIPs/issues/1123>`_.

- To learn more about the EthPM spec, visit the `documentation <http://ethpm.github.io/ethpm-spec/>`__.
- To learn more about the Py-EthPM library used in this module, visit the `documentation <https://py-ethpm.readthedocs.io/en/latest/>`__.
- To learn more about the EthPM spec, visit the `spec <http://ethpm.github.io/ethpm-spec/>`__ or the `documentation <http://docs.ethpm.com/>`__.


.. WARNING::
Expand Down
2 changes: 1 addition & 1 deletion ethpm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

ETHPM_DIR = Path(__file__).parent
ASSETS_DIR = ETHPM_DIR / "assets"
SPEC_DIR: Path = ASSETS_DIR / "spec"
ETHPM_SPEC_DIR: Path = ETHPM_DIR / "ethpm-spec"

from .package import Package # noqa: F401
from .backends.registry import RegistryURI # noqa: F401
16 changes: 8 additions & 8 deletions ethpm/_utils/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ def generate_contract_factory_kwargs(
if "abi" in contract_data:
yield "abi", contract_data["abi"]

if "deployment_bytecode" in contract_data:
yield "bytecode", contract_data["deployment_bytecode"]["bytecode"]
if "link_references" in contract_data["deployment_bytecode"]:
if "deploymentBytecode" in contract_data:
yield "bytecode", contract_data["deploymentBytecode"]["bytecode"]
if "linkReferences" in contract_data["deploymentBytecode"]:
yield "unlinked_references", tuple(
contract_data["deployment_bytecode"]["link_references"]
contract_data["deploymentBytecode"]["linkReferences"]
)

if "runtime_bytecode" in contract_data:
yield "bytecode_runtime", contract_data["runtime_bytecode"]["bytecode"]
if "link_references" in contract_data["runtime_bytecode"]:
if "runtimeBytecode" in contract_data:
yield "bytecode_runtime", contract_data["runtimeBytecode"]["bytecode"]
if "linkReferences" in contract_data["runtimeBytecode"]:
yield "linked_references", tuple(
contract_data["runtime_bytecode"]["link_references"]
contract_data["runtimeBytecode"]["linkReferences"]
)
4 changes: 2 additions & 2 deletions ethpm/_utils/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ def get_linked_deployments(deployments: Dict[str, Any]) -> Dict[str, Any]:
linked_deployments = {
dep: data
for dep, data in deployments.items()
if get_in(("runtime_bytecode", "link_dependencies"), data)
if get_in(("runtimeBytecode", "linkDependencies"), data)
}
for deployment, data in linked_deployments.items():
if any(
link_dep["value"] == deployment
for link_dep in data["runtime_bytecode"]["link_dependencies"]
for link_dep in data["runtimeBytecode"]["linkDependencies"]
):
raise BytecodeLinkingError(
f"Link dependency found in {deployment} deployment that references its "
Expand Down
24 changes: 0 additions & 24 deletions ethpm/_utils/mappings.py

This file was deleted.

1 change: 0 additions & 1 deletion ethpm/assets/ens/1.0.1.json

This file was deleted.

1 change: 1 addition & 0 deletions ethpm/assets/ens/v3.json

Large diffs are not rendered by default.

146 changes: 0 additions & 146 deletions ethpm/assets/escrow/1.0.0-pretty.json

This file was deleted.

1 change: 0 additions & 1 deletion ethpm/assets/escrow/1.0.0.json

This file was deleted.

Loading

0 comments on commit b680d52

Please sign in to comment.