pyeoskit
pyeoskit copied to clipboard
Unable to use push_action with a time_point argument
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
Thank you for reporting the issue! I have fixed the bug, and it will be included in the next release.
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
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'})
Thank you very much!!