Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: coinomics v2 #260

Merged
merged 9 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use flake --impure
use flake . --impure
2 changes: 2 additions & 0 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Protobuf
# Protobuf runs buf (https://buf.build/) lint and check-breakage
# This workflow is only run when a .proto file has been changed
on:
branches-ignore:
- 'coinomics_v2' # NOTE: breaking changes are not really breaking as they are introduced in a module which was never deployed on chain
workflow_dispatch:
pull_request:
# paths:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Snyk check

on: push

jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: snyk/actions/setup@master
- uses: actions/setup-go@v1
with:
go-version: '1.20'
- name: Snyk monitor
run: snyk code test
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,5 @@ swagger-proto
tmp-swagger-gen
.devenv
.secrets
.env
.env
.dccache
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DIFF_TAG=$(shell git rev-list --tags="v*" --max-count=1 --not $(shell git rev-li
DEFAULT_TAG=$(shell git rev-list --tags="v*" --max-count=1)
# VERSION ?= $(shell echo $(shell git describe --tags $(or $(DIFF_TAG), $(DEFAULT_TAG))) | sed 's/^v//')

VERSION := "1.6.3"
VERSION := "1.6.4"
TMVERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
Expand Down
111 changes: 16 additions & 95 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,11 @@ import (
vestingkeeper "github.com/haqq-network/haqq/x/vesting/keeper"
vestingtypes "github.com/haqq-network/haqq/x/vesting/types"

v102 "github.com/haqq-network/haqq/app/upgrades/v1.0.2"
v120 "github.com/haqq-network/haqq/app/upgrades/v1.2.0"
v121 "github.com/haqq-network/haqq/app/upgrades/v1.2.1"
v130 "github.com/haqq-network/haqq/app/upgrades/v1.3.0"
v131 "github.com/haqq-network/haqq/app/upgrades/v1.3.1"
v140 "github.com/haqq-network/haqq/app/upgrades/v1.4.0"
v141 "github.com/haqq-network/haqq/app/upgrades/v1.4.1"
v142 "github.com/haqq-network/haqq/app/upgrades/v1.4.2"
v160 "github.com/haqq-network/haqq/app/upgrades/v1.6.0"
v161 "github.com/haqq-network/haqq/app/upgrades/v1.6.1"
v162 "github.com/haqq-network/haqq/app/upgrades/v1.6.2"
v163 "github.com/haqq-network/haqq/app/upgrades/v1.6.3"
v164 "github.com/haqq-network/haqq/app/upgrades/v1.6.4"

// NOTE: override ICS20 keeper to support IBC transfers of ERC20 tokens
"github.com/haqq-network/haqq/x/ibc/transfer"
Expand Down Expand Up @@ -181,7 +174,7 @@ func init() {
const (
// Name defines the application binary name
Name = "haqqd"
UpgradeName = "v1.6.3"
UpgradeName = "v1.6.4"
MainnetChainID = "haqq_11235"
)

Expand Down Expand Up @@ -1106,82 +1099,6 @@ func initParamsKeeper(
}

func (app *Haqq) setupUpgradeHandlers() {
// v1.0.2 update handler
app.UpgradeKeeper.SetUpgradeHandler(
v102.UpgradeName,
v102.CreateUpgradeHandler(
app.mm,
app.configurator,
app.BankKeeper,
app.appCodec,
app.keys[distrtypes.StoreKey],
),
)
// v1.2.0 update handler (IBC Enable)
app.UpgradeKeeper.SetUpgradeHandler(
v120.UpgradeName,
v120.CreateUpgradeHandler(
app.mm,
app.configurator,
),
)
// v1.2.1 update handler (IBC Upgrade)
app.UpgradeKeeper.SetUpgradeHandler(
v121.UpgradeName,
v121.CreateUpgradeHandler(
app.mm,
app.configurator,
),
)
// v1.3.0 update handler (Coinomics)
app.UpgradeKeeper.SetUpgradeHandler(
v130.UpgradeName,
v130.CreateUpgradeHandler(
app.mm,
app.configurator,
app.DistrKeeper,
),
)
// v1.3.1 update handler (Coinomics)
app.UpgradeKeeper.SetUpgradeHandler(
v131.UpgradeName,
v131.CreateUpgradeHandler(
app.mm,
app.configurator,
),
)

// v1.4.0 update handler (Reset Coinomics for TestEdge2)
app.UpgradeKeeper.SetUpgradeHandler(
v140.UpgradeName,
v140.CreateUpgradeHandler(
app.mm,
app.configurator,
app.StakingKeeper,
app.CoinomicsKeeper,
app.SlashingKeeper,
app.GovKeeper,
),
)

// v1.4.1 Fix handle ERC20 fro IBC Channels
app.UpgradeKeeper.SetUpgradeHandler(
v141.UpgradeName,
v141.CreateUpgradeHandler(
app.mm,
app.configurator,
),
)

// v1.4.2 Security upgrade
app.UpgradeKeeper.SetUpgradeHandler(
v142.UpgradeName,
v142.CreateUpgradeHandler(
app.mm,
app.configurator,
),
)

// v1.6.0 Security upgrade
app.UpgradeKeeper.SetUpgradeHandler(
v160.UpgradeName,
Expand Down Expand Up @@ -1223,6 +1140,19 @@ func (app *Haqq) setupUpgradeHandlers() {
v163.CreateUpgradeHandler(app.mm, app.configurator),
)

// v1.6.4 Coinomics v2
app.UpgradeKeeper.SetUpgradeHandler(
v164.UpgradeName,
v164.CreateUpgradeHandler(
app.mm,
app.configurator,
app.GetKey(coinomicstypes.StoreKey),
app.GetKey(paramstypes.StoreKey),
app.DistrKeeper,
app.CoinomicsKeeper,
),
)

// When a planned update height is reached, the old binary will panic
// writing on disk the height and name of the update that triggered it
// This will read that value, and execute the preparations for the upgrade.
Expand All @@ -1237,16 +1167,7 @@ func (app *Haqq) setupUpgradeHandlers() {

var storeUpgrades *storetypes.StoreUpgrades

switch upgradeInfo.Name {
case v130.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{coinomicstypes.ModuleName},
}
case v140.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{vestingtypes.ModuleName},
}
case v160.UpgradeName:
if upgradeInfo.Name == v160.UpgradeName {
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{
icahosttypes.SubModuleName,
Expand Down
88 changes: 0 additions & 88 deletions app/upgrades/v1.0.2/upgrades.go

This file was deleted.

6 changes: 0 additions & 6 deletions app/upgrades/v1.2.0/constants.go

This file was deleted.

28 changes: 0 additions & 28 deletions app/upgrades/v1.2.0/upgrades.go

This file was deleted.

6 changes: 0 additions & 6 deletions app/upgrades/v1.2.1/constants.go

This file was deleted.

24 changes: 0 additions & 24 deletions app/upgrades/v1.2.1/upgrades.go

This file was deleted.

Loading
Loading