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

Unable to use push_action with a time_point argument #11

Open
mesballo opened this issue Mar 13, 2023 · 4 comments
Open

Unable to use push_action with a time_point argument #11

mesballo opened this issue Mar 13, 2023 · 4 comments

Comments

@mesballo
Copy link

i'm passing dates in this format '2023-03-10T14:44:30', but it appears to being wrongly converted in something else.
The action is from my contract and it accept two field: "start" and "expire". In the contract code i check if "start" is earlier then "end".
My contract works as aspected using cleos Eosio Studio or blok. It's not working with this lib.
How i have to pass the date to the python script?
Please help me

@learnforpractice
Copy link
Owner

Thank you for reporting the issue! I have fixed the bug, and it will be included in the next release.

@mesballo
Copy link
Author

Oh great! I'm really happy to be of help.
If it is not a big fix, can i ask you to share the fix in a comment, as i need this lib very soon.
Thank you again

@learnforpractice
Copy link
Owner

You can workaround this issue by using the following method:

binargs = eosapi.abi_json_to_bin('testaccount', 'testaction', {'time': '2023-03-10T14:44:30'})
args = bytes.fromhex(binargs['binargs'])

#for multiple actions
eosapi.push_actions([['testaccount', 'testaction', args, {'myaccount': 'active'}]])

#for only one action
eosapi.push_action('testaccount', 'testaction', args, {'myaccount': 'active'})

@mesballo
Copy link
Author

Thank you very much!!

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