Documentation
¶
Index ¶
- Constants
- func LoadABI() (abi.ABI, error)
- func NewMsgSubmitEvidence(origin common.Address, args []interface{}) (*evidencetypes.MsgSubmitEvidence, error)
- type AllEvidenceOutput
- type EquivocationData
- type EventSubmitEvidence
- type Precompile
- func (p Precompile) EmitSubmitEvidenceEvent(ctx sdk.Context, stateDB vm.StateDB, origin common.Address, ...) error
- func (p *Precompile) Evidence(ctx sdk.Context, method *abi.Method, args []interface{}) ([]byte, error)
- func (p *Precompile) GetAllEvidence(ctx sdk.Context, method *abi.Method, args []interface{}) ([]byte, error)
- func (Precompile) IsTransaction(method *abi.Method) bool
- func (p Precompile) Logger(ctx sdk.Context) log.Logger
- func (p Precompile) RequiredGas(input []byte) uint64
- func (p Precompile) Run(evm *vm.EVM, contract *vm.Contract, readOnly bool) (bz []byte, err error)
- func (p Precompile) SubmitEvidence(ctx sdk.Context, origin common.Address, _ *vm.Contract, stateDB vm.StateDB, ...) ([]byte, error)
- type SingleEvidenceOutput
Constants ¶
const ( // ErrInvalidEvidenceHash is raised when the evidence hash is invalid. ErrInvalidEvidenceHash = "invalid request; hash is empty" // ErrExpectedEquivocation is raised when the evidence is not an Equivocation. ErrExpectedEquivocation = "invalid evidence type: expected Equivocation" )
const ( // SubmitEvidenceMethod defines the ABI method name for the evidence SubmitEvidence // transaction. SubmitEvidenceMethod = "submitEvidence" // EvidenceMethod defines the ABI method name for the Evidence query. EvidenceMethod = "evidence" // GetAllEvidenceMethod defines the ABI method name for the GetAllEvidence query. GetAllEvidenceMethod = "getAllEvidence" )
const (
// EventTypeSubmitEvidence defines the event type for the evidence SubmitEvidence transaction.
EventTypeSubmitEvidence = "SubmitEvidence"
)
Variables ¶
This section is empty.
Functions ¶
func LoadABI ¶
LoadABI loads the evidence ABI from the embedded abi.json file for the evidence precompile.
func NewMsgSubmitEvidence ¶
func NewMsgSubmitEvidence(origin common.Address, args []interface{}) (*evidencetypes.MsgSubmitEvidence, error)
NewMsgSubmitEvidence creates a new MsgSubmitEvidence instance.
Types ¶
type AllEvidenceOutput ¶
type AllEvidenceOutput struct {
Evidence []EquivocationData
PageResponse query.PageResponse
}
AllEvidenceOutput defines the output for the GetAllEvidence query.
type EquivocationData ¶
type EquivocationData struct {
Height int64 `abi:"height"`
Time uint64 `abi:"time"`
Power int64 `abi:"power"`
ConsensusAddress string `abi:"consensusAddress"`
}
EquivocationData represents the Solidity Equivocation struct
func (EquivocationData) ToEquivocation ¶
func (e EquivocationData) ToEquivocation() *evidencetypes.Equivocation
ToEquivocation converts the EquivocationData to a types.Equivocation
type EventSubmitEvidence ¶
EventSubmitEvidence defines the event data for the SubmitEvidence transaction.
type Precompile ¶
type Precompile struct {
cmn.Precompile
// contains filtered or unexported fields
}
Precompile defines the precompiled contract for evidence.
func NewPrecompile ¶
func NewPrecompile( evidenceKeeper evidencekeeper.Keeper, authzKeeper authzkeeper.Keeper, ) (*Precompile, error)
NewPrecompile creates a new evidence Precompile instance as a PrecompiledContract interface.
func (Precompile) EmitSubmitEvidenceEvent ¶
func (p Precompile) EmitSubmitEvidenceEvent(ctx sdk.Context, stateDB vm.StateDB, origin common.Address, evidenceHash []byte) error
EmitSubmitEvidenceEvent creates a new event emitted on a SubmitEvidence transaction.
func (*Precompile) Evidence ¶
func (p *Precompile) Evidence( ctx sdk.Context, method *abi.Method, args []interface{}, ) ([]byte, error)
Evidence implements the query logic for getting evidence by hash.
func (*Precompile) GetAllEvidence ¶
func (p *Precompile) GetAllEvidence( ctx sdk.Context, method *abi.Method, args []interface{}, ) ([]byte, error)
GetAllEvidence implements the query logic for getting all evidence.
func (Precompile) IsTransaction ¶
func (Precompile) IsTransaction(method *abi.Method) bool
IsTransaction checks if the given method name corresponds to a transaction or query.
Available evidence transactions are: - SubmitEvidence
func (Precompile) Logger ¶
func (p Precompile) Logger(ctx sdk.Context) log.Logger
Logger returns a precompile-specific logger.
func (Precompile) RequiredGas ¶
func (p Precompile) RequiredGas(input []byte) uint64
RequiredGas calculates the precompiled contract's base gas rate.
type SingleEvidenceOutput ¶
type SingleEvidenceOutput struct {
Evidence EquivocationData
}
SingleEvidenceOutput defines the output for the Evidence query.