Skip to content

Commit

Permalink
Merge pull request #598 from UnUniFi/app-go
Browse files Browse the repository at this point in the history
App go
  • Loading branch information
Senna46 authored Jun 12, 2023
2 parents 024c949 + 3f49a6e commit a7b213a
Show file tree
Hide file tree
Showing 12 changed files with 538 additions and 452 deletions.
920 changes: 478 additions & 442 deletions app/app.go

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions app/upgrades/v3/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package v3

import (
store "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/x/group"
icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types"

"github.com/UnUniFi/chain/app/upgrades"

epochstypes "github.com/UnUniFi/chain/x/epochs/types"
icacallbackstypes "github.com/UnUniFi/chain/x/yieldaggregator/ibcstaking/icacallbacks/types"
interchainquerytypes "github.com/UnUniFi/chain/x/yieldaggregator/ibcstaking/interchainquery/types"
recordstypes "github.com/UnUniFi/chain/x/yieldaggregator/ibcstaking/records/types"
stakeibctypes "github.com/UnUniFi/chain/x/yieldaggregator/ibcstaking/stakeibc/types"
yieldaggregatortypes "github.com/UnUniFi/chain/x/yieldaggregator/types"
)

const UpgradeName string = "v3"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{icacontrollertypes.SubModuleName, group.ModuleName, epochstypes.ModuleName, icacallbackstypes.ModuleName, interchainquerytypes.ModuleName, recordstypes.ModuleName, stakeibctypes.ModuleName, yieldaggregatortypes.ModuleName},
Deleted: []string{},
},
}
23 changes: 23 additions & 0 deletions app/upgrades/v3/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package v3

import (
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/UnUniFi/chain/app/keepers"
"github.com/UnUniFi/chain/app/upgrades"
)

func CreateUpgradeHandler(mm *module.Manager,
configurator module.Configurator,
_ upgrades.BaseAppParamManager,
keepers *keepers.AppKeepers) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info(fmt.Sprintf("update start:%s", UpgradeName))

return mm.RunMigrations(ctx, configurator, vm)
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ require (
replace (
// patch bech32 decoding to enable larger string lengths
github.com/btcsuite/btcutil => github.com/kava-labs/btcutil v0.0.0-20200522184203-886d33430f06
github.com/cosmos/cosmos-sdk => github.com/ununifi/cosmos-sdk v0.47.1-bank-rc2
github.com/cosmos/cosmos-sdk => github.com/ununifi/cosmos-sdk v0.47.1-bank-rc3

github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,8 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY
github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ununifi/cosmos-sdk v0.47.1-bank-rc2 h1:HaR6vA92sSpqAVGAQkwr5ZZxNwzawQMDn62ZpYGQRiI=
github.com/ununifi/cosmos-sdk v0.47.1-bank-rc2/go.mod h1:14tO5KQaTrl2q3OxBnDRfue7TRN9zkXS0cLutrSqkOo=
github.com/ununifi/cosmos-sdk v0.47.1-bank-rc3 h1:VQKJDgy9o01/MRjrUFSxF8jDEonydAYrZemneVU3GiM=
github.com/ununifi/cosmos-sdk v0.47.1-bank-rc3/go.mod h1:14tO5KQaTrl2q3OxBnDRfue7TRN9zkXS0cLutrSqkOo=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
Expand Down
2 changes: 1 addition & 1 deletion utils/admins.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package utils

var Admins = map[string]bool{
"ununifi1a8jcsmla6heu99ldtazc27dna4qcd4jygsthx6": true,
"ununifi1r500cehqg5u6fhsaysmhu4cnw5pz3lxcqhgaq7": true,
}
2 changes: 1 addition & 1 deletion x/yieldaggregator/genesis.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package yield_aggregator
package yieldaggregator

import (
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
2 changes: 1 addition & 1 deletion x/yieldaggregator/genesis_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package yield_aggregator_test
package yieldaggregator_test

// import (
// "testing"
Expand Down
2 changes: 1 addition & 1 deletion x/yieldaggregator/ibcstaking/interchainquery/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) {

// DefaultGenesis returns the capability module's default genesis state.
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
return nil
return cdc.MustMarshalJSON(types.DefaultGenesis())
}

// ValidateGenesis performs genesis state validation for the capability module.
Expand Down
2 changes: 1 addition & 1 deletion x/yieldaggregator/module.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package yield_aggregator
package yieldaggregator

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion x/yieldaggregator/module_simulation.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package yield_aggregator
package yieldaggregator

import (
"github.com/cosmos/cosmos-sdk/baseapp"
Expand Down
2 changes: 1 addition & 1 deletion x/yieldaggregator/proposal_handler.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package yield_aggregator
package yieldaggregator

import (
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down

0 comments on commit a7b213a

Please sign in to comment.