-
Notifications
You must be signed in to change notification settings - Fork 5
/
query_verify_values.go
53 lines (40 loc) · 1.03 KB
/
query_verify_values.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package cli
import (
"strconv"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/echelonfoundation/echelon/v3/x/vrf/types"
)
var _ = strconv.Itoa(0)
func CmdVerifyValues() *cobra.Command {
cmd := &cobra.Command{
Use: "verify-values [pubkey] [message] [vrv] [proof]",
Short: "Query verify-values",
Args: cobra.ExactArgs(4),
RunE: func(cmd *cobra.Command, args []string) (err error) {
reqPubkey := args[0]
reqMessage := args[1]
reqVrv := args[2]
reqProof := args[3]
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)
params := &types.QueryVerifyValuesRequest{
Pubkey: reqPubkey,
Message: reqMessage,
Vrv: reqVrv,
Proof: reqProof,
}
res, err := queryClient.VerifyValues(cmd.Context(), params)
if err != nil {
return err
}
return clientCtx.PrintProto(res)
},
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
}