My smart contract has a function like this
function setTest(uint256 test) returns (bool){
testNumber = test;
return true;
}
I used these piece of code Go to create a transaction to set new value to testNumber
- a RPC call
var newtest uint256 = 100 // I expected this type (uint256)
abis, err := abi.JSON(strings.NewReader(contractInterface))
output, err := abis.Pack("setTest", newtest)
params := make(map[string]string)
params["data"] = fmt.Sprintf("0x%s", common.Bytes2Hex(output))
params["from"] = self.ownerAccount
params["to"] = self.contractAccount
done := ""
err = self.client.Call(&done, "eth_sendTransaction", params)
.....
And the problem is I can't set newtest as type uint256. I can't find type uint256 in Go. Please help me, generate number type uint256 or convert from (big.Int, int64, uint64) to uint256. Thank you