threefoldfoundation / tfchain

Official implementation of the ThreeFold blockchain
https://explorer.threefoldtoken.com
Apache License 2.0
13 stars 7 forks source link

explorer gives wrong error message for public key of 3Bot already in use #346

Closed GlenDC closed 5 years ago

GlenDC commented 5 years ago

When a public key is already in use it complains that a 3Bot name is already used, which is incorrect.

Output in JSX:

JSX> result= w.threebot.record_new(1,["robot2000.sonnom"],["robot2000.org"],0)                                                                                                                                               
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/sandbox/lib/jumpscale/Jumpscale/clients/blockchain/tfchain/TFChainWallet.py", line 1369, in record_new
    return self._sign_and_submit_txn(txn, balance)
  File "/sandbox/lib/jumpscale/Jumpscale/clients/blockchain/tfchain/TFChainWallet.py", line 1530, in _sign_and_submit_txn
    txn.id = self._transaction_put(transaction=txn)
  File "/sandbox/lib/jumpscale/Jumpscale/clients/blockchain/tfchain/TFChainWallet.py", line 1557, in _transaction_put
    return self._wallet.client.transaction_put(transaction=transaction)
  File "/sandbox/lib/jumpscale/Jumpscale/clients/blockchain/tfchain/TFChainClient.py", line 218, in transaction_put
    resp = self.explorer_post(endpoint=endpoint, data=transaction)
  File "/sandbox/lib/jumpscale/Jumpscale/clients/blockchain/tfchain/TFChainClient.py", line 462, in _explorer_post
    return j.clients.tfchain.explorer.post(addresses=self.explorer_addresses, endpoint=endpoint, data=data)
  File "/sandbox/lib/jumpscale/Jumpscale/clients/blockchain/tfchain/TFChainExplorerClient.py", line 108, in post
    raise j.clients.tfchain.errors.ExplorerServerPostError(
Jumpscale.clients.blockchain.tfchain.types.Errors.ExplorerServerPostError: /transactionpool/transactions: POST: error (code: 400): b'{"message":"error after call to /wallet/transactions: bot name is already registered"}\n'

/transactionpool/transactions: POST: error (code: 400): b'{"message":"error after call to /wallet/transactions: bot name is already registered"}\n'

b'{"message":"error after call to /wallet/transactions: bot name is already registered"}\n'

Transaction:

b'{\n"version": 144,\n"data": {\n"nrofmonths": 1,\n"txfee": "100000000",\n"coininputs": [\n{\n"parentid": "9aad532fc7f6401b36a7fb1ff9333fd790bbab82563804fe8e5f03f118783d74",\n"fulfillment": {\n
"type": 1,\n"data": {\n"publickey": "ed25519:060bf143977959248d80635c6c89137d86e1d6e2906ab731d30a00cc9b95d68d",\n"signature": "8d1c2963045b4d25003db6229a0209acbd5a9b10fcc86e12644bf91fc9ea1cba5c187c953d3bef0a110e20b117ecdc
a9528cf42efb4c3b77d5f989871600ff02"\n}\n}\n},\n{\n"parentid": "c9209b3f826cdf2fa33bf5f16be7bf22f7bc6542935e1184d758cd7eca601b64",\n"fulfillment": {\n"type": 1,\n"data": {\n"publickey": "ed25519:060bf143977959248d80635c6c8
9137d86e1d6e2906ab731d30a00cc9b95d68d",\n"signature": "74285b9c0b09bdcf2af56c7f5d1deb33dfc998c0880f4a7387a8627bf8f2f653284a4e284c7718f9f3ef7b436c0dec5e867f8bbcfd5043930ae8bbe02426b80e"\n}\n}\n}\n],\n"identification": {\n"
publickey": "ed25519:060bf143977959248d80635c6c89137d86e1d6e2906ab731d30a00cc9b95d68d",\n"signature": "72071e1784ac9466f03a67512aecfd1b67811e245e4598372e491dddbb425a8744fcc28a1be6afd52f64f052d925399121c92f2edc67411f4134f81802bda908"\n},\n"addresses": [\n"robot2000.org"\n],\n"names": [\n"robot2000.sonnom"\n],\n"refundcoinoutput": {\n"value": "16200000000",\n"condition": {\n"type": 1,\n"data": {\n"unlockhash": "01d761561e7203276ef2944628bfde5bfcabf0960b69eda69ac1d317bcdcc53af06a0fd08c5f91"\n}\n}\n}\n}\n}'