/
claims.go
39 lines (30 loc) · 1.57 KB
/
claims.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// Claim represents a claim on ethereum state
type Claim interface {
// All Ethereum claims that we relay from the Gravity contract and into the module
// have a nonce that is monotonically increasing and unique, since this nonce is
// issued by the Ethereum contract it is immutable and must be agreed on by all validators
// any disagreement on what claim goes to what nonce means someone is lying.
GetEventNonce() uint64
GetChainId() string
GetContract() string
// The block height that the claimed event occurred on. This EventNonce provides sufficient
// ordering for the execution of all claims. The block height is used only for batchTimeouts + logicTimeouts
// when we go to create a new batch we set the timeout some number of batches out from the last
// known height plus projected block progress since then.
GetBlockHeight() uint64
// the delegate address of the claimer, for MsgDepositClaim and MsgWithdrawClaim
// this is sent in as the sdk.AccAddress of the delegated key. it is up to the user
// to disambiguate this into a sdk.ValAddress
GetClaimer() sdk.AccAddress
// Which type of claim this is
GetType() ClaimType
ValidateBasic() error
// The claim hash of this claim. This is used to store these claims and also used to check if two different
// validators claims agree. Therefore it's extremely important that this include all elements of the claim
// with the exception of the orchestrator who sent it in, which will be used as a different part of the index
ClaimHash() ([]byte, error)
}