Using Truffle Development framework (web3, react, and solidity) to test a simple smart contract. I have a basic function I am testing when I press a button on the UI, but it doesn't seem to be working the way I'd expect it. I expect the contract to increment the value and return true. Note, that the value is later being displayed on the front-end as this is what I was playing with. Code is below:
Solidity contract
uint total = 0;
function setTotalValue() public returns(bool) {
total = total + 2;
return true;
}
App.js
enter code here
async modifyTotal() {
fantasyInstance.setKittyValue.call().then(function(res) {
console.log(res); //THIS RETURNS FALSE TO THE CONSOLE
});
For clarification, modiftyTotal is called when an HTML button is clicked. The console statement returns a value of "false" and the actual total value doesn't seem to change ever. Any ideas?