-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
If a contract has a function that has repeated fields in the argument struct, parsing fails.
Expected behavior
There should be an elegant way for the CLI to interact with contracts utilizing this structure.
Steps to reproduce
🔓 > register koindx 17e1q6Fh5RgnuA8K7v4KvXXH4k9qHgsT5s
Contract 'koindx' at address 17e1q6Fh5RgnuA8K7v4KvXXH4k9qHgsT5s registered
🔓 > koindx.swap_tokens_in 1NqLghiFRwkXZR7NBFHHiCJkF5gLHyJap1 1NqLghiFRwkXZR7NBFHHiCJkF5gLHyJap1 100000000 100000000 koin vhp
panic: proto: periphery.swap_tokens_in_arguments.path: assigning invalid type string
goroutine 1 [running]:
google.golang.org/protobuf/types/dynamicpb.typecheck(...)
/home/michael/go/pkg/mod/github.com/koinos/[email protected]/types/dynamicpb/dynamic.go:520
google.golang.org/protobuf/types/dynamicpb.(*Message).Set(0xc000626400, {0xb6b430?, 0xc000e0f2c0}, {{}, 0x8bfa60?, 0xc0005c5e68?, 0x0?})
/home/michael/go/pkg/mod/github.com/koinos/[email protected]/types/dynamicpb/dynamic.go:267 +0x2d6
github.com/koinos/koinos-cli/internal/cli.dataToMessage(0x0?, {0xb69520?, 0xc0002120d0}, {0x0, 0x0})
/home/michael/dev/koinos-cli/internal/cli/abi.go:412 +0x11b
github.com/koinos/koinos-cli/internal/cli.DataToMessage(...)
/home/michael/dev/koinos-cli/internal/cli/abi.go:301
github.com/koinos/koinos-cli/internal/cli.ParseResultToMessage(0xc000712090, 0xc00002a3f0?)
/home/michael/dev/koinos-cli/internal/cli/abi.go:425 +0x54
github.com/koinos/koinos-cli/internal/cli.(*WriteContractCommand).Execute(0xc00011e018, {0xb64050, 0xf006a0}, 0xc0002d8d20)
/home/michael/dev/koinos-cli/internal/cli/contract_commands.go:327 +0x11c
github.com/koinos/koinos-cli/internal/cli.(*ParseResults).Interpret(0xc000012498, 0xc000b70d80?)
/home/michael/dev/koinos-cli/internal/cli/interpreter.go:471 +0xd9
github.com/koinos/koinos-cli/internal/cli.ParseAndInterpret(0x4bf00000005?, 0x7f1c030000008a3b?, {0xc000b70d80?, 0xff16170f12ff?})
/home/michael/dev/koinos-cli/internal/cli/interpreter.go:536 +0x38c
github.com/koinos/koinos-cli/cmd/cli/interactive.(*KoinosPrompt).executor(0x529385?, {0xc000b70d80?, 0xe8da00?})
/home/michael/dev/koinos-cli/cmd/cli/interactive/interactive.go:117 +0x2b
github.com/koinos/go-prompt.(*Prompt).Run(0xc0003473b0)
/home/michael/go/pkg/mod/github.com/koinos/[email protected]/prompt.go:84 +0x73f
github.com/koinos/koinos-cli/cmd/cli/interactive.(*KoinosPrompt).Run(0xc0002d5040)
/home/michael/dev/koinos-cli/cmd/cli/interactive/interactive.go:125 +0xb3
main.main()
/home/michael/dev/koinos-cli/cmd/cli/main.go:117 +0x713
Environment
No response
Anything else?
Perhaps using [ or { we can denote an array or sub-object to the CLI parser so that the command works as:
🔓 > koindx.swap_tokens_in 1NqLghiFRwkXZR7NBFHHiCJkF5gLHyJap1 1NqLghiFRwkXZR7NBFHHiCJkF5gLHyJap1 100000000 100000000 [koin vhp]
or
🔓 > koindx.swap_tokens_in 1NqLghiFRwkXZR7NBFHHiCJkF5gLHyJap1 1NqLghiFRwkXZR7NBFHHiCJkF5gLHyJap1 100000000 100000000 [koin, vhp]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working