Skip to content

Commit b782409

Browse files
authored
chore: cleanup repo (#13)
* local-ic cleanup * add POA test * cleanup misc go and proto * cleanup * undo accidental params change (!=0) * remove handled todos * lint * proto-gen latest * release docker image on tag
1 parent 0ebdae9 commit b782409

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+219
-361
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build appd
1+
name: Build Manifest
22

33
on:
44
pull_request:

.github/workflows/e2e.yml

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
# names of `make` commands to run tests
5656
test:
5757
- "ictest-ibc"
58+
- "ictest-poa"
5859
- "ictest-tokenfactory"
5960
- "ictest-manifest"
6061
fail-fast: false
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This workflow pushes new docker images on every new tag.
2+
#
3+
# On every new `vX.Y.Z` tag the following images are pushed:
4+
#
5+
# liftedinit/manifest-ledger:vX.Y.Z # is pushed
6+
# liftedinit/manifest-ledger:X.Y.Z # is pushed
7+
# liftedinit/manifest-ledger:X.Y # is updated to X.Y.Z
8+
# liftedinit/manifest-ledger:X # is updated to X.Y.Z
9+
# liftedinit/manifest-ledger:latest # is updated to X.Y.Z
10+
#
11+
# All the images above have support for linux/amd64 and linux/arm64.
12+
#
13+
# Due to QEMU virtualization used to build multi-platform docker images
14+
# this workflow might take a while to complete.
15+
16+
name: Push Docker Images
17+
18+
on:
19+
release:
20+
types: [published, created, edited]
21+
push:
22+
tags:
23+
- 'v[0-9]+.[0-9]+.[0-9]+' # ignore rc
24+
25+
jobs:
26+
chain-images:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Check out the repo
30+
uses: actions/checkout@v4
31+
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Login to GitHub Container Registry
39+
uses: docker/login-action@v3
40+
with:
41+
registry: ghcr.io
42+
username: ${{ github.repository_owner }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Parse tag
46+
id: tag
47+
run: |
48+
VERSION=$(echo ${{ github.ref_name }} | sed "s/v//")
49+
MAJOR_VERSION=$(echo $VERSION | cut -d '.' -f 1)
50+
MINOR_VERSION=$(echo $VERSION | cut -d '.' -f 2)
51+
PATCH_VERSION=$(echo $VERSION | cut -d '.' -f 3)
52+
echo "VERSION=$VERSION" >> $GITHUB_ENV
53+
echo "MAJOR_VERSION=$MAJOR_VERSION" >> $GITHUB_ENV
54+
echo "MINOR_VERSION=$MINOR_VERSION" >> $GITHUB_ENV
55+
echo "PATCH_VERSION=$PATCH_VERSION" >> $GITHUB_ENV
56+
57+
- name: Build and push
58+
id: build_push_image
59+
uses: docker/build-push-action@v5
60+
with:
61+
file: Dockerfile
62+
context: .
63+
push: true
64+
platforms: linux/amd64,linux/arm64
65+
tags: |
66+
ghcr.io/liftedinit/manifest-ledger:${{ env.MAJOR_VERSION }}
67+
ghcr.io/liftedinit/manifest-ledger:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}
68+
ghcr.io/liftedinit/manifest-ledger:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }}
69+
ghcr.io/liftedinit/manifest-ledger:v${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }}

.github/workflows/test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ jobs:
2323
check-latest: true
2424

2525
- name: unit tests
26-
run: |
27-
make test
26+
run: make test

.golangci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ linters-settings:
4040
- prefix(github.com/cosmos)
4141
- prefix(cosmossdk.io)
4242
- prefix(github.com/cosmos/cosmos-sdk)
43-
- prefix(github.com/CosmosContracts/juno)
43+
- prefix(github.com/strangelove-ventures/poa)
44+
- prefix(github.com/reecepbcups/tokenfactory)
45+
- prefix(github.com/liftedinit/manifest-ledger)
4446
gosec:
4547
excludes:
4648
- G404

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ ictest-tokenfactory:
104104
ictest-manifest:
105105
cd interchaintest && go test -race -v -run TestManifestModule . -count=1
106106

107+
ictest-poa:
108+
cd interchaintest && go test -race -v -run TestPOA . -count=1
109+
107110

108111
.PHONY: ictest-ibc ictest-tokenfactory
109112

api/manifest/v1/tx.pulsar.go

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/manifest/v1/tx_grpc.pb.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/ante.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package app
33
import (
44
"errors"
55

6-
poaante "github.com/strangelove-ventures/poa/ante"
7-
86
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
97
"github.com/cosmos/ibc-go/v8/modules/core/keeper"
108

@@ -14,6 +12,8 @@ import (
1412

1513
sdk "github.com/cosmos/cosmos-sdk/types"
1614
"github.com/cosmos/cosmos-sdk/x/auth/ante"
15+
16+
poaante "github.com/strangelove-ventures/poa/ante"
1717
)
1818

1919
// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC

app/app.go

+12-9
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,7 @@ import (
88
"path/filepath"
99
"sort"
1010

11-
manifest "github.com/liftedinit/manifest-ledger/x/manifest"
12-
manifestkeeper "github.com/liftedinit/manifest-ledger/x/manifest/keeper"
13-
manifesttypes "github.com/liftedinit/manifest-ledger/x/manifest/types"
14-
"github.com/reecepbcups/tokenfactory/x/tokenfactory"
15-
tokenfactorykeeper "github.com/reecepbcups/tokenfactory/x/tokenfactory/keeper"
16-
tokenfactorytypes "github.com/reecepbcups/tokenfactory/x/tokenfactory/types"
1711
"github.com/spf13/cast"
18-
"github.com/strangelove-ventures/poa"
19-
poakeeper "github.com/strangelove-ventures/poa/keeper"
20-
poamodule "github.com/strangelove-ventures/poa/module"
2112

2213
abci "github.com/cometbft/cometbft/abci/types"
2314

@@ -137,6 +128,18 @@ import (
137128
"github.com/cosmos/cosmos-sdk/x/staking"
138129
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
139130
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
131+
132+
"github.com/strangelove-ventures/poa"
133+
poakeeper "github.com/strangelove-ventures/poa/keeper"
134+
poamodule "github.com/strangelove-ventures/poa/module"
135+
136+
"github.com/reecepbcups/tokenfactory/x/tokenfactory"
137+
tokenfactorykeeper "github.com/reecepbcups/tokenfactory/x/tokenfactory/keeper"
138+
tokenfactorytypes "github.com/reecepbcups/tokenfactory/x/tokenfactory/types"
139+
140+
manifest "github.com/liftedinit/manifest-ledger/x/manifest"
141+
manifestkeeper "github.com/liftedinit/manifest-ledger/x/manifest/keeper"
142+
manifesttypes "github.com/liftedinit/manifest-ledger/x/manifest/types"
140143
)
141144

142145
func GetPoAAdmin() string {

app/apptesting/events.go

-18
This file was deleted.

app/apptesting/test_suite.go

+18-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"fmt"
55
"time"
66

7-
"github.com/liftedinit/manifest-ledger/app"
8-
appparams "github.com/liftedinit/manifest-ledger/app/params"
97
"github.com/stretchr/testify/suite"
108

119
"github.com/cometbft/cometbft/crypto/ed25519"
@@ -32,6 +30,9 @@ import (
3230
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
3331
stakinghelper "github.com/cosmos/cosmos-sdk/x/staking/testutil"
3432
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
33+
34+
"github.com/liftedinit/manifest-ledger/app"
35+
appparams "github.com/liftedinit/manifest-ledger/app/params"
3536
)
3637

3738
type KeeperTestHelper struct {
@@ -251,6 +252,21 @@ func (s *KeeperTestHelper) ConfirmUpgradeSucceeded(upgradeName string, upgradeHe
251252
})
252253
}
253254

255+
// AssertEventEmitted asserts that ctx's event manager has emitted the given number of events
256+
// of the given type.
257+
func (s *KeeperTestHelper) AssertEventEmitted(ctx sdk.Context, eventTypeExpected string, numEventsExpected int) {
258+
allEvents := ctx.EventManager().Events()
259+
260+
// filter out other events
261+
actualEvents := make([]sdk.Event, 0)
262+
for _, event := range allEvents {
263+
if event.Type == eventTypeExpected {
264+
actualEvents = append(actualEvents, event)
265+
}
266+
}
267+
s.Equal(numEventsExpected, len(actualEvents))
268+
}
269+
254270
// CreateRandomAccounts is a function return a list of randomly generated AccAddresses
255271
func CreateRandomAccounts(numAccts int) []sdk.AccAddress {
256272
testAddrs := make([]sdk.AccAddress, numAccts)

app/encoding.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package app
33
import (
44
"testing"
55

6-
"github.com/liftedinit/manifest-ledger/app/params"
7-
86
dbm "github.com/cosmos/cosmos-db"
97

108
"cosmossdk.io/log"
119

1210
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
11+
12+
"github.com/liftedinit/manifest-ledger/app/params"
1313
)
1414

1515
// MakeEncodingConfig creates a new EncodingConfig with all modules registered. For testing only

app/test_helpers.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ import (
88
"testing"
99
"time"
1010

11-
apphelpers "github.com/liftedinit/manifest-ledger/app/helpers"
12-
appparams "github.com/liftedinit/manifest-ledger/app/params"
13-
"github.com/liftedinit/manifest-ledger/x/manifest/types"
14-
"github.com/strangelove-ventures/poa"
1511
"github.com/stretchr/testify/require"
1612

1713
abci "github.com/cometbft/cometbft/abci/types"
@@ -49,6 +45,12 @@ import (
4945
govv1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
5046
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
5147
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
48+
49+
"github.com/strangelove-ventures/poa"
50+
51+
apphelpers "github.com/liftedinit/manifest-ledger/app/helpers"
52+
appparams "github.com/liftedinit/manifest-ledger/app/params"
53+
"github.com/liftedinit/manifest-ledger/x/manifest/types"
5254
)
5355

5456
// SimAppChainID hardcoded chainID for simulation
@@ -195,7 +197,6 @@ func setup(t *testing.T, withGenesis bool) (*ManifestApp, GenesisState) {
195197
})
196198

197199
// Set Default Params
198-
// TODO: can maybe change to set these on start if no params are found.
199200
// Ref: wasmd https://github.com/CosmWasm/wasmd/blob/main/app/app.go#L927-L946
200201
app.MintKeeper.Minter.Set(ctx, minttypes.DefaultInitialMinter())
201202
app.MintKeeper.Params.Set(ctx, minttypes.DefaultParams())

app/upgrades.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package app
33
import (
44
"fmt"
55

6+
upgradetypes "cosmossdk.io/x/upgrade/types"
7+
68
"github.com/liftedinit/manifest-ledger/app/upgrades"
79
"github.com/liftedinit/manifest-ledger/app/upgrades/noop"
8-
9-
upgradetypes "cosmossdk.io/x/upgrade/types"
1010
)
1111

1212
// Upgrades list of chain upgrades

app/upgrades/noop/upgrades.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package noop
33
import (
44
"context"
55

6-
"github.com/liftedinit/manifest-ledger/app/upgrades"
7-
86
storetypes "cosmossdk.io/store/types"
97
upgradetypes "cosmossdk.io/x/upgrade/types"
108

119
"github.com/cosmos/cosmos-sdk/types/module"
10+
11+
"github.com/liftedinit/manifest-ledger/app/upgrades"
1212
)
1313

1414
// NewUpgrade constructor

chains/chain.json

+25-6
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,35 @@
5151
]
5252
},
5353
{
54-
"key": "app_state.mint.minter.inflation",
55-
"value": "0.000000000000000000"
54+
"key": "app_state.tokenfactory.params.denom_creation_fee",
55+
"value": []
5656
},
5757
{
58-
"key": "app_state.mint.params.inflation_rate_change",
59-
"value": "0.000000000000000000"
58+
"key": "app_state.tokenfactory.params.denom_creation_gas_consume",
59+
"value": 500
6060
},
6161
{
62-
"key": "app_state.mint.params.inflation_min",
63-
"value": "0.000000000000000000"
62+
"key": "app_state.mint.params.blocks_per_year",
63+
"value": "6311520"
64+
},
65+
{
66+
"key": "app_state.manifest.params.inflation.mint_denom",
67+
"value": "umfx"
68+
},
69+
{
70+
"key": "app_state.manifest.params.inflation.yearly_amount",
71+
"value": "500000000000"
72+
},
73+
{
74+
"key": "app_state.manifest.params.inflation.automatic_enabled",
75+
"value": true
76+
},
77+
{
78+
"key": "app_state.manifest.params.stake_holders",
79+
"value": [
80+
{"address":"manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct","percentage":80000000},
81+
{"address":"manifest1efd63aw40lxf3n4mhf7dzhjkr453axurm6rp3z","percentage":20000000}
82+
]
6483
}
6584
],
6685
"accounts": [

0 commit comments

Comments
 (0)