Skip to content

Commit

Permalink
Merge pull request #245 from terra-money/upgrade/v0.3.0
Browse files Browse the repository at this point in the history
Params store upgrade
  • Loading branch information
javiersuweijie authored Sep 8, 2023
2 parents 7ed42eb + 2ff54b7 commit d67aaaa
Show file tree
Hide file tree
Showing 24 changed files with 3,181 additions and 596 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ proto-gen:
@echo "Generating Protobuf files"
$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(PROTO_BUILDER_IMAGE) sh ./scripts/protocgen.sh

buf-push:
@echo "Pushing protobuf files to buf registry"
cd proto && buf push

###############################################################################
### Local Testnet (docker) ###
###############################################################################
Expand Down
24 changes: 13 additions & 11 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,12 @@ func New(
app.AllianceKeeper = alliancemodulekeeper.NewKeeper(
appCodec,
keys[alliancemoduletypes.StoreKey],
app.GetSubspace(alliancemoduletypes.ModuleName),
app.AccountKeeper,
app.BankKeeper,
app.StakingKeeper,
app.DistrKeeper,
authtypes.FeeCollectorName,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

app.BankKeeper.RegisterKeepers(app.AllianceKeeper, app.StakingKeeper)
Expand Down Expand Up @@ -574,7 +574,7 @@ func New(
params.NewAppModule(app.ParamsKeeper),
transferModule,
icaModule,
alliancemodule.NewAppModule(appCodec, app.AllianceKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
alliancemodule.NewAppModule(appCodec, app.AllianceKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry, app.GetSubspace(alliancemoduletypes.ModuleName)),
// this line is used by starport scaffolding # stargate/app/appModule
)

Expand Down Expand Up @@ -881,21 +881,23 @@ func GetMaccPerms() map[string][]string {
}

// initParamsKeeper init params keeper and its subspaces
//
//nolint:staticcheck // ParamsKeyTable is deprecated but used here for migration
func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper {
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)

paramsKeeper.Subspace(authtypes.ModuleName)
paramsKeeper.Subspace(banktypes.ModuleName)
paramsKeeper.Subspace(stakingtypes.ModuleName)
paramsKeeper.Subspace(minttypes.ModuleName)
paramsKeeper.Subspace(distrtypes.ModuleName)
paramsKeeper.Subspace(slashingtypes.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint:staticcheck
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(authtypes.ModuleName).WithKeyTable(authtypes.ParamKeyTable())
paramsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable())
paramsKeeper.Subspace(stakingtypes.ModuleName).WithKeyTable(stakingtypes.ParamKeyTable())
paramsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable())
paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable())
paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable())
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable())
paramsKeeper.Subspace(crisistypes.ModuleName).WithKeyTable(crisistypes.ParamKeyTable())
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibcexported.ModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(alliancemoduletypes.ModuleName)
paramsKeeper.Subspace(alliancemoduletypes.ModuleName).WithKeyTable(alliancemoduletypes.ParamKeyTable())
// this line is used by starport scaffolding # stargate/app/paramSubspace

return paramsKeeper
Expand Down
21 changes: 0 additions & 21 deletions config.yml

This file was deleted.

125 changes: 125 additions & 0 deletions docs/proto/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,20 @@
- [alliance/tx.proto](#alliance/tx.proto)
- [MsgClaimDelegationRewards](#alliance.MsgClaimDelegationRewards)
- [MsgClaimDelegationRewardsResponse](#alliance.MsgClaimDelegationRewardsResponse)
- [MsgCreateAlliance](#alliance.MsgCreateAlliance)
- [MsgCreateAllianceResponse](#alliance.MsgCreateAllianceResponse)
- [MsgDelegate](#alliance.MsgDelegate)
- [MsgDelegateResponse](#alliance.MsgDelegateResponse)
- [MsgDeleteAlliance](#alliance.MsgDeleteAlliance)
- [MsgDeleteAllianceResponse](#alliance.MsgDeleteAllianceResponse)
- [MsgRedelegate](#alliance.MsgRedelegate)
- [MsgRedelegateResponse](#alliance.MsgRedelegateResponse)
- [MsgUndelegate](#alliance.MsgUndelegate)
- [MsgUndelegateResponse](#alliance.MsgUndelegateResponse)
- [MsgUpdateAlliance](#alliance.MsgUpdateAlliance)
- [MsgUpdateAllianceResponse](#alliance.MsgUpdateAllianceResponse)
- [MsgUpdateParams](#alliance.MsgUpdateParams)
- [MsgUpdateParamsResponse](#alliance.MsgUpdateParamsResponse)

- [Msg](#alliance.Msg)

Expand Down Expand Up @@ -1207,6 +1215,37 @@ Params



<a name="alliance.MsgCreateAlliance"></a>

### MsgCreateAlliance



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `authority` | [string](#string) | | |
| `denom` | [string](#string) | | Denom of the asset. It could either be a native token or an IBC token |
| `reward_weight` | [string](#string) | | The reward weight specifies the ratio of rewards that will be given to each alliance asset It does not need to sum to 1. rate = weight / total_weight Native asset is always assumed to have a weight of 1. |
| `take_rate` | [string](#string) | | A positive take rate is used for liquid staking derivatives. It defines an annualized reward rate that will be redirected to the distribution rewards pool |
| `reward_change_rate` | [string](#string) | | |
| `reward_change_interval` | [google.protobuf.Duration](#google.protobuf.Duration) | | |
| `reward_weight_range` | [RewardWeightRange](#alliance.RewardWeightRange) | | set a bound of weight range to limit how much reward weights can scale. |






<a name="alliance.MsgCreateAllianceResponse"></a>

### MsgCreateAllianceResponse







<a name="alliance.MsgDelegate"></a>

### MsgDelegate
Expand Down Expand Up @@ -1234,6 +1273,32 @@ Params



<a name="alliance.MsgDeleteAlliance"></a>

### MsgDeleteAlliance



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `authority` | [string](#string) | | |
| `denom` | [string](#string) | | |






<a name="alliance.MsgDeleteAllianceResponse"></a>

### MsgDeleteAllianceResponse







<a name="alliance.MsgRedelegate"></a>

### MsgRedelegate
Expand Down Expand Up @@ -1288,6 +1353,62 @@ Params




<a name="alliance.MsgUpdateAlliance"></a>

### MsgUpdateAlliance



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `authority` | [string](#string) | | |
| `denom` | [string](#string) | | Denom of the asset. It could either be a native token or an IBC token |
| `reward_weight` | [string](#string) | | The reward weight specifies the ratio of rewards that will be given to each alliance asset It does not need to sum to 1. rate = weight / total_weight Native asset is always assumed to have a weight of 1. |
| `take_rate` | [string](#string) | | |
| `reward_change_rate` | [string](#string) | | |
| `reward_change_interval` | [google.protobuf.Duration](#google.protobuf.Duration) | | |






<a name="alliance.MsgUpdateAllianceResponse"></a>

### MsgUpdateAllianceResponse







<a name="alliance.MsgUpdateParams"></a>

### MsgUpdateParams



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `authority` | [string](#string) | | |
| `params` | [Params](#alliance.Params) | | |






<a name="alliance.MsgUpdateParamsResponse"></a>

### MsgUpdateParamsResponse






<!-- end messages -->

<!-- end enums -->
Expand All @@ -1306,6 +1427,10 @@ Params
| `Redelegate` | [MsgRedelegate](#alliance.MsgRedelegate) | [MsgRedelegateResponse](#alliance.MsgRedelegateResponse) | | |
| `Undelegate` | [MsgUndelegate](#alliance.MsgUndelegate) | [MsgUndelegateResponse](#alliance.MsgUndelegateResponse) | | |
| `ClaimDelegationRewards` | [MsgClaimDelegationRewards](#alliance.MsgClaimDelegationRewards) | [MsgClaimDelegationRewardsResponse](#alliance.MsgClaimDelegationRewardsResponse) | | |
| `UpdateParams` | [MsgUpdateParams](#alliance.MsgUpdateParams) | [MsgUpdateParamsResponse](#alliance.MsgUpdateParamsResponse) | | |
| `CreateAlliance` | [MsgCreateAlliance](#alliance.MsgCreateAlliance) | [MsgCreateAllianceResponse](#alliance.MsgCreateAllianceResponse) | | |
| `UpdateAlliance` | [MsgUpdateAlliance](#alliance.MsgUpdateAlliance) | [MsgUpdateAllianceResponse](#alliance.MsgUpdateAllianceResponse) | | |
| `DeleteAlliance` | [MsgDeleteAlliance](#alliance.MsgDeleteAlliance) | [MsgDeleteAllianceResponse](#alliance.MsgDeleteAllianceResponse) | | |

<!-- end services -->

Expand Down
64 changes: 36 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,38 @@ module github.com/terra-money/alliance
go 1.20

require (
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/math v1.0.1
cosmossdk.io/errors v1.0.0
cosmossdk.io/math v1.1.2
cosmossdk.io/tools/rosetta v0.2.1
github.com/cometbft/cometbft v0.37.2
github.com/cometbft/cometbft-db v0.8.0
github.com/cosmos/cosmos-proto v1.0.0-beta.2
github.com/cosmos/cosmos-sdk v0.47.3
github.com/cosmos/ibc-go/v7 v7.1.0
github.com/cosmos/cosmos-sdk v0.47.5
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/ibc-go/v7 v7.3.0
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
google.golang.org/grpc v1.55.0
google.golang.org/protobuf v1.30.0
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb
google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e
google.golang.org/grpc v1.57.0
google.golang.org/protobuf v1.31.0
)

require github.com/cosmos/gogoproto v1.4.10

require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.19.0 // indirect
cloud.google.com/go v0.110.6 // 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 v0.13.0 // indirect
cloud.google.com/go/storage v1.29.0 // indirect
cloud.google.com/go/iam v1.1.1 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cosmossdk.io/api v0.3.1 // indirect
cosmossdk.io/core v0.5.1 // indirect
cosmossdk.io/depinject v1.0.0-alpha.3 // indirect
cosmossdk.io/log v1.1.0 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/log v1.2.1 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
Expand All @@ -51,6 +50,9 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/cockroachdb/errors v1.10.0 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
Expand All @@ -72,10 +74,10 @@ require (
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -85,10 +87,10 @@ require (
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.3 // 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.8.0 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand All @@ -110,13 +112,15 @@ require (
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/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.7.16 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
Expand All @@ -134,8 +138,9 @@ require (
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rakyll/statik v0.1.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.29.1 // indirect
github.com/rs/zerolog v1.30.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand All @@ -149,15 +154,18 @@ require (
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/crypto v0.12.0 // 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/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.122.0 // indirect
google.golang.org/api v0.126.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/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit d67aaaa

Please sign in to comment.