-
Notifications
You must be signed in to change notification settings - Fork 3
/
balance_fix.go
45 lines (39 loc) · 1018 Bytes
/
balance_fix.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
package main
import (
"github.com/navcoin/navexplorer-indexer-go/v2/generated/dic"
"github.com/navcoin/navexplorer-indexer-go/v2/internal/config"
)
var container *dic.Container
func main() {
config.Init()
container, _ = dic.NewContainer()
container.GetElastic().InstallMappings()
container.GetSoftforkService().InitSoftForks()
container.GetDaoConsensusService().InitConsensusParameters()
addressRepo := container.GetAddressRepo()
rewinder := container.GetAddressRewinder()
{
addresses, err := addressRepo.GetAllAddressesWithBalance("spendable")
if err == nil {
for i := range addresses {
rewinder.ResetAddress(addresses[i])
}
}
}
{
addresses, err := addressRepo.GetAllAddressesWithBalance("stakable")
if err == nil {
for i := range addresses {
rewinder.ResetAddress(addresses[i])
}
}
}
{
addresses, err := addressRepo.GetAllAddressesWithBalance("voting_weight")
if err == nil {
for i := range addresses {
rewinder.ResetAddress(addresses[i])
}
}
}
}