Require proto.Message in client.Context.PrintOutput (#6999)

* Enable proto JSON json for cli tx & query

* WIP on tests

* Test fixes, cleanup

* Cleanup

* Address review comments

* Update client/context.go

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>

* Fixes

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
This commit is contained in:
Aaron Craelius
2020-08-11 03:19:49 -04:00
committed by GitHub
co-authored by Anil Kumar Kammari Federico Kunze
parent 20c80cfd44
commit 7de8ef75b3
19 changed files with 95 additions and 99 deletions
+13 -10
View File
@@ -82,7 +82,7 @@ $ %s query gov proposal 1
return err
}
return clientCtx.PrintOutput(res.GetProposal())
return clientCtx.PrintOutput(&res.Proposal)
},
}
@@ -237,7 +237,7 @@ $ %s query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
}
}
return clientCtx.PrintOutput(res.GetVote())
return clientCtx.PrintOutput(&res.Vote)
},
}
@@ -298,7 +298,7 @@ $ %[1]s query gov votes 1 --page=2 --limit=100
var votes types.Votes
clientCtx.JSONMarshaler.MustUnmarshalJSON(resByTxQuery, &votes)
return clientCtx.PrintOutput(votes)
return clientCtx.PrintOutputLegacy(votes)
}
@@ -389,7 +389,7 @@ $ %s query gov deposit 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
clientCtx.JSONMarshaler.MustUnmarshalJSON(resByTxQuery, &deposit)
}
return clientCtx.PrintOutput(deposit)
return clientCtx.PrintOutput(&deposit)
},
}
@@ -447,7 +447,8 @@ $ %s query gov deposits 1
var dep types.Deposits
clientCtx.JSONMarshaler.MustUnmarshalJSON(resByTxQuery, &dep)
return clientCtx.PrintOutput(dep)
return clientCtx.PrintOutputLegacy(dep)
}
pageReq, err := client.ReadPageRequest(cmd.Flags())
@@ -522,7 +523,7 @@ $ %s query gov tally 1
return err
}
return clientCtx.PrintOutput(res.GetTally())
return clientCtx.PrintOutput(&res.Tally)
},
}
@@ -579,11 +580,13 @@ $ %s query gov params
return err
}
return clientCtx.PrintOutput(types.NewParams(
params := types.NewParams(
votingRes.GetVotingParams(),
tallyRes.GetTallyParams(),
depositRes.GetDepositParams(),
))
)
return clientCtx.PrintOutputLegacy(params)
},
}
@@ -638,7 +641,7 @@ $ %s query gov param deposit
return fmt.Errorf("argument must be one of (voting|tallying|deposit), was %s", args[0])
}
return clientCtx.PrintOutput(out)
return clientCtx.PrintOutputLegacy(out)
},
}
@@ -680,7 +683,7 @@ $ %s query gov proposer 1
return err
}
return clientCtx.PrintOutput(prop)
return clientCtx.PrintOutputLegacy(prop)
},
}