In truffle saving 1 struct exceeds the default gas of testrpc. Is this function poorly written, or is this common in truffle.
VM Exception while processing transaction: out of gas
solidity
pragma solidity ^0.4.2;
contract SimpleStorage {
mapping(address => Pass[]) passes;
struct Pass{
string class_name;
string first_name;
string last_name;
}
function submitPass(string classname, string firstname, string lastname){
passes[msg.sender].push(Pass({
class_name: classname,
first_name: firstname,
last_name: lastname
}));
}
}
React
touchedme(){
simpleStorage.setProvider(this.state.web3.currentProvider)
this.state.web3.eth.getAccounts((error, accounts) => {
simpleStorage.deployed().then((instance) => {
simpleStorageInstance = instance;
return simpleStorageInstance.submitPass("Intro 2 Truffle", "Alain", "Gold", {from: accounts[0]})
})
})
}