Skip to content

Latest commit

 

History

History
58 lines (35 loc) · 1.74 KB

package.rst

File metadata and controls

58 lines (35 loc) · 1.74 KB

Package

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)

Properties

Each Package exposes the following properties.

ethpm.Package

Methods

Each Package exposes the following methods.

ethpm.Package

Validation

The Package class currently verifies the following things.

And in the future should verify.

  • Included bytecode matches compilation output
  • Deployed bytecode matches compilation output