Skip to content

Commit

Permalink
wip: msg handler
Browse files Browse the repository at this point in the history
  • Loading branch information
lesterli committed Dec 6, 2024
1 parent 4898d8d commit 6682eec
Show file tree
Hide file tree
Showing 3 changed files with 460 additions and 50 deletions.
16 changes: 16 additions & 0 deletions proto/babylon/finality/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import "tendermint/crypto/proof.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "babylon/finality/v1/params.proto";
import "babylon/finality/v1/finality.proto";

// Msg defines the Msg service.
service Msg {
Expand All @@ -23,6 +24,9 @@ service Msg {
// UnjailFinalityProvider defines a method for unjailing a jailed
// finality provider, thus it can receive voting power
rpc UnjailFinalityProvider(MsgUnjailFinalityProvider) returns (MsgUnjailFinalityProviderResponse);
// EquivocationEvidence handles the evidence of equivocation message sent from
// the finality gadget cw contract
rpc EquivocationEvidence(MsgEquivocationEvidence) returns (MsgEquivocationEvidenceResponse);
}

// MsgCommitPubRandList defines a message for committing a list of public randomness for EOTS
Expand Down Expand Up @@ -103,3 +107,15 @@ message MsgUnjailFinalityProvider {

// MsgUnjailFinalityProviderResponse defines the Msg/UnjailFinalityProvider response type
message MsgUnjailFinalityProviderResponse {}

// MsgEquivocationEvidence is the message for handling evidence of equivocation
message MsgEquivocationEvidence {
// evidence is the evidence of equivocation
Evidence evidence = 1;
}

// MsgEquivocationEvidenceResponse is the response for MsgEquivocationEvidence
message MsgEquivocationEvidenceResponse {
// success is true if the slashing was successfully applied
bool success = 1;
}
6 changes: 6 additions & 0 deletions x/finality/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,9 @@ func (ms msgServer) validateActivationHeight(ctx sdk.Context, height uint64) (ui
}
return activationHeight, nil
}

// EquivocationEvidence handles the evidence of equivocation message sent from the finality gadget cw contract
func (ms msgServer) EquivocationEvidence(goCtx context.Context, req *types.MsgEquivocationEvidence) (*types.MsgEquivocationEvidenceResponse, error) {
// TODO: implement this
return &types.MsgEquivocationEvidenceResponse{Success: true}, nil
}
Loading

0 comments on commit 6682eec

Please sign in to comment.