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

TypeError: 'NoneType' object cannot be interpreted as an integer #21

Closed
viponedream opened this issue Dec 20, 2023 · 4 comments
Closed

Comments

@viponedream
Copy link

just run your example code

File "C:\Python310\lib\site-packages\mospy\Transaction.py", line 178, in _get_signer_infos
signer_infos.sequence = self._account.next_sequence
TypeError: 'NoneType' object cannot be interpreted as an integer

import httpx # optional
from mospy import Account, Transaction

account = Account(
seed_phrase="law grab theory better athlete submit awkward hawk state wedding wave monkey audit blame fury wood tag rent furnace exotic jeans drift destroy style",
address_index=12
)

tx = Transaction(
account=account,
gas=1000,
)
tx.set_fee(
amount=100,
denom="uatom"
)

Add a transfer message to the transaction (multiple messages can be added)

tx.add_msg(
tx_type='transfer',
sender=account,
receipient="cosmos1tkv9rquxr88r7snrg42kxdj9gsnfxxg028kuh9",
amount=1000,
denom="uatom"
)

Sign and encode transaction to submit it to the network manually

REST endpoint (RPC or API)

tx_bytes = tx.get_tx_bytes_as_string()

@viponedream
Copy link
Author

File "C:\Python310\lib\site-packages\mospy\Transaction.py", line 178, in _get_signer_infos
signer_infos.sequence = self._account.next_sequence

self._account.next_sequence is None, so error happen

but i run your test_transaction.py, it runs well

@ctrl-Felix
Copy link
Owner

It seems like I forgot to add the sequence in that example. The sequence is a counter indicating how many transactions have been made from the account

@ctrl-Felix
Copy link
Owner

https://mospy.ctrl-felix.de/examples/

Check out the examples to see how to set it

@viponedream
Copy link
Author

your another example set it to 1,
is it like nonce in eth network?
can you write a example to exectue batch transactions?

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

2 participants