Skip to content

Commit ee04318

Browse files
committed
More test
1 parent f1b04aa commit ee04318

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

docs/source/guides/address.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ a stake verification key::
8585
An address object could also be created from an address string directly::
8686

8787
>>> address = Address.from_primitive("addr_test1vr2p8st5t5cxqglyjky7vk98k7jtfhdpvhl4e97cezuhn0cqcexl7")
88+
>>> byron_address = Address.from_primitive("Ae2tdPwUPEZFRbyhz3cpfC2CumGzNkFBN2L42rcUc2yjQpEkxDbkPodpMAi")
8889

8990

9091
An enterprise address does not have staking functionalities, it is created from a payment verification key only::

test/pycardano/test_txbuilder.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,3 +2466,23 @@ def test_skip_utxo_with_script(chain_context):
24662466
tx_builder.add_input_address(addr)
24672467
with pytest.raises(UTxOSelectionException):
24682468
tx_builder.build()
2469+
2470+
def test_byron_addr_output(chain_context):
2471+
tx_builder = TransactionBuilder(chain_context)
2472+
sender = "addr_test1vrm9x2zsux7va6w892g38tvchnzahvcd9tykqf3ygnmwtaqyfg52x"
2473+
2474+
byron1 = "DdzFFzCqrhsxrgB6w6VhgfAqUZ69Va583murc21S4QFTJ6WUHAh4Gk8t1QHofpza5MZxG4dNVQWe8q78h4Utp9MGBQHBLD54rz6CTLsm"
2475+
byron2 = "Ae2tdPwUPEZFRbyhz3cpfC2CumGzNkFBN2L42rcUc2yjQpEkxDbkPodpMAi"
2476+
2477+
# Add sender address as input
2478+
tx_builder.add_input_address(
2479+
sender
2480+
).add_output(
2481+
TransactionOutput.from_primitive([byron1, 500000])
2482+
).add_output(
2483+
TransactionOutput.from_primitive([byron2, 1500000])
2484+
)
2485+
2486+
tx_body = tx_builder.build()
2487+
assert str(tx_body.outputs[0].address) == byron1
2488+
assert str(tx_body.outputs[1].address) == byron2

0 commit comments

Comments
 (0)