Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txnNotFound for a TrustSet transaction #347

Closed
cattieinthere opened this issue Jan 19, 2022 · 7 comments
Closed

txnNotFound for a TrustSet transaction #347

cattieinthere opened this issue Jan 19, 2022 · 7 comments

Comments

@cattieinthere
Copy link

cattieinthere commented Jan 19, 2022

Here's the code:

#lib imports here

address = 'my_public_classic_xrp_address_here'

client = JsonRpcClient('https://s1.ripple.com:51234/')

account_info = get_account_info(address, client)
seq = account_info['account_data']['Sequence']
wallet = Wallet(seed, seq)

currency_code = '026E0029041E741F00000000006A546573743034'
limit_amount = IssuedCurrencyAmount(currency=currency_code, issuer=wallet.classic_address, value="10000000000")

tx = TrustSet(account=wallet.classic_address, flags=131072, limit_amount=limit_amount)
tx_signed = safe_sign_and_autofill_transaction(tx, wallet, client)

tx_response = send_reliable_submission(tx_signed, client)

And the last line of code gives the error: Request failed, txnNotFound: Transaction not found.

And, in fact, no transaction has been submitted. But why is that?

@JST5000
Copy link
Collaborator

JST5000 commented Jan 19, 2022

Found two issues when trying to run this code:

  1. account_info isn't subscriptable -> account_info.result['account_data']['Sequence'] is what you're looking for
  2. After changing that, I get the following error: Transaction failed, temDST_IS_SRC: Destination may not be source. (Which is because the TrustSet is a trust line from the wallet account to itself)

Let me know if resolving those issues fixes the error :)

@cattieinthere
Copy link
Author

As for 1., yes, you are correct. I had it right into my script but I typed it wrong here.

As for 2., I don't understand what's the error and I'm not encountering it. I didn't even set the destination! I just set account=wallet.classic_address which is the account issuing the transaction (wallet).

TrustSet(account=wallet.classic_address, flags=131072, limit_amount=limit_amount)

@JST5000
Copy link
Collaborator

JST5000 commented Jan 19, 2022

Ah sorry, the issue is the limit_amount issuer field is set to wallet.classic_address, which is the same as the account in the TrustSet transaction. So, one of those two has to be a different account in order for this transaction to go through I believe.

@shutz-c0de
Copy link

shutz-c0de commented Jan 25, 2022

Hello there,

I encounter the same issue (75% of the time), what's peculiar is that the tx actually works, every time (100% of the time).
I'm not sure what causes this. I will pass on the exception in the meantime.

Here is my code (sanitized, for obvious reasons):

JSON_RPC_URL = "https://s1.ripple.com:51234/"
client = JsonRpcClient(JSON_RPC_URL)

wallet = Wallet(walletSeed, walletSequence)

my_tx_trustset = TrustSet(
    account=wallet.classic_address,
    limit_amount={
		  "currency": currencyString,
		  "issuer": issuerAddress,
		  "value": limitAmount
		},
    flags=131072
)

my_tx_trustset_signed = safe_sign_and_autofill_transaction(my_tx_trustset, wallet, client)
tx_response = send_reliable_submission(my_tx_trustset_signed, client)

@mvadari
Copy link
Collaborator

mvadari commented Jan 25, 2022

This is likely the same issue as #312

@khancode
Copy link
Collaborator

@cattieinthere @shutz-c0de This bug is reproduced when waiting for the final outcome on a submitted malformed transaction. I created a PR that verifies a submitted transaction is not malformed before waiting for its final outcome. #379

@khancode
Copy link
Collaborator

Closing this issue. Feel free to reopen if you can still reproduce this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants