-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathdispute_status.go
55 lines (45 loc) · 1.25 KB
/
dispute_status.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package types
import (
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/synapsecns/sanguine/core"
)
// DisputeStatus is the dispute status interface.
type DisputeStatus interface {
// Flag is the current status flag of the dispute.
Flag() DisputeFlagType
// Rival is the address of the rival.
Rival() common.Address
// FraudProver is the address of the fraud prover for this dispute.
FraudProver() common.Address
// DisputePtr is the index of the dispute.
DisputePtr() *big.Int
}
type disputeStatus struct {
flag DisputeFlagType
rival common.Address
fraudProver common.Address
disputePtr *big.Int
}
// NewDisputeStatus creates a new dispute status.
func NewDisputeStatus(flag DisputeFlagType, rival, fraudProver common.Address, disputePtr *big.Int) DisputeStatus {
return &disputeStatus{
flag: flag,
rival: rival,
fraudProver: fraudProver,
disputePtr: disputePtr,
}
}
func (s disputeStatus) Flag() DisputeFlagType {
return s.flag
}
func (s disputeStatus) Rival() common.Address {
return s.rival
}
func (s disputeStatus) FraudProver() common.Address {
return s.fraudProver
}
func (s disputeStatus) DisputePtr() *big.Int {
return core.CopyBigInt(s.disputePtr)
}
var _ DisputeStatus = disputeStatus{}