-
Notifications
You must be signed in to change notification settings - Fork 179
/
deposits.go
39 lines (31 loc) · 998 Bytes
/
deposits.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 (
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// DefaultWithdrawPeriod defines default withdraw period
const DefaultWithdrawPeriod = time.Hour * 24 * 3
// WithdrawInfo represents infos for withdrawing
type WithdrawInfo struct {
Owner sdk.AccAddress `json:"owner"`
Deposits sdk.SysCoin `json:"deposits"`
CompleteTime time.Time `json:"complete_time"`
}
// Equal returns boolean for whether two WithdrawInfo are Equal
func (w WithdrawInfo) Equal(other WithdrawInfo) bool {
return w.Owner.Equals(other.Owner) && w.Deposits.IsEqual(other.Deposits) && w.CompleteTime.Equal(other.CompleteTime)
}
// WithdrawInfos defines list of WithdrawInfo
type WithdrawInfos []WithdrawInfo
// Equal returns boolean for whether two WithdrawInfos are Equal
func (ws WithdrawInfos) Equal(other WithdrawInfos) bool {
if len(ws) != len(other) {
return false
}
for i := 0; i < len(ws); i++ {
if !ws[i].Equal(other[i]) {
return false
}
}
return true
}