send_reliable_submission -> submit_and_wait

This commit is contained in:
JST5000
2023-06-05 16:05:04 -07:00
parent 82a880580a
commit 676e75da16
32 changed files with 127 additions and 208 deletions

View File

@@ -1,8 +1,7 @@
from xrpl.wallet import Wallet, generate_faucet_wallet
from xrpl.wallet import generate_faucet_wallet
from xrpl.clients import JsonRpcClient
from xrpl.models import CheckCancel
from xrpl.transaction import (safe_sign_and_autofill_transaction,
send_reliable_submission)
from xrpl.transaction import submit_and_wait
client = JsonRpcClient("https://s.altnet.rippletest.net:51234") # Connect to the testnetwork
@@ -20,8 +19,7 @@ sender_wallet = generate_faucet_wallet(client=client)
check_txn = CheckCancel(account=sender_wallet.classic_address, check_id=check_id)
# Sign and submit transaction
stxn = safe_sign_and_autofill_transaction(check_txn, sender_wallet, client)
stxn_response = send_reliable_submission(stxn, client)
stxn_response = submit_and_wait(check_txn, client, sender_wallet)
# Parse response for result
stxn_result = stxn_response.result

View File

@@ -1,7 +1,6 @@
from xrpl.clients import JsonRpcClient
from xrpl.models import CheckCash, IssuedCurrencyAmount
from xrpl.transaction import (safe_sign_and_autofill_transaction,
send_reliable_submission)
from xrpl.transaction import submit_and_wait
from xrpl.utils import str_to_hex, xrp_to_drops
from xrpl.wallet import generate_faucet_wallet
@@ -23,11 +22,9 @@ sender_wallet = generate_faucet_wallet(client=client)
# Build check cash transaction
check_txn = CheckCash(account=sender_wallet.classic_address, check_id=check_id, amount=xrp_to_drops(amount))
# Sign transaction
stxn = safe_sign_and_autofill_transaction(check_txn, sender_wallet, client)
# Autofill, sign, then submit transaction and wait for result
stxn_response = submit_and_wait(check_txn, client, sender_wallet)
# Submit transaction and wait for result
stxn_response = send_reliable_submission(stxn, client)
# Parse response for result
stxn_result = stxn_response.result
@@ -60,11 +57,8 @@ check_txn = CheckCash(account=sender_wallet.classic_address, check_id=check_id,
issuer=issuer,
value=amount))
# Sign transaction
stxn = safe_sign_and_autofill_transaction(check_txn, sender_wallet, client)
# Submit transaction and wait for result
stxn_response = send_reliable_submission(stxn, client)
# Autofill, sign, then submit transaction and wait for result
stxn_response = submit_and_wait(check_txn, client, sender_wallet)
# Parse response for result
stxn_result = stxn_response.result

View File

@@ -2,8 +2,7 @@ from datetime import datetime, timedelta
from xrpl.clients import JsonRpcClient
from xrpl.models import CheckCreate, IssuedCurrencyAmount
from xrpl.transaction import (safe_sign_and_autofill_transaction,
send_reliable_submission)
from xrpl.transaction import submit_and_wait
from xrpl.utils import datetime_to_ripple_time, str_to_hex, xrp_to_drops
from xrpl.wallet import generate_faucet_wallet
@@ -29,13 +28,12 @@ sender_wallet = generate_faucet_wallet(client=client)
check_txn = CheckCreate(account=sender_wallet.classic_address, destination=receiver_addr,
send_max=IssuedCurrencyAmount(
currency=str_to_hex(token),
issuer=issuer,
issuer=issuer,
value=amount),
expiration=expiry_date)
# Sign, submit transaction and wait for result
stxn = safe_sign_and_autofill_transaction(check_txn, sender_wallet, client)
stxn_response = send_reliable_submission(stxn, client)
# Autofill, sign, then submit transaction and wait for result
stxn_response = submit_and_wait(check_txn, client, sender_wallet)
# Parse response for result
stxn_result = stxn_response.result
@@ -66,9 +64,8 @@ check_txn = CheckCreate(account=sender_wallet.classic_address,
send_max=xrp_to_drops(amount),
expiration=expiry_date)
# Sign, submit transaction and wait for result
stxn = safe_sign_and_autofill_transaction(check_txn, sender_wallet, client)
stxn_response = send_reliable_submission(stxn, client)
# Autofill, sign, then submit transaction and wait for result
stxn_response = submit_and_wait(check_txn, client, sender_wallet)
# Parse response for result
stxn_result = stxn_response.result