Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contract binding generator: Wrong handling of multiple return values #111

Open
lukasz-zimnoch opened this issue Dec 20, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@lukasz-zimnoch
Copy link
Member

During the work on keep-network/keep-core#3427, we noticed a problem with a generated contract binding that maps the WalletRegistry contract. That contract defines the following function:

function isDkgResultValid(DKG.Result calldata result) external view returns (bool, string memory)

which is covered by the WalletRegistry.go binding as:

func (wr *WalletRegistry) IsDkgResultValid(
    arg_result abi.EcdsaDkgResult,
) (isDkgResultValid, error) {
    ...
}

type isDkgResultValid struct {
	bool
	string
}

The isDkgResultValid is package-private and contains anonymous fields that can't be accessed outside. The only possible workaround is by using Go's reflection. This should be improved by making the returned values accessible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant