pyeoskit icon indicating copy to clipboard operation
pyeoskit copied to clipboard

Unable to use push_action with a time_point argument

Open mesballo opened this issue 1 year ago • 4 comments

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

mesballo avatar Mar 13 '23 11:03 mesballo

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

learnforpractice avatar Mar 13 '23 12:03 learnforpractice

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

mesballo avatar Mar 13 '23 14:03 mesballo

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'})

learnforpractice avatar Mar 13 '23 14:03 learnforpractice

Thank you very much!!

mesballo avatar Mar 13 '23 14:03 mesballo