I had a working Solidity contract, made a change to its function signature (to take in an array of addresses, instead of a single address), I compiled it, ran abigen and generated Go bindings. Below is the code that calls that contract:
gethClient, err := ethclient.Dial(gethRPCURL)
if err != nil {
log.Fatalf("failed to connect to the Ethereum client: %v", err)
}
contractBinding, err := NewMyContract(common.HexToAddress(contractAddress), gethClient)
if err != nil {
log.Fatalf("failed to instantiate contract: %v", err)
}
var addrList := make([]common.Address, 0)
_, methodErr := contractBinding.MyMethod(addrList);
if methodErr != nil {
log.Fatalf("my contract encountered error during MyMethod: %s", methodErr)
}
I've looked on Github and found this issue, which suggests its a type issue, I've looked on Gitter and found a suggestion about the chain not being in sync, which doesn't make intuitive sense to me. Has anyone ran into this issue before or able to provide some insight on it?
abi.Unpack
, which is called here in the contract call github.com/ethereum/go-ethereum/blob/… in my specific case, I'm polling Geth for the contract code before binding (to ensure it exists)... going to look into this more, thanks for the insight