Skip to content

Commit

Permalink
feat: upgrade 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
emidev98 committed Nov 22, 2023
1 parent 4e29755 commit cb76040
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 79 deletions.
18 changes: 9 additions & 9 deletions export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func ExportCirculatingSupply(app *app.TerraApp) (sdktypes.Int, error) {
ctx := app.NewContext(true, tmproto.Header{Height: height})
time := time.Now()
totalVesting := sdktypes.NewInt(0)
distQuerier := distrikeeper.NewQuerier(app.DistrKeeper)
app.AccountKeeper.IterateAccounts(ctx, func(account authtypes.AccountI) (stop bool) {
distQuerier := distrikeeper.NewQuerier(app.Keepers.DistrKeeper)
app.Keepers.AccountKeeper.IterateAccounts(ctx, func(account authtypes.AccountI) (stop bool) {
switch account.(type) {
case *vestingtypes.PeriodicVestingAccount:
v := account.(*vestingtypes.PeriodicVestingAccount)
Expand All @@ -53,7 +53,7 @@ func ExportCirculatingSupply(app *app.TerraApp) (sdktypes.Int, error) {
}
return false
})
totalSupply, err := app.BankKeeper.SupplyOf(sdktypes.WrapSDKContext(ctx), &banktypes.QuerySupplyOfRequest{
totalSupply, err := app.Keepers.BankKeeper.SupplyOf(sdktypes.WrapSDKContext(ctx), &banktypes.QuerySupplyOfRequest{
Denom: "uluna",
})
if err != nil {
Expand All @@ -77,9 +77,9 @@ func runAccountExportWorker(app *app.TerraApp) {
time := time.Now()
var accounts []string
count := 0
distQuerier := distrikeeper.NewQuerier(app.DistrKeeper)
app.AccountKeeper.IterateAccounts(ctx, func(account authtypes.AccountI) (stop bool) {
balance := app.BankKeeper.GetBalance(ctx, account.GetAddress(), "uluna").Amount
distQuerier := distrikeeper.NewQuerier(app.Keepers.DistrKeeper)
app.Keepers.AccountKeeper.IterateAccounts(ctx, func(account authtypes.AccountI) (stop bool) {
balance := app.Keepers.BankKeeper.GetBalance(ctx, account.GetAddress(), "uluna").Amount
delegationRewards, err := distQuerier.DelegationTotalRewards(sdktypes.WrapSDKContext(ctx), &types.QueryDelegationTotalRewardsRequest{
DelegatorAddress: account.GetAddress().String(),
})
Expand Down Expand Up @@ -110,15 +110,15 @@ func runAccountExportWorker(app *app.TerraApp) {
vested := balance.Add(v.DelegatedFree.AmountOf("uluna"))
accounts = append(accounts, fmt.Sprintf("%s,%s,%s", v.Address, vested, vesting))
case *authtypes.BaseAccount:
delegations := app.StakingKeeper.GetAllDelegatorDelegations(ctx, account.GetAddress())
delegations := app.Keepers.StakingKeeper.GetAllDelegatorDelegations(ctx, account.GetAddress())
for _, d := range delegations {
val, ok := app.StakingKeeper.GetValidator(ctx, d.GetValidatorAddr())
val, ok := app.Keepers.StakingKeeper.GetValidator(ctx, d.GetValidatorAddr())
if ok {
balance = balance.Add(val.TokensFromShares(d.GetShares()).TruncateInt())
}
}

unbonding := app.StakingKeeper.GetAllUnbondingDelegations(ctx, account.GetAddress())
unbonding := app.Keepers.StakingKeeper.GetAllUnbondingDelegations(ctx, account.GetAddress())
for _, ub := range unbonding {
for _, e := range ub.Entries {
balance = balance.Add(e.Balance)
Expand Down
45 changes: 23 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
github.com/terra-money/core/v2 v2.6.1
github.com/terra-money/core/v2 v2.7.0
)

require (
cloud.google.com/go v0.110.6 // indirect
cloud.google.com/go v0.110.8 // indirect
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.1 // indirect
cloud.google.com/go/iam v1.1.2 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cosmossdk.io/api v0.3.1 // indirect
cosmossdk.io/core v0.6.1 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/errors v1.0.0 // indirect
cosmossdk.io/log v1.2.1 // indirect
cosmossdk.io/math v1.1.2 // indirect
cosmossdk.io/math v1.2.0 // indirect
cosmossdk.io/tools/rosetta v0.2.1 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
Expand Down Expand Up @@ -61,10 +61,11 @@ require (
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.1-0.20231012160012-d0f49580a238 // indirect
github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0 // indirect
github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b79 // indirect
github.com/cosmos/ibc-go/v7 v7.3.0 // indirect
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect
github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect
github.com/cosmos/ledger-go v0.9.3 // indirect
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
github.com/creachadair/taskgroup v0.4.2 // indirect
Expand All @@ -86,7 +87,7 @@ require (
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
Expand All @@ -95,8 +96,8 @@ require (
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
Expand All @@ -116,7 +117,7 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.7 // indirect
Expand Down Expand Up @@ -158,24 +159,24 @@ require (
github.com/terra-money/alliance v0.3.2 // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/hid v0.9.2 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.126.0 // indirect
google.golang.org/api v0.128.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect
google.golang.org/grpc v1.57.0 // indirect
google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit cb76040

Please sign in to comment.