The Package
object will function much like the Contract
class provided by web3
. Rather than instantiating the base class provided by ethpm
, you will instead use a classmethod
which generates a new Package
class for a given package.
Package
objects must be instantiated with a valid web3
object.
>>> from ethpm import Package, V2_PACKAGES_DIR >>> from web3 import Web3
>>> owned_manifest_path = V2_PACKAGES_DIR / 'owned' / '1.0.0.json' >>> w3 = Web3(Web3.EthereumTesterProvider())
>>> OwnedPackage = Package.from_file(owned_manifest_path, w3) >>> assert isinstance(OwnedPackage, Package)
Each Package
exposes the following properties.
ethpm.Package
Each Package
exposes the following methods.
ethpm.Package
The Package
class currently verifies the following things.
- Manifests used to instantiate a
Package
object conform to the EthPM V2 Manifest Specification
And in the future should verify.
- Included bytecode matches compilation output
- Deployed bytecode matches compilation output