@@ -24,7 +24,7 @@ To calculate the hash of a datum, we can leverage the helper class `PlutusData`.
2424Empty datum::
2525
2626 >>> empty_datum = PlutusData()
27- >>> empty_datum.to_cbor ()
27+ >>> empty_datum.to_cbor_hex ()
2828 'd87980'
2929
3030Sample datum with int, bytes, List and hashmap inputs::
@@ -39,7 +39,7 @@ Sample datum with int, bytes, List and hashmap inputs::
3939 ... d: dict
4040
4141 >>> datum = MyDatum(123, b"1234", IndefiniteList([4, 5, 6]), {1: b"1", 2: b"2"})
42- >>> datum.to_cbor ()
42+ >>> datum.to_cbor_hex ()
4343 'd87a9f187b43333231ff'
4444
4545You can also wrap `PlutusData ` within `PlutusData `::
@@ -55,7 +55,7 @@ You can also wrap `PlutusData` within `PlutusData`::
5555 >>> deadline = 1643235300000
5656 >>> other_datum = MyDatum(123, b"1234", IndefiniteList([4, 5, 6]), {1: b"1", 2: b"2"})
5757 >>> include_datum = InclusionDatum(key_hash, deadline, other_datum)
58- >>> include_datum.to_cbor ()
58+ >>> include_datum.to_cbor_hex ()
5959 'd87a9f581cc2ff616e11299d9094ce0a7eb5b7284b705147a822f4ffbd471f971a1b0000017e9874d2a0d8668218829f187b44313233349f040506ffa2014131024132ffff'
6060
6161`PlutusData ` supports conversion from/to JSON format, which
@@ -67,7 +67,7 @@ Similarly, redeemer can be serialized like following::
6767
6868 >>> data = MyDatum(123, b"234", IndefiniteList([]), {1: b"1", 2: b"2"})
6969 >>> redeemer = Redeemer(data, ExecutionUnits(1000000, 1000000))
70- >>> redeemer.to_cbor ()
70+ >>> redeemer.to_cbor_hex ()
7171 '840000d8668218829f187b433233349fffa2014131024132ff821a000f42401a000f4240'
7272
7373-----------------------
@@ -178,7 +178,7 @@ Note that we will just use the datatype defined in the contract, as it also uses
178178Build, sign and submit the transaction:
179179
180180 >>> signed_tx = builder.build_and_sign([payment_skey], giver_address)
181- >>> context.submit_tx(signed_tx.to_cbor ())
181+ >>> context.submit_tx(signed_tx.to_cbor_hex ())
182182
183183Step 6
184184
@@ -219,7 +219,7 @@ Now lets try to resubmit this::
219219
220220 >>> signed_tx = builder.build_and_sign([payment_skey_2], taker_address)
221221
222- >>> context.submit_tx(signed_tx.to_cbor ())
222+ >>> context.submit_tx(signed_tx.to_cbor_hex ())
223223
224224The funds locked in script address is successfully retrieved to the taker address.
225225
0 commit comments