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.clients import JsonRpcClient
from xrpl.models import AccountSet, AccountSetFlag
from xrpl.transaction import (safe_sign_and_autofill_transaction,
send_reliable_submission)
from xrpl.wallet import Wallet, generate_faucet_wallet
from xrpl.transaction import submit_and_wait
from xrpl.wallet import generate_faucet_wallet
client = JsonRpcClient("https://s.altnet.rippletest.net:51234") # connect to testnet
@@ -15,13 +14,10 @@ print("Successfully generated test wallet")
# build accountset transaction to disable freezing
accountset = AccountSet(account=sender_wallet.classic_address, set_flag=AccountSetFlag.ASF_NO_FREEZE)
# sign transaction
stxn = safe_sign_and_autofill_transaction(accountset, sender_wallet, client)
print("Now sending an AccountSet transaction to set the ASF_NO_FREEZE flag...")
# 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(accountset, client, sender_wallet)
# parse response for result
@@ -31,4 +27,4 @@ stxn_result = stxn_response.result
if stxn_result["meta"]["TransactionResult"] == "tesSUCCESS":
print(f'Successfully enabled no freeze for {sender_wallet.classic_address}')
print(stxn_result["hash"])

View File

@@ -1,8 +1,7 @@
from xrpl.clients import JsonRpcClient
from xrpl.models import IssuedCurrencyAmount, TrustSet
from xrpl.models.transactions import TrustSetFlag
from xrpl.transaction import (safe_sign_and_autofill_transaction,
send_reliable_submission)
from xrpl.transaction import submit_and_wait
from xrpl.wallet import generate_faucet_wallet
client = JsonRpcClient("https://s.altnet.rippletest.net:51234") # Connect to testnet
@@ -25,13 +24,10 @@ trustset = TrustSet(account=sender_wallet.classic_address, limit_amount=IssuedCu
value = value),
flags=TrustSetFlag.TF_SET_FREEZE)
# Sign transaction
stxn = safe_sign_and_autofill_transaction(trustset, sender_wallet, client)
print("Now setting a trustline with the TF_SET_FREEZE flag enabled...")
# 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(trustset, 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 AccountSet, AccountSetFlag
from xrpl.transaction import (safe_sign_and_autofill_transaction,
send_reliable_submission)
from xrpl.transaction import submit_and_wait
from xrpl.wallet import generate_faucet_wallet
client = JsonRpcClient("https://s.altnet.rippletest.net:51234") # Connect to testnet
@@ -17,9 +16,8 @@ accountset = AccountSet(account=sender_wallet.classic_address,
print("Preparing and submitting Account set transaction with ASF_GLOBAL_FREEZE ...")
# Sign and submit transaction
stxn = safe_sign_and_autofill_transaction(accountset, sender_wallet, client)
stxn_response = send_reliable_submission(stxn, client)
# Autofill, sign, then submit transaction and wait for result
stxn_response = submit_and_wait(accountset, 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 IssuedCurrencyAmount, TrustSet, TrustSetFlag
from xrpl.transaction import (safe_sign_and_autofill_transaction,
send_reliable_submission)
from xrpl.transaction import submit_and_wait
from xrpl.wallet import generate_faucet_wallet
client = JsonRpcClient("https://s.altnet.rippletest.net:51234") # connect to testnet
@@ -32,9 +31,8 @@ flags=TrustSetFlag.TF_CLEAR_FREEZE)
print("prepared and submitting TF_CLEAR_FREEZE transaction")
# Sign and Submit transaction
stxn = safe_sign_and_autofill_transaction(trustset, sender_wallet, client)
stxn_response = send_reliable_submission(stxn, client)
# Autofill, sign, then submit transaction and wait for result
stxn_response = submit_and_wait(trustset, client, sender_wallet)
# Parse response for result
stxn_result = stxn_response.result