You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Geth version: 1.7.0-stable
OS & Version: Linux Mint 18.2 x64
Commit hash : N/A
Go Version: go version go1.9 linux/amd64
Expected behaviour
When I run the latest version of abigen on a contract I expect the output go code to work with the latest version of go-ethereum. My contract uses bytes32 as the type for IDs of objects. In one struct I have a list of IDs and use bytes32[] to hold that list. Abigen properly outputs it to the go type [][32]byte. I expect that when I use the generated code to call my contract, that the proper types are returned from the call without error.
Actual behaviour
When I call in to the generated code, I receive an error stating abi: cannot unmarshal [][]uint8 in to [][32]uint8. If I modify the generated go code so that it's just [][]byte instead of [][32]byte then the function call works as expected.
Steps to reproduce the behaviour
Contract Test.sol:
pragma solidity ^0.4.15;
contract Test {
function testDynamicFixedBytes() constant returns (bytes32[]) {
var array = new bytes32[](2);
array[0] = "0x1234567890";
array[1] = "0x0987654321";
return array;
}
}
System information
Geth version: 1.7.0-stable
OS & Version: Linux Mint 18.2 x64
Commit hash : N/A
Go Version: go version go1.9 linux/amd64
Expected behaviour
When I run the latest version of abigen on a contract I expect the output go code to work with the latest version of go-ethereum. My contract uses
bytes32
as the type for IDs of objects. In one struct I have a list of IDs and usebytes32[]
to hold that list. Abigen properly outputs it to the go type[][32]byte
. I expect that when I use the generated code to call my contract, that the proper types are returned from the call without error.Actual behaviour
When I call in to the generated code, I receive an error stating
abi: cannot unmarshal [][]uint8 in to [][32]uint8
. If I modify the generated go code so that it's just[][]byte
instead of[][32]byte
then the function call works as expected.Steps to reproduce the behaviour
Contract Test.sol:
Run
abigen -pkg main -sol Test.sol -out Test.go
Go:
Backtrace
The line that's generating the error is in go-ethereum/accounts/abi/reflect.go at line 90.
The text was updated successfully, but these errors were encountered: