Update unfreeze_token.py

This commit is contained in:
Obiajulu
2022-11-21 02:31:16 -08:00
committed by GitHub
parent 121cc9f034
commit a9eb06254b

View File

@@ -1,8 +1,7 @@
from xrpl.clients import JsonRpcClient
from xrpl.models import IssuedCurrencyAmount, TrustSet
from xrpl.models import IssuedCurrencyAmount, TrustSet, TrustSetFlag
from xrpl.transaction import (safe_sign_and_autofill_transaction,
send_reliable_submission)
from xrpl.models import TrustSetFlag
from xrpl.wallet import generate_faucet_wallet
client = JsonRpcClient("https://s.altnet.rippletest.net:51234") # connect to testnet
@@ -43,9 +42,9 @@ stxn_result = stxn_response.result
# Print result and transaction hash
if stxn_result["meta"]["TransactionResult"] == "tesSUCCESS":
print(f'Successfully enabled no freeze for {sender_wallet.classic_address}')
if stxn_result["meta"]["TransactionResult"] == "tecNoLineRedundant":
if stxn_result["meta"]["TransactionResult"] == "tecNO_LINE_REDUNDANT":
print("This was used on an account which didn't have a trustline yet. To try this out, modify `target_addr` to point to an account with a frozen trustline, and make sure the currency code matches.")
else:
print(stxn_result["meta"]["TransactionResult"])
print(f"Transaction failed with {stxn_result['meta']['TransactionResult']}")
print(stxn_result["hash"])