Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez committed Mar 15, 2020
1 parent f60cd5a commit 98f62db
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions client/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type CLIContext struct {
FromAddress sdk.AccAddress
Client rpcclient.Client
ChainID string
TxGenerator clientx.TxGenerator
TxGenerator clientx.Generator
Marshaler codec.Marshaler
Keybase keys.Keybase
Input io.Reader
Expand Down Expand Up @@ -136,7 +136,7 @@ func (ctx CLIContext) WithInput(r io.Reader) CLIContext {
}

// WithTxGenerator returns a copy of the CLIContext with an updated TxGenerator.
func (ctx CLIContext) WithTxGenerator(txg clientx.TxGenerator) CLIContext {
func (ctx CLIContext) WithTxGenerator(txg clientx.Generator) CLIContext {
ctx.TxGenerator = txg
return ctx
}
Expand Down
4 changes: 2 additions & 2 deletions client/tx/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
)

type (
// TxGenerator defines an interface a client can utilize to generate an
// Generator defines an interface a client can utilize to generate an
// application-defined concrete transaction type. The type returned must
// implement ClientTx.
TxGenerator interface {
Generator interface {
NewTx() ClientTx
}

Expand Down
4 changes: 0 additions & 4 deletions codec/std/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/gov"
)

type BadEvidence struct {
*std.Evidence_Equivocation
}

func TestNewMsgSubmitEvidence(t *testing.T) {
s := sdk.AccAddress("foo")
e := evidence.Equivocation{
Expand Down
6 changes: 3 additions & 3 deletions codec/std/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
)

var (
_ sdk.Tx = (*Transaction)(nil)
_ clientx.ClientTx = (*Transaction)(nil)
_ clientx.TxGenerator = TxGenerator{}
_ sdk.Tx = (*Transaction)(nil)
_ clientx.ClientTx = (*Transaction)(nil)
_ clientx.Generator = TxGenerator{}
)

// TxGenerator defines a transaction generator that allows clients to construct
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture/adr-020-protobuf-transaction-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ to handle all the types, but also knows how to generate transactions, signatures
and messages.

```go
type TxGenerator interface {
type Generator interface {
NewTx() ClientTx
}

Expand All @@ -123,7 +123,7 @@ type ClientTx interface {
}
```

We then update `CLIContext` to have two new fields: `TxGenerator` and `TxGenerator`.
We then update `CLIContext` to have two new fields: `Generator` and `Generator`.

Then, each module will at the minimum accept a `Marshaler` instead of a concrete
Amino codec. If the module needs to work with any interface types, it will use
Expand Down

0 comments on commit 98f62db

Please sign in to comment.