Skip to content

Commit

Permalink
deprecated(api)!: (06-solomachine) [#2761] removed deprecated `Client…
Browse files Browse the repository at this point in the history
…Id` field from `Misbehaviour` and `allow_update_after_proposal` field from `ClientState`
  • Loading branch information
chatton authored Nov 17, 2022
1 parent 25e6ae5 commit 876b73a
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 165 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (modules/apps/27-interchain-accounts) [\#2433](https://github.com/cosmos/ibc-go/pull/2450) Renamed icatypes.PortPrefix to icatypes.ControllerPortPrefix & icatypes.PortID to icatypes.HostPortID
* (core/02-client) [\#2573](https://github.com/cosmos/ibc-go/pull/2573) Renames `ClientParams` gRPC query method to `Params`.
* (testing) [\#2567](https://github.com/cosmos/ibc-go/pull/2567) Modify `SendPacket` API of `Endpoint` to match the API of `SendPacket` in 04-channel.
* (06-solomachine) [\#2761](https://github.com/cosmos/ibc-go/pull/2761) Removed deprecated `ClientId` field from `Misbehaviour` and `allow_update_after_proposal` field from `ClientState`.

### State Machine Breaking

Expand Down
5 changes: 0 additions & 5 deletions modules/light-clients/06-solomachine/misbehaviour.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
host "github.com/cosmos/ibc-go/v6/modules/core/24-host"
"github.com/cosmos/ibc-go/v6/modules/core/exported"
)

Expand All @@ -24,10 +23,6 @@ func (misbehaviour Misbehaviour) Type() string {

// ValidateBasic implements Misbehaviour interface.
func (misbehaviour Misbehaviour) ValidateBasic() error {
if err := host.ClientIdentifierValidator(misbehaviour.ClientId); err != nil {
return sdkerrors.Wrap(err, "invalid client identifier for solo machine")
}

if misbehaviour.Sequence == 0 {
return sdkerrors.Wrap(clienttypes.ErrInvalidMisbehaviour, "sequence cannot be 0")
}
Expand Down
7 changes: 0 additions & 7 deletions modules/light-clients/06-solomachine/misbehaviour_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ func (suite *SoloMachineTestSuite) TestMisbehaviourValidateBasic() {
func(*solomachine.Misbehaviour) {},
true,
},
{
"invalid client ID",
func(misbehaviour *solomachine.Misbehaviour) {
misbehaviour.ClientId = "(badclientid)"
},
false,
},
{
"sequence is zero",
func(misbehaviour *solomachine.Misbehaviour) {
Expand Down
5 changes: 0 additions & 5 deletions modules/light-clients/06-solomachine/proposal_handle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ func (suite *SoloMachineTestSuite) TestCheckSubstituteAndUpdateState() {
malleate func()
expPass bool
}{
{
"valid substitute", func() {
subjectClientState.AllowUpdateAfterProposal = true
}, true,
},
{
"substitute is not the solo machine", func() {
substituteClientState = &ibctm.ClientState{}
Expand Down
193 changes: 54 additions & 139 deletions modules/light-clients/06-solomachine/solomachine.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions proto/ibc/lightclients/solomachine/v3/solomachine.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ message ClientState {
// frozen sequence of the solo machine
bool is_frozen = 2 [(gogoproto.moretags) = "yaml:\"is_frozen\""];
ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
// when set to true, will allow governance to update a solo machine client.
// The client will be unfrozen if it is frozen.
bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""];
}

// ConsensusState defines a solo machine consensus state. The sequence of a
Expand Down Expand Up @@ -51,11 +48,9 @@ message Header {
message Misbehaviour {
option (gogoproto.goproto_getters) = false;

// ClientID is deprecated
string client_id = 1 [deprecated = true, (gogoproto.moretags) = "yaml:\"client_id\""];
uint64 sequence = 2;
SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""];
SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""];
uint64 sequence = 1;
SignatureAndData signature_one = 2 [(gogoproto.moretags) = "yaml:\"signature_one\""];
SignatureAndData signature_two = 3 [(gogoproto.moretags) = "yaml:\"signature_two\""];
}

// SignatureAndData contains a signature and the data signed over to create that
Expand Down
1 change: 0 additions & 1 deletion testing/solomachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ func (solo *Solomachine) CreateMisbehaviour() *solomachine.Misbehaviour {
}

return &solomachine.Misbehaviour{
ClientId: solo.ClientID,
Sequence: solo.Sequence,
SignatureOne: &signatureOne,
SignatureTwo: &signatureTwo,
Expand Down

0 comments on commit 876b73a

Please sign in to comment.