-
Notifications
You must be signed in to change notification settings - Fork 206
/
types.go
30 lines (27 loc) · 1.06 KB
/
types.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
package types
const TokenDenom = "ulava"
const (
NewEpochEventName = "new_epoch"
EarliestEpochEventName = "earliest_epoch"
FixatedParamChangeEventName = "fixated_params_change"
FixatedParamCleanedEventName = "fixated_params_clean"
)
// returns a deep copy of the stake storage with the same index
func (stksto StakeStorage) Copy() (returnedStorage StakeStorage) {
returnedStorage = StakeStorage{Index: stksto.Index, StakeEntries: []StakeEntry{}, EpochBlockHash: stksto.EpochBlockHash}
for _, stakeEntry := range stksto.StakeEntries {
endpoints := make([]Endpoint, len(stakeEntry.Endpoints))
copy(endpoints, stakeEntry.Endpoints)
newStakeEntry := StakeEntry{
Stake: stakeEntry.Stake,
Address: stakeEntry.Address,
StakeAppliedBlock: stakeEntry.StakeAppliedBlock,
Endpoints: endpoints,
Geolocation: stakeEntry.Geolocation,
Chain: stakeEntry.Chain,
Vrfpk: stakeEntry.Vrfpk,
}
returnedStorage.StakeEntries = append(returnedStorage.StakeEntries, newStakeEntry)
}
return
}