Skip to content

Commit

Permalink
Merge pull request #290 from tronprotocol/feature/v4.4.0
Browse files Browse the repository at this point in the history
revert callstatic
  • Loading branch information
unicornonea authored Sep 23, 2022
2 parents 9738d6a + 53a52d8 commit 63c1570
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/contract/method.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ export default class Method {
if (!this.contract.deployed)
return callback('Calling smart contracts requires you to load the contract first');

const {stateMutability} = this.abi;

if (!['pure', 'view'].includes(stateMutability.toLowerCase()))
return callback(`Methods with state mutability "${stateMutability}" must use send()`);

options = {
...this.defaultOptions,
from: this.tronWeb.defaultAddress.hex,
Expand Down

0 comments on commit 63c1570

Please sign in to comment.