From eaef7b3d80462393a411d29b65154519a301bd58 Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 9 Jan 2023 18:43:42 +0100 Subject: [PATCH] fix: don't load program from filesystem --- x/logic/client/cli/query_ask.go | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/x/logic/client/cli/query_ask.go b/x/logic/client/cli/query_ask.go index c83c6625..d87db4fb 100644 --- a/x/logic/client/cli/query_ask.go +++ b/x/logic/client/cli/query_ask.go @@ -3,8 +3,6 @@ package cli import ( "context" "fmt" - "io" - "os" "strings" "github.com/cosmos/cosmos-sdk/client" @@ -36,11 +34,7 @@ $ %s %s query ask "immortal(X)." program.txt clientCtx := client.GetClientContextFromCmd(cmd) query := args[0] - program, err := ReadProgramFromFile(args[1]) - - if err != nil { - return err - } + program := args[1] queryClient := types.NewQueryServiceClient(clientCtx) @@ -60,21 +54,3 @@ $ %s %s query ask "immortal(X)." program.txt return cmd } - -// ReadProgramFromFile read text from the given filename. Can pass "-" to read from stdin. -func ReadProgramFromFile(filename string) (v string, err error) { - var bytes []byte - - if filename == "-" { - bytes, err = io.ReadAll(os.Stdin) - } else { - bytes, err = os.ReadFile(filename) - } - - if err != nil { - return - } - - v = string(bytes) - return -}