I have deployed a contract with following push function to my local privatechain via remix.
struct TestComplex{
address testValue;
address delegate;
uint testInt;
}
TestComplex[] testArray;
function setTestArrayByPush( address _delegate, address _testAddr, uint _testInt) public {
testArray.push(TestComplex( {
testValue:_testAddr,
delegate: _delegate,
testInt: _testInt
} ));
}
If I call it via web3Provider@remix, it works fine, but when I call it via geth console or via JS script contractInstance.setTestArrayByPush(<Add1>, <Add2>,<Int>)
, it will not push any thing into the array.
When I remove one attribute from TestComplex structure and the function changed as following. It works for both geth and remix.
function setTestArrayByPush(address _testAddr, uint _testInt) public {
testArray.push(TestComplex( {
testValue:_testAddr,
testInt: _testInt
}));
{
}
So I'm wondering that what is the difference between remix function call and geth console? And how could I pass more then two parameters into stuct array in my Dapp?