Code Monkey home page Code Monkey logo

Comments (6)

deckb avatar deckb commented on July 30, 2024

@jerryfane 1.1.8 should contain the fix for you. Please confirm and I will close this issue.

from eospy.

jerryfane avatar jerryfane commented on July 30, 2024

Worked fine for 2 transactions, then this new error appeared...

Traceback (most recent call last):
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\dynamic_url.py", line 41, in post_url
    r.raise_for_status()
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\models.py", line 937, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://eos.greymass.com/v1/chain/push_transaction

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "pycleos.py", line 51, in <module>
    resp = ce.push_transaction(trx, key, broadcast=True)
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\cleos.py", line 169, in push_transaction
    return self.post('chain.push_transaction', params=None, data=data, timeout=timeout)
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\cleos.py", line 31, in post
    return cmd.post_url(url, **kwargs)
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\dynamic_url.py", line 43, in post_url
    raise requests.exceptions.HTTPError('Error: {}'.format(r.json()))
requests.exceptions.HTTPError: Error: {'code': 500, 'message': 'Internal Service Error', 'error': {'code': 3050003, 'name': 'eosio_assert_message_exception', 'what': 'eosio_assert_message assertion failure', 'details': [{'message': 'assertion failure with message: unable to find key', 'file': 'wasm_interface.cpp', 'line_number': 917, 'method': 'eosio_assert'}, {'message': 'pending console output: ', 'file': 'apply_context.cpp', 'line_number': 72, 'method': 'exec_one'}]}}

assertion failure with message: unable to find key

from eospy.

deckb avatar deckb commented on July 30, 2024

Can you share what you are trying to do? If it was the same call and it failed the 3rd time it may be an issue with your setup. Others have had similar issues:
EOSIO/eos#3653

from eospy.

jerryfane avatar jerryfane commented on July 30, 2024

I'm just trying to send a simple token transfer in the mainnet, you can check my code here, it's basically the same as the example in this git.

from eospy.cleos import Cleos
import eospy.keys

ce = Cleos(url='https://eos.greymass.com')

key = eospy.keys.EOSKey('MYPRIVATEKEY')

memo = "{'type': 'sell-limit', 'symbol': 'parslseed123-seed-eos', 'price': '0.00124', 'channel': 'API'}"

payload = [
        {
            'args': {
                "from": "myaccount",             # sender
                "to": "receiveraccount,               # receiver
                "quantity": "0.0001 EPRA",           # In EOS
                "memo": str(memo),
            },
            "account": "eosio.token",
            "name": "transfer",
            "authorization": [{
                "actor": "myaccount",
                "permission": "active",
            }],
        }
    ]

#payload[0]['args']['memo'] = str(memo)
print(payload[0]['args']['memo'])
print(payload[0]['args']['quantity'])

#print(memo[0]['type'])

#Converting payload to binary
data=ce.abi_json_to_bin(payload[0]['account'],payload[0]['name'],payload[0]['args'])
#Inserting payload binary form as "data" field in original payload
payload[0]['data']=data['binargs']
#Removing the arguments field
payload[0].pop('args')
#final transaction formed
trx = {"actions":[payload[0]]}

resp = ce.push_transaction(trx, key, broadcast=True)
print(resp)

I've tried with many tokens and amounts

from eospy.

jerryfane avatar jerryfane commented on July 30, 2024

You can close this thread.
The assertion failure with message: unable to find key was due to an error on my code. I was trying to transfer non EOS token by using the eosio.token contract. Now everything is working, thank you for your time!

from eospy.

deckb avatar deckb commented on July 30, 2024

Thanks and I apologize for not getting back to you in a timely manner.

from eospy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.