Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cffls committed Feb 5, 2023
1 parent a189e7d commit 28ddd95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pygments==2.13.0 ; python_version >= "3.7" and python_version < "4.0"
pynacl==1.5.0 ; python_version >= "3.7" and python_version < "4.0"
pytest-cov==4.0.0 ; python_version >= "3.7" and python_version < "4.0"
pytest-xdist==3.1.0 ; python_version >= "3.7" and python_version < "4.0"
pytest==7.2.0 ; python_version >= "3.7" and python_version < "4.0"
pytest==7.2.1 ; python_version >= "3.7" and python_version < "4.0"
pytz==2022.6 ; python_version >= "3.7" and python_version < "4.0"
requests==2.28.1 ; python_version >= "3.7" and python_version < "4"
retry==0.9.2 ; python_version >= "3.7" and python_version < "4.0"
Expand Down
8 changes: 5 additions & 3 deletions docs/source/guides/plutus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ Step 3
Back into the python console.
Similar to `Transaction guide <../guides/transaction.html>`_, we build a chain context using `BlockFrostChainContext <../api/pycardano.backend.base.html#pycardano.backend.blockfrost.BlockFrostChainContext>`_::

>>> from pycardano import BlockFrostChainContext, Network
>>> network = Network.TESTNET
>>> context = BlockFrostChainContext("your_blockfrost_project_id", network)
>>> from blockfrost import ApiUrls
>>> from pycardano import BlockFrostChainContext
>>> context = BlockFrostChainContext("your_blockfrost_project_id", base_url=ApiUrls.preprod.value)

Step 2

Expand All @@ -136,6 +136,7 @@ Create script address::
... PlutusData,
... Redeemer,
... PlutusV2Script,
... Network,
... )

>>> # This artifact was generated in step 2
Expand All @@ -144,6 +145,7 @@ Create script address::
>>> gift_script = PlutusV2Script(bytes.fromhex(script_hex))

>>> script_hash = plutus_script_hash(gift_script)
>>> network = Network.TESTNET
>>> script_address = Address(script_hash, network=network)

Step 3
Expand Down
8 changes: 5 additions & 3 deletions docs/source/guides/transaction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,18 @@ To use a transaction builder, we first need to create a chain context, so the bu
search proper transaction inputs to use. Currently, the available chain context is
`BlockFrostChainContext <../api/pycardano.backend.base.html#pycardano.backend.blockfrost.BlockFrostChainContext>`_ ::

>>> from pycardano import BlockFrostChainContext, Network
>>> from blockfrost import ApiUrls
>>> from pycardano import BlockFrostChainContext
>>> network = Network.TESTNET
>>> context = BlockFrostChainContext("your_blockfrost_project_id", network)
>>> context = BlockFrostChainContext("your_blockfrost_project_id", base_url=ApiUrls.preprod.value)


Step 2

Read signing key into the program and generate its corresponding verification key::

>>> from pycardano import PaymentSigningKey, PaymentVerificationKey, Address
>>> from pycardano import PaymentSigningKey, PaymentVerificationKey, Address, Network
>>> network = Network.TESTNET
>>> sk = PaymentSigningKey.load("path/to/payment.skey")
>>> vk = PaymentVerificationKey.from_signing_key(sk)
>>> address = Address(pvk.hash(), svk.hash(), network)
Expand Down

0 comments on commit 28ddd95

Please sign in to comment.