github.com/Finschia/finschia-sdk@v0.48.1/x/evidence/exported/evidence.go (about)

     1  package exported
     2  
     3  import (
     4  	ostbytes "github.com/Finschia/ostracon/libs/bytes"
     5  	"github.com/gogo/protobuf/proto"
     6  
     7  	sdk "github.com/Finschia/finschia-sdk/types"
     8  )
     9  
    10  // Evidence defines the contract which concrete evidence types of misbehavior
    11  // must implement.
    12  type Evidence interface {
    13  	proto.Message
    14  
    15  	Route() string
    16  	Type() string
    17  	String() string
    18  	Hash() ostbytes.HexBytes
    19  	ValidateBasic() error
    20  
    21  	// Height at which the infraction occurred
    22  	GetHeight() int64
    23  }
    24  
    25  // ValidatorEvidence extends Evidence interface to define contract
    26  // for evidence against malicious validators
    27  type ValidatorEvidence interface {
    28  	Evidence
    29  
    30  	// The consensus address of the malicious validator at time of infraction
    31  	GetConsensusAddress() sdk.ConsAddress
    32  
    33  	// The total power of the malicious validator at time of infraction
    34  	GetValidatorPower() int64
    35  
    36  	// The total validator set power at time of infraction
    37  	GetTotalPower() int64
    38  }
    39  
    40  // MsgSubmitEvidenceI defines the specific interface a concrete message must
    41  // implement in order to process submitted evidence. The concrete MsgSubmitEvidence
    42  // must be defined at the application-level.
    43  type MsgSubmitEvidenceI interface {
    44  	sdk.Msg
    45  
    46  	GetEvidence() Evidence
    47  	GetSubmitter() sdk.AccAddress
    48  }