Skip to content

Commit

Permalink
fix the upgrade and iservice cli
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXJC committed Nov 9, 2018
1 parent 39e368b commit 8a3d7e2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions client/iservice/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func GetCmdQueryScvBind(storeName string, cdc *codec.Codec) *cobra.Command {
}

var svcBinding iservice.SvcBinding
cdc.MustUnmarshalBinary(res, &svcBinding)
cdc.MustUnmarshalBinaryLengthPrefixed(res, &svcBinding)
output, err := codec.MarshalJSONIndent(cdc, svcBinding)
fmt.Println(string(output))
return nil
Expand Down Expand Up @@ -126,7 +126,7 @@ func GetCmdQueryScvBinds(storeName string, cdc *codec.Codec) *cobra.Command {
var bindings []iservice.SvcBinding
for i := 0; i < len(res); i++ {
var binding iservice.SvcBinding
cdc.MustUnmarshalBinary(res[i].Value, &binding)
cdc.MustUnmarshalBinaryLengthPrefixed(res[i].Value, &binding)
bindings = append(bindings, binding)
}

Expand Down
2 changes: 1 addition & 1 deletion client/tendermint/tx/querytx.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ type Info struct {
func parseTx(cdc *codec.Codec, txBytes []byte) (sdk.Tx, error) {
var tx auth.StdTx

err := cdc.UnMarshalBinaryLengthPrefixed(txBytes, &tx)
err := cdc.UnmarshalBinaryLengthPrefixed(txBytes, &tx)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion client/upgrade/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func GetCmdQuerySwitch(storeName string, cdc *codec.Codec) *cobra.Command {
Short: "query switch details",
Example: "iriscli upgrade query-switch --proposalID 1 --voter <voter address>",
RunE: func(cmd *cobra.Command, args []string) error {
proposalID := viper.GetInt64(flagProposalID)
proposalID := uint64(viper.GetInt64(flagProposalID))
voterStr := viper.GetString(flagVoter)

voter, err := sdk.AccAddressFromBech32(voterStr)
Expand Down
2 changes: 1 addition & 1 deletion client/upgrade/cli/sendtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func GetCmdSubmitSwitch(cdc *codec.Codec) *cobra.Command {
Example: "iriscli upgrade submit-switch --chain-id=<chain-id> --from=<key name> --fee=0.004iris --proposalID 1 --title <title>",
RunE: func(cmd *cobra.Command, args []string) error {
title := viper.GetString(flagTitle)
proposalID := viper.GetInt64(flagProposalID)
proposalID := uint64(viper.GetInt64(flagProposalID))

cliCtx := context.NewCLIContext().
WithCodec(cdc).
Expand Down
2 changes: 2 additions & 0 deletions cmd/iriscli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ func main() {
stakecmd.GetCmdQueryDelegations("stake", cdc),
stakecmd.GetCmdQueryUnbondingDelegation("stake", cdc),
stakecmd.GetCmdQueryUnbondingDelegations("stake", cdc),
stakecmd.GetCmdQueryValidatorUnbondingDelegations("stake", cdc),
stakecmd.GetCmdQueryValidatorRedelegations("stake", cdc),
stakecmd.GetCmdQueryRedelegation("stake", cdc),
stakecmd.GetCmdQueryRedelegations("stake", cdc),
stakecmd.GetCmdQueryPool("stake", cdc),
Expand Down

0 comments on commit 8a3d7e2

Please sign in to comment.