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

AtomicTransactionComposer fails to add an address (or byte[32]) argument #302

Closed
shaih opened this issue Mar 22, 2022 · 2 comments · Fixed by #303
Closed

AtomicTransactionComposer fails to add an address (or byte[32]) argument #302

shaih opened this issue Mar 22, 2022 · 2 comments · Fixed by #303

Comments

@shaih
Copy link

shaih commented Mar 22, 2022

Subject of the issue

When trying to use AtomicTransactionComposer to prepare an application call with argument of type address or byte[32], it panics with error message panic: reflect: call of reflect.Value.IsNil on array Value when calling comp.AddMethodCall(mcp).

Your environment

WSL on Windows 10, Ubuntu 20.04

% algod -v
12885164034
3.4.2.stable [rel/stable] (commit #54c3c397)
go-algorand is licensed with AGPLv3.0
source code available at https://github.com/algorand/go-algorand

% goal node status
Last committed block: 18662936
Time since last block: 0.0s
Sync Time: 11594.5s
Last consensus protocol: https://github.com/algorandfoundation/specs/tree/bc36005dbd776e6d1eaf0c560619bb183215645c
Next consensus protocol: https://github.com/algorandfoundation/specs/tree/bc36005dbd776e6d1eaf0c560619bb183215645c
Round for next consensus protocol: 18662937
Next consensus protocol supported: true
Last Catchpoint:
Genesis ID: testnet-v1.0
Genesis hash: SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=

% uname -a
Linux X1Y-SHAI 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Steps to reproduce

See enclosed Go program (attached as a txt file)

Expected behaviour

Exits successfully

Actual behaviour

panic: reflect: call of reflect.Value.IsNil on array Value

goroutine 1 [running]:
reflect.Value.IsNil(...)
        /usr/lib/go-1.16/src/reflect/value.go:1086
github.com/algorand/go-algorand/data/abi.inferToSlice(0x75d3a0, 0xc0000c60e0, 0x30, 0x8, 0x30, 0xc000090780, 0xc0000aa410)
        /mnt/c/Users/shai/go/pkg/mod/github.com/algorand/[email protected]/data/abi/abi_encode.go:187 +0x43a
github.com/algorand/go-algorand/data/abi.encodeTuple(0x75d3a0, 0xc0000c60e0, 0xc0000fc000, 0x20, 0x20, 0x7bdd80, 0xc0000aa701, 0x100c0000aa660, 0x7f52cab42958, 0x4e8)
        /mnt/c/Users/shai/go/pkg/mod/github.com/algorand/[email protected]/data/abi/abi_encode.go:205 +0x6a
github.com/algorand/go-algorand/data/abi.Type.Encode(0x8, 0xc0000fc000, 0x20, 0x20, 0x2000000000, 0x75d3a0, 0xc0000c60e0, 0x0, 0x8, 0xc0000fc000, ...)
        /mnt/c/Users/shai/go/pkg/mod/github.com/algorand/[email protected]/data/abi/abi_encode.go:130 +0xcce
github.com/algorand/go-algorand/data/abi.Type.Encode(0x4, 0xc0000907b0, 0x1, 0x1, 0x2000000000, 0x75d3a0, 0xc0000c60e0, 0x0, 0x0, 0xc0000ab1d0, ...)
        /mnt/c/Users/shai/go/pkg/mod/github.com/algorand/[email protected]/data/abi/abi_encode.go:93 +0x836
github.com/algorand/go-algorand-sdk/future.(*AtomicTransactionComposer).AddMethodCall(0xc0000adca0, 0x9fbf1, 0xc000096430, 0x5, 0x0, 0x0, 0xc0000ec000, 0x1, 0x4, 0xc000096440, ...)
        /mnt/c/Users/shai/go/pkg/mod/github.com/algorand/[email protected]/future/atomicTransactionComposer.go:344 +0xc85
main.main()
        /mnt/c/Users/shai/go/src/github.com/algorandfoundation/go-playground/main.go:52 +0x37d
exit status 2

main.go.txt

@shaih
Copy link
Author

shaih commented Mar 23, 2022

It seems like the same issue affects all fixed-size arrays, any argument of type someType[N] triggers this error

@jasonpaulos
Copy link
Contributor

Thanks for reporting this, we're working on a fix now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants