I am facing problem with bytes32.
Here is my sample contract:
pragma solidity ^0.4.16;
contract Test {
bytes32 public input;
function test(bytes32 _in) public {
input = _in;
}
}
The problem is in truffle dev, no matter how I run the test function, the input value is the same. For example, if I run:
MyContract.deployed().then(inst => { inst.test(12, {from: >web3.eth.accounts[0]}) });
Then I get the result:
truffle(develop)> MyContract.deployed().then(inst => { return >inst.input.call() }); '0xc000000000000000000000000000000000000000000000000000000000000000'
Also, if I run:
MyContract.deployed().then(inst => { inst.test("12", {from: web3.eth.accounts[0]}) });
The result is the same:
MyContract.deployed().then(inst => { return inst.input.call() }); '0xc000000000000000000000000000000000000000000000000000000000000000'
I don't think it's normal.. Any ideas what I might be doing wrong?
Thanks