This commit is contained in:
Wo Jake
2022-09-08 03:39:28 +00:00
committed by GitHub
parent aa2c23ae03
commit 8d21ab02c0

View File

@@ -2,6 +2,7 @@ from xrpl.clients import JsonRpcClient
from xrpl.models.transactions import AccountSet from xrpl.models.transactions import AccountSet
from xrpl.transaction import safe_sign_and_submit_transaction from xrpl.transaction import safe_sign_and_submit_transaction
from xrpl.wallet import generate_faucet_wallet from xrpl.wallet import generate_faucet_wallet
from xrpl.models.requests import AccountInfo
# Connect to a testnet node # Connect to a testnet node
JSON_RPC_URL = "https://s.altnet.rippletest.net:51234/" JSON_RPC_URL = "https://s.altnet.rippletest.net:51234/"
@@ -19,15 +20,18 @@ tx = AccountSet(
# Sign the transaction locally and submit to a node # Sign the transaction locally and submit to a node
my_tx_payment_signed = safe_sign_and_submit_transaction(tx, wallet=test_wallet, client=client) my_tx_payment_signed = safe_sign_and_submit_transaction(tx, wallet=test_wallet, client=client)
my_tx_payment_signed = my_tx_payment_signed.result my_tx_payment_signed = my_tx_payment_signed.result["engine_result"]
result = my_tx_payment_signed["engine_result"]
print(f"Account: {myAddr}") print(f"Transaction result: {my_tx_payment_signed}")
if result == "tesSUCCESS":
print("AccountSet transaction successful, Destination Tag is now required for all incoming transactions") # Verify Account Settings
elif result == "tefMAX_LEDGER": get_acc_flag = AccountInfo(
print("Transaction failed to achieve consensus") account=myAddr
elif result == "unknown": )
print("Transaction status unknown")
response = client.request(get_acc_flag)
if response.result['account_data']['Flags'] == 131072:
print("Require Destination Tag is enabled.")
else: else:
print(f"Transaction failed with code {result}") print("Require Destination Tag is DISABLED.")