koinos / koinos-cli

A command line utility used for key management and to interact with the Koinos blockchain.
Other
9 stars 7 forks source link

[BUG]: Some contract reads result in a crash #173

Closed sgerbino closed 1 year ago

sgerbino commented 1 year ago

Is there an existing issue for this?

Current behavior

🔐 > governance.get_proposal_by_id 0x01
panic: proto: koinos.contracts.governance.get_proposal_by_id_result.value: assigning invalid zero-value message

goroutine 1 [running]:
google.golang.org/protobuf/types/dynamicpb.typecheck(...)
    /Users/sgerbino/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/koinos/protobuf-go@v1.27.2-0.20211026185306-2456c83214fe/types/dynamicpb/dynamic.go:520
google.golang.org/protobuf/types/dynamicpb.(*Message).Set(0xc00049e5c0, {0x1007753a8?, 0xc000864d20}, {{}, 0x100569a80?, 0xc00049e600?, 0x3?})
    /Users/sgerbino/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/koinos/protobuf-go@v1.27.2-0.20211026185306-2456c83214fe/types/dynamicpb/dynamic.go:267 +0x2d0
github.com/koinos/koinos-cli/internal/cli.(*ReadContractCommand).Execute(0xc000128038, {0x10076e9b0, 0xc00012c008}, 0xc0002cec40)
    /private/tmp/koinos-cli-20221205-2404-280ca4/internal/cli/contract_commands.go:261 +0x9ba
github.com/koinos/koinos-cli/internal/cli.(*ParseResults).Interpret(0xc0000120f0, 0xc000167cb0?)
    /private/tmp/koinos-cli-20221205-2404-280ca4/internal/cli/interpreter.go:394 +0xf3
github.com/koinos/koinos-cli/internal/cli.ParseAndInterpret(0x1215177fffff04?, 0xf161311191a1c03?, {0xc000167cb0?, 0x9600?})
    /private/tmp/koinos-cli-20221205-2404-280ca4/internal/cli/interpreter.go:456 +0x3d8
github.com/koinos/koinos-cli/cmd/cli/interactive.(*KoinosPrompt).executor(0x1001168ca?, {0xc000167cb0?, 0x100aa5900?})
    /private/tmp/koinos-cli-20221205-2404-280ca4/cmd/cli/interactive/interactive.go:117 +0x31
github.com/koinos/go-prompt.(*Prompt).Run(0xc0000aba70)
    /Users/sgerbino/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/koinos/go-prompt@v0.0.0-20221201222302-dba4c3542a91/prompt.go:84 +0x755
github.com/koinos/koinos-cli/cmd/cli/interactive.(*KoinosPrompt).Run(0xc0000015e0)
    /private/tmp/koinos-cli-20221205-2404-280ca4/cmd/cli/interactive/interactive.go:125 +0xb4
main.main()
    /private/tmp/koinos-cli-20221205-2404-280ca4/cmd/cli/main.go:117 +0x5ea

Expected behavior

None of these calls should result in a panic.

Steps to reproduce

No response

Environment

- OS:

Anything else?

No response