Ошибка: требуемый газ превышает допустимый или всегда неудачная транзакция - PullRequest
0 голосов
/ 14 марта 2019

Я не могу вызвать метод из-за ошибки, которая появляется на рисунке. Понятия не имею, как ее решить, есть ли у вас предложения?

Функция, которая вызывает метод умного контракта в NodeJS:

async function callSmartContractMethod(functionName, arguments, contractAddress) {


    smartContractInstance = new web3.eth.Contract(JSON.parse(contractJson).abi, contractAddress, {
        from: "0x8882528C7104e146E0500203C353C09922575385",
        gasPrice: '1000000'
    });

    log.yellow(`Calling smart contract function: ${functionName} with arguments: ${arguments} smart contract address is: ${contractAddress}`);
    log.yellow.underline('Please wait...');
    return smartContractInstance.methods[functionName].apply(this, arguments).send({from: '0x8882528C7104e146E0500203C353C09922575385'})
        .then((receipt) => {
            log.green(`Transaction of ${functionName} done with success`);
            return receipt;
        }).catch( (error) => {
            log.red.underline(error);
        });
}

Метод вызванного смарт-контракта (Solidity):

    function printOrderReceived(bytes32 _gcodeHash) public {
        require(msg.sender == printer);
        gcodeHashReceived = _gcodeHash;
        b_printOrderReceived = true;
        getCurrentState();
    }

Часть зависимостей файла package.json:

"truffle-hdwallet-provider": "0.0.3",
"truffle-hdwallet-provider-privkey": "^1.0.3",
"web3": "^1.0.0-beta.48"

enter image description here

...