addressing PR 154 comments
This commit is contained in:
parent
0303f2aaaa
commit
9b561344fe
|
@ -46,7 +46,7 @@ type BaseTxPresenter struct {
|
|||
}
|
||||
|
||||
// ParseData - unmarshal raw bytes to a basecoin tx
|
||||
func (b BaseTxPresenter) ParseData(raw []byte) (interface{}, error) {
|
||||
func (BaseTxPresenter) ParseData(raw []byte) (interface{}, error) {
|
||||
var tx basecoin.Tx
|
||||
err := wire.ReadBinaryBytes(raw, &tx)
|
||||
return tx, err
|
||||
|
|
|
@ -21,7 +21,7 @@ var CounterTxCmd = &cobra.Command{
|
|||
Long: `Add a vote to the counter.
|
||||
|
||||
You must pass --valid for it to count and the countfee will be added to the counter.`,
|
||||
RunE: doCounterTx,
|
||||
RunE: counterTx,
|
||||
}
|
||||
|
||||
// nolint - flags names
|
||||
|
@ -38,9 +38,9 @@ func init() {
|
|||
fs.Int(FlagSequence, -1, "Sequence number for this transaction")
|
||||
}
|
||||
|
||||
// TODO: doCounterTx is very similar to the sendtx one,
|
||||
// TODO: counterTx is very similar to the sendtx one,
|
||||
// maybe we can pull out some common patterns?
|
||||
func doCounterTx(cmd *cobra.Command, args []string) error {
|
||||
func counterTx(cmd *cobra.Command, args []string) error {
|
||||
// load data from json or flags
|
||||
var tx basecoin.Tx
|
||||
found, err := txcmd.LoadJSON(&tx)
|
||||
|
|
|
@ -106,12 +106,12 @@ type Handler struct {
|
|||
var _ stack.Dispatchable = Handler{}
|
||||
|
||||
// Name - return counter namespace
|
||||
func (h Handler) Name() string {
|
||||
func (Handler) Name() string {
|
||||
return NameCounter
|
||||
}
|
||||
|
||||
// AssertDispatcher - placeholder to satisfy XXX
|
||||
func (h Handler) AssertDispatcher() {}
|
||||
func (Handler) AssertDispatcher() {}
|
||||
|
||||
// CheckTx checks if the tx is properly structured
|
||||
func (h Handler) CheckTx(ctx basecoin.Context, store types.KVStore, tx basecoin.Tx, _ basecoin.Checker) (res basecoin.Result, err error) {
|
||||
|
|
|
@ -30,7 +30,7 @@ func NewHandler() Handler {
|
|||
}
|
||||
|
||||
// Name - return name space
|
||||
func (h Handler) Name() string {
|
||||
func (Handler) Name() string {
|
||||
return NameCoin
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue