Skip to content

Commit 2ca685a

Browse files
committed
Update tx builder example in README
1 parent 883af3a commit 2ca685a

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,8 @@ builder.add_output(
155155
)
156156
)
157157

158-
# Build a finalized transaction body with the change returning to the address we own
159-
tx_body = builder.build(change_address=address)
160-
161-
# Sign the transaction body hash using the payment signing key
162-
signature = psk.sign(tx_body.hash())
163-
164-
# Add verification key and the signature to the witness set
165-
vk_witnesses = [VerificationKeyWitness(pvk, signature)]
166-
167158
# Create final signed transaction
168-
signed_tx = Transaction(tx_body, TransactionWitnessSet(vkey_witnesses=vk_witnesses))
159+
signed_tx = builder.build_and_sign([psk], change_address=address)
169160

170161
# Submit signed transaction to the network
171162
context.submit_tx(signed_tx.to_cbor())

0 commit comments

Comments
 (0)