Ошибка при отправке транзакции с web3.py - PullRequest
0 голосов
/ 06 марта 2020

Я разрабатываю приложение с python и web3.py для взаимодействия с моим умным контрактом.

Когда я совершаю транзакцию для метода (mkOrder), возникает следующая ошибка, любая из которых мне помогает что это значит?

Метод в смарт-контракте:

function mkOrder (uint of_id, string memory _start, string memory _to, uint TA_id, string memory _BS) public
 {

allTA[TA_id].id = TA_id;
allTA[TA_id].start = _start;
allTA[TA_id].to = _to;
allTA[TA_id].BS =_BS;
allTA[TA_id].t = offers[of_id].t;

}

Код python:

contract.functions.mkOrder(of_id,s,t,TA_id,BS).transact();

Ошибка после выполнения этой транзакции:

  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/web3/contract.py", line 948, in transact
**self.kwargs
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/web3/contract.py", line 1526, in transact_with_contract_function
txn_hash = web3.eth.sendTransaction(transact_transaction)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/web3/eth.py", line 381, in sendTransaction
get_buffered_gas_estimate(self.web3, transaction),
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/web3/_utils/transactions.py", line 126, in get_buffered_gas_estimate
gas_estimate = web3.eth.estimateGas(gas_estimate_transaction)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/web3/eth.py", line 445, in estimateGas
params,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/web3/manager.py", line 153, in request_blocking
raise ValueError(response["error"])
  ValueError: {'message': 'VM Exception while processing transaction: invalid opcode', 'code': -32000, 'data': {'stack': 'c: VM Exception while processing transaction: invalid opcode\n    at Function.c.fromResults (/Users/YA/npm/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:2:157333)\n    at e.exports (/Users/YA/npm/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:53:1405726)', 'name': 'c'}}


 Process finished with exit code 0

Любая помощь?

Большое спасибо

...