diff --git a/CHANGELOG.md b/CHANGELOG.md index c9f4c8b5699a..4deab667863c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (x/evidence) [#14757](https://github.com/cosmos/cosmos-sdk/pull/14757) Evidence messages do not need to implement a `.Type()` anymore. * (x/auth/tx) [#14751](https://github.com/cosmos/cosmos-sdk/pull/14751) Remove `.Type()` and `Route()` methods from all msgs and `legacytx.LegacyMsg` interface. * [#14691](https://github.com/cosmos/cosmos-sdk/pull/14691) Change behavior of `sdk.StringifyEvents` to not flatten events attributes by events type. * This change only affects ABCI message logs, and not the actual events. diff --git a/x/evidence/README.md b/x/evidence/README.md index 50d29e1619a3..70bdffc8400f 100644 --- a/x/evidence/README.md +++ b/x/evidence/README.md @@ -53,7 +53,6 @@ type Evidence interface { proto.Message Route() string - Type() string String() string Hash() tmbytes.HexBytes ValidateBasic() error diff --git a/x/evidence/exported/evidence.go b/x/evidence/exported/evidence.go index 6cad9a9d7093..f38c39268a14 100644 --- a/x/evidence/exported/evidence.go +++ b/x/evidence/exported/evidence.go @@ -13,7 +13,6 @@ type Evidence interface { proto.Message Route() string - Type() string String() string Hash() tmbytes.HexBytes ValidateBasic() error diff --git a/x/evidence/types/evidence.go b/x/evidence/types/evidence.go index 89a4e742e70d..8c605e305b59 100644 --- a/x/evidence/types/evidence.go +++ b/x/evidence/types/evidence.go @@ -13,19 +13,13 @@ import ( ) // Evidence type constants -const ( - RouteEquivocation = "equivocation" - TypeEquivocation = "equivocation" -) +const RouteEquivocation = "equivocation" var _ exported.Evidence = &Equivocation{} // Route returns the Evidence Handler route for an Equivocation type. func (e *Equivocation) Route() string { return RouteEquivocation } -// Type returns the Evidence Handler type for an Equivocation type. -func (e *Equivocation) Type() string { return TypeEquivocation } - // Hash returns the hash of an Equivocation object. func (e *Equivocation) Hash() tmbytes.HexBytes { bz, err := e.Marshal() diff --git a/x/evidence/types/evidence_test.go b/x/evidence/types/evidence_test.go index c80d9417f59c..2ce7985d8d3e 100644 --- a/x/evidence/types/evidence_test.go +++ b/x/evidence/types/evidence_test.go @@ -27,7 +27,6 @@ func TestEquivocation_Valid(t *testing.T) { require.Equal(t, e.GetTime(), e.Time) require.Equal(t, e.GetConsensusAddress().String(), e.ConsensusAddress) require.Equal(t, e.GetHeight(), e.Height) - require.Equal(t, e.Type(), types.TypeEquivocation) require.Equal(t, e.Route(), types.RouteEquivocation) require.Equal(t, e.Hash().String(), "1E10F9267BEA3A9A4AB5302C2C510CC1AFD7C54E232DA5B2E3360DFAFACF7A76") require.Equal(t, "height:100 time: power:1000000 consensus_address:\"cosmosvalcons1vehk7h6lta047h6lta047h6lta047h6l8m4r53\" ", e.String()) @@ -38,7 +37,6 @@ func TestEquivocation_Valid(t *testing.T) { require.Equal(t, e.Time, e.GetTime()) require.Equal(t, e.ConsensusAddress, e.GetConsensusAddress().String()) require.Equal(t, e.Height, e.GetHeight()) - require.Equal(t, types.TypeEquivocation, e.Type()) require.Equal(t, types.RouteEquivocation, e.Route()) require.Equal(t, "1E10F9267BEA3A9A4AB5302C2C510CC1AFD7C54E232DA5B2E3360DFAFACF7A76", e.Hash().String()) require.Equal(t, "height:100 time: power:1000000 consensus_address:\"cosmosvalcons1vehk7h6lta047h6lta047h6lta047h6l8m4r53\" ", e.String()) diff --git a/x/evidence/types/genesis_test.go b/x/evidence/types/genesis_test.go index 425aceb8b909..36b4e42e672d 100644 --- a/x/evidence/types/genesis_test.go +++ b/x/evidence/types/genesis_test.go @@ -168,10 +168,6 @@ func (*TestEvidence) Route() string { return "test-route" } -func (*TestEvidence) Type() string { - return "test-type" -} - func (*TestEvidence) ProtoMessage() {} func (*TestEvidence) Reset() {}