Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elys-network/elys into external_liq…
Browse files Browse the repository at this point in the history
…uidity_feed
  • Loading branch information
jelysn committed Sep 15, 2023
2 parents eb287ad + e3b65b5 commit 1314bd7
Show file tree
Hide file tree
Showing 211 changed files with 14,989 additions and 2,342 deletions.
26 changes: 14 additions & 12 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ builds:
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=elys
- -X github.com/cosmos/cosmos-sdk/version.AppName=elysd
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,static_wasm
- -w -s
Expand Down Expand Up @@ -49,7 +49,7 @@ builds:
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=elys
- -X github.com/cosmos/cosmos-sdk/version.AppName=elysd
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,static_wasm
- -w -s
Expand All @@ -76,7 +76,7 @@ builds:
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=elys
- -X github.com/cosmos/cosmos-sdk/version.AppName=elysd
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc,osusergo
- -w -s
Expand Down Expand Up @@ -105,7 +105,7 @@ builds:
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=elys
- -X github.com/cosmos/cosmos-sdk/version.AppName=elysd
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc,osusergo
- -w -s
Expand All @@ -130,7 +130,7 @@ archives:
- elysd-linux-arm64
- elysd-darwin-amd64
- elysd-darwin-arm64
name_template: "{{.ProjectName}}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
name_template: "{{.ProjectName}}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}"
format: tar.gz
files:
- none*
Expand All @@ -141,7 +141,7 @@ archives:
- elysd-linux-arm64
- elysd-darwin-amd64
- elysd-darwin-arm64
name_template: "{{.ProjectName}}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
name_template: "{{.ProjectName}}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}"
format: binary
files:
- none*
Expand All @@ -158,16 +158,14 @@ release:
name: elys
replace_existing_draft: true
header: |
< DESCRIPTION OF RELEASE >
## Changelog
## Description
See the full changelog [here](https://github.com/elys-network/elys/blob/v{{ .Version }}/CHANGELOG.md)
< DESCRIPTION OF RELEASE >
## ⚡️ Binaries
Binaries for Linux and Darwin (amd64 and arm64) are available below.
Darwin users can also use the same universal binary `elysd-{{ .Version }}-darwin-all` for both amd64 and arm64.
Darwin users can also use the same universal binary `elysd-v{{ .Version }}-darwin-all` for both amd64 and arm64.
#### 🔨 Build from source
Expand All @@ -178,7 +176,11 @@ release:
cd elys && git checkout v{{ .Version }}
make install
````
name_template: "elys v{{.Version}} 🧪"
## What's Changed
See the full changelog [here](https://github.com/elys-network/elys/blob/v{{ .Version }}/CHANGELOG.md)
name_template: "v{{.Version}}"
mode: replace
draft: true

Expand Down
32 changes: 32 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ import (
marginmodulekeeper "github.com/elys-network/elys/x/margin/keeper"
marginmoduletypes "github.com/elys-network/elys/x/margin/types"

accountedpoolmodule "github.com/elys-network/elys/x/accountedpool"
accountedpoolmodulekeeper "github.com/elys-network/elys/x/accountedpool/keeper"
accountedpoolmoduletypes "github.com/elys-network/elys/x/accountedpool/types"

// this line is used by starport scaffolding # stargate/app/moduleImport

"github.com/elys-network/elys/docs"
Expand Down Expand Up @@ -257,6 +261,7 @@ var (
ammmodule.AppModuleBasic{},
parametermodule.AppModuleBasic{},
marginmodule.AppModuleBasic{},
accountedpoolmodule.AppModuleBasic{},
// this line is used by starport scaffolding # stargate/app/moduleBasic
)

Expand Down Expand Up @@ -351,6 +356,8 @@ type ElysApp struct {
AmmKeeper ammmodulekeeper.Keeper
ParameterKeeper parametermodulekeeper.Keeper
MarginKeeper marginmodulekeeper.Keeper

AccountedPoolKeeper accountedpoolmodulekeeper.Keeper
// this line is used by starport scaffolding # stargate/app/keeperDeclaration

// mm is the module manager
Expand Down Expand Up @@ -415,6 +422,7 @@ func NewElysApp(
tokenomicsmoduletypes.StoreKey,
incentivemoduletypes.StoreKey,
burnermoduletypes.StoreKey,
accountedpoolmoduletypes.StoreKey,
ammmoduletypes.StoreKey,
parametermoduletypes.StoreKey,
marginmoduletypes.StoreKey,
Expand Down Expand Up @@ -667,6 +675,15 @@ func NewElysApp(
app.AssetprofileKeeper,
)

app.AccountedPoolKeeper = *accountedpoolmodulekeeper.NewKeeper(
appCodec,
keys[accountedpoolmoduletypes.StoreKey],
keys[accountedpoolmoduletypes.MemStoreKey],
app.GetSubspace(accountedpoolmoduletypes.ModuleName),
app.BankKeeper,
)
accountedPoolModule := accountedpoolmodule.NewAppModule(appCodec, app.AccountedPoolKeeper, app.AccountKeeper, app.BankKeeper)

app.AmmKeeper = *ammmodulekeeper.NewKeeper(
appCodec,
keys[ammmoduletypes.StoreKey],
Expand All @@ -677,6 +694,7 @@ func NewElysApp(
app.OracleKeeper,
&app.CommitmentKeeper,
app.AssetprofileKeeper,
app.AccountedPoolKeeper,
)
ammModule := ammmodule.NewAppModule(appCodec, app.AmmKeeper, app.AccountKeeper, app.BankKeeper)

Expand Down Expand Up @@ -859,6 +877,7 @@ func NewElysApp(
ammmoduletypes.NewMultiAmmHooks(
// insert amm hooks receivers here
app.IncentiveKeeper.AmmHooks(),
app.MarginKeeper.AmmHooks(),
),
)

Expand All @@ -869,10 +888,18 @@ func NewElysApp(
app.CommitmentKeeper.Hooks(),
app.IncentiveKeeper.Hooks(),
app.BurnerKeeper.Hooks(),
app.MarginKeeper.Hooks(),
),
)
epochsModule := epochsmodule.NewAppModule(appCodec, app.EpochsKeeper)

app.MarginKeeper.SetHooks(
marginmoduletypes.NewMultiMarginHooks(
// insert margin hooks receivers here
app.AccountedPoolKeeper.MarginHooks(),
),
)

/**** Module Options ****/

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
Expand Down Expand Up @@ -918,6 +945,7 @@ func NewElysApp(
ammModule,
parameterModule,
marginModule,
accountedPoolModule,
// this line is used by starport scaffolding # stargate/app/appModule
)

Expand Down Expand Up @@ -960,6 +988,7 @@ func NewElysApp(
parametermoduletypes.ModuleName,
marginmoduletypes.ModuleName,
wasm.ModuleName,
accountedpoolmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/beginBlockers
)

Expand Down Expand Up @@ -997,6 +1026,7 @@ func NewElysApp(
parametermoduletypes.ModuleName,
marginmoduletypes.ModuleName,
wasm.ModuleName,
accountedpoolmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/endBlockers
)

Expand Down Expand Up @@ -1038,6 +1068,7 @@ func NewElysApp(
parametermoduletypes.ModuleName,
marginmoduletypes.ModuleName,
wasm.ModuleName,
accountedpoolmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
}
app.mm.SetOrderInitGenesis(genesisModuleOrder...)
Expand Down Expand Up @@ -1333,6 +1364,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(ammmoduletypes.ModuleName)
paramsKeeper.Subspace(parametermoduletypes.ModuleName)
paramsKeeper.Subspace(marginmoduletypes.ModuleName)
paramsKeeper.Subspace(accountedpoolmoduletypes.ModuleName)
// this line is used by starport scaffolding # stargate/app/paramSubspace

return paramsKeeper
Expand Down
7 changes: 6 additions & 1 deletion app/setup_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
accountedpooltypes "github.com/elys-network/elys/x/accountedpool/types"
ammtypes "github.com/elys-network/elys/x/amm/types"
assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types"
burnertypes "github.com/elys-network/elys/x/burner/types"
Expand Down Expand Up @@ -77,6 +78,8 @@ func setUpgradeHandler(app *ElysApp) {
keyTable = parametertypes.ParamKeyTable() //nolint:staticcheck
case tokenomicstypes.ModuleName:
keyTable = tokenomicstypes.ParamKeyTable() //nolint:staticcheck
case accountedpooltypes.ModuleName:
keyTable = accountedpooltypes.ParamKeyTable() //nolint:staticcheck
}

if !subspace.HasKeyTable() {
Expand Down Expand Up @@ -108,7 +111,9 @@ func loadUpgradeStore(app *ElysApp) {

if shouldLoadUpgradeStore(app, upgradeInfo) {
storeUpgrades := storetypes.StoreUpgrades{
// Added: []string{},
Added: []string{
accountedpooltypes.ModuleName,
},
}
// Use upgrade store loader for the initial loading of all stores when app starts,
// it checks if version == upgradeHeight and applies store upgrades before loading the stores,
Expand Down
Loading

0 comments on commit 1314bd7

Please sign in to comment.