Skip to content

Commit

Permalink
Merge branch 'main' into circulus-1
Browse files Browse the repository at this point in the history
  • Loading branch information
gjermundgaraba authored May 30, 2023
2 parents d08b1b9 + 51aee4b commit 856d6da
Show file tree
Hide file tree
Showing 482 changed files with 2,576 additions and 4,000 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/chain_pre_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Create EmpowerChain pre-release

on:
workflow_dispatch:
push:
branches:
- "main"
paths:
- 'chain/**'

jobs:
release:
name: Release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- uses: earthly/actions-setup@v1
with:
version: 0.6.30

- run: earthly --ci --output +build-all --VERSION=${{ github.ref_name }}
working-directory: ./chain

- run: |
zip -q empowerd-${{ github.ref_name }}-linux-amd64.zip empowerd-${{ github.ref_name }}-linux-amd64 && rm empowerd-${{ github.ref_name }}-linux-amd64 && \
zip -q empowerd-${{ github.ref_name }}-linux-arm64.zip empowerd-${{ github.ref_name }}-linux-arm64 && rm empowerd-${{ github.ref_name }}-linux-arm64 && \
zip -q empowerd-${{ github.ref_name }}-darwin-amd64.zip empowerd-${{ github.ref_name }}-darwin-amd64 && rm empowerd-${{ github.ref_name }}-darwin-amd64 && \
zip -q empowerd-${{ github.ref_name }}-darwin-arm64.zip empowerd-${{ github.ref_name }}-darwin-arm64 && rm empowerd-${{ github.ref_name }}-darwin-arm64 && \
zip -q empowerd-${{ github.ref_name }}-windows-amd64.zip empowerd-${{ github.ref_name }}.exe && rm empowerd-${{ github.ref_name }}.exe
working-directory: ./chain/build
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
title: "Development Build"
prerelease: true
files: ./chain/build/*
2 changes: 1 addition & 1 deletion chain/CODING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To keep a clean separation of concerns in our modules, we construct our keeper t
- Business logic layer: Public Keeper methods
- Storage layer: Private Keeper methods

![](../docs/static/img/keeper_structure.png)
![](../docs/static/img/keeper-structure.png)

### API Layer: MsgServer and Querier

Expand Down
2 changes: 1 addition & 1 deletion chain/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ devnet:
RUN { echo ${VALPASS}; echo ${VALPASS}; } | empowerd keys add ${VALNAME}

# Set up devnet genesis for new key
RUN echo ${VALPASS} | empowerd genesis devnet ~/.empowerchain/config/genesis.json ${VALNAME} $(jq .pub_key.value ~/.empowerchain/config/priv_validator_key.json | sed -r "s/\"//g")
RUN echo ${VALPASS} | empowerd genesis single-validator ~/.empowerchain/config/genesis.json ${VALNAME} $(jq -r .pub_key.value ~/.empowerchain/config/priv_validator_key.json)
RUN mv ~/.empowerchain/config/genesis.json.generated ~/.empowerchain/config/genesis.json

SAVE IMAGE --push ${IMAGE_NAME}:${VERSION} ${IMAGE_NAME}:latest
Expand Down
1 change: 1 addition & 0 deletions chain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ $ earthly -P +test
```

To see more targets, take a look at the Earthfile in this directory.

14 changes: 1 addition & 13 deletions chain/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ import (
"github.com/spf13/cast"

"github.com/EmpowerPlastic/empowerchain/app/upgrades"
"github.com/EmpowerPlastic/empowerchain/x/accesscontrol"
accesscontrolmodulekeeper "github.com/EmpowerPlastic/empowerchain/x/accesscontrol/keeper"
accesscontrolmodule "github.com/EmpowerPlastic/empowerchain/x/accesscontrol/module"
certificatemoduletypes "github.com/EmpowerPlastic/empowerchain/x/certificates"
certificatemodulekeeper "github.com/EmpowerPlastic/empowerchain/x/certificates/keeper"
certificatemodule "github.com/EmpowerPlastic/empowerchain/x/certificates/module"
Expand Down Expand Up @@ -181,7 +178,6 @@ var (
// Custom modules
proofofexistencemodule.AppModuleBasic{},
plasticcreditmodule.AppModuleBasic{},
accesscontrolmodule.AppModuleBasic{},
certificatemodule.AppModuleBasic{},

// IBC modules
Expand Down Expand Up @@ -262,7 +258,6 @@ type EmpowerApp struct {
// Custom module keepers
ProofofexistenceKeeper proofofexistencemodulekeeper.Keeper
PlasticcreditKeeper plasticcreditmodulekeeper.Keeper
AccessControlKeeper accesscontrolmodulekeeper.Keeper
CertificateKeeper certificatemodulekeeper.Keeper

// IBC keepers
Expand Down Expand Up @@ -319,7 +314,7 @@ func New(
ibcexported.StoreKey, ibctransfertypes.StoreKey, ibcfeetypes.StoreKey,
icahosttypes.StoreKey, icacontrollertypes.StoreKey,
// our own custom module store keys
proofofexistencemoduletypes.StoreKey, plasticcreditmoduletypes.StoreKey, accesscontrol.StoreKey, certificatemoduletypes.StoreKey,
proofofexistencemoduletypes.StoreKey, plasticcreditmoduletypes.StoreKey, certificatemoduletypes.StoreKey,
)
transientStoreKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
memoryStoreKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand All @@ -346,8 +341,6 @@ func New(
app.ConsensusParamsKeeper = consensuskeeper.NewKeeper(appCodec, storeKeys[upgradetypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String())
baseApp.SetParamStore(&app.ConsensusParamsKeeper)

app.AccessControlKeeper = *accesscontrolmodulekeeper.NewKeeper(appCodec, storeKeys[accesscontrol.StoreKey])

app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, storeKeys[capabilitytypes.StoreKey], memoryStoreKeys[capabilitytypes.MemStoreKey])

// grant capabilities for the ibc and ibc-transfer modules
Expand Down Expand Up @@ -495,7 +488,6 @@ func New(
app.PlasticcreditKeeper = *plasticcreditmodulekeeper.NewKeeper(appCodec,
storeKeys[plasticcreditmoduletypes.StoreKey],
storeKeys[plasticcreditmoduletypes.MemStoreKey],
accesscontrolmodulekeeper.NewSubKeeper(&app.AccessControlKeeper, plasticcreditmoduletypes.ModuleName),
app.DistrKeeper,
app.CertificateKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
Expand Down Expand Up @@ -612,7 +604,6 @@ func New(
// Custom modules
proofofexistencemodule.NewAppModule(appCodec, app.ProofofexistenceKeeper, app.AccountKeeper, app.BankKeeper),
plasticcreditmodule.NewAppModule(appCodec, app.PlasticcreditKeeper, app.AccountKeeper, app.BankKeeper),
accesscontrolmodule.NewAppModule(app.AccessControlKeeper),
certificatemodule.NewAppModule(appCodec, app.CertificateKeeper),
// IBC modules
ibc.NewAppModule(app.IBCKeeper),
Expand Down Expand Up @@ -648,7 +639,6 @@ func New(
// Custom modules
proofofexistencemoduletypes.ModuleName,
plasticcreditmoduletypes.ModuleName,
accesscontrol.ModuleName,
certificatemoduletypes.ModuleName,
// IBC modules
ibctransfertypes.ModuleName,
Expand Down Expand Up @@ -681,7 +671,6 @@ func New(
// Custom modules
proofofexistencemoduletypes.ModuleName,
plasticcreditmoduletypes.ModuleName,
accesscontrol.ModuleName,
certificatemoduletypes.ModuleName,
// IBC modules
ibctransfertypes.ModuleName,
Expand Down Expand Up @@ -719,7 +708,6 @@ func New(
// Custom modules
proofofexistencemoduletypes.ModuleName,
plasticcreditmoduletypes.ModuleName,
accesscontrol.ModuleName,
certificatemoduletypes.ModuleName,
// IBC modules
ibctransfertypes.ModuleName,
Expand Down
Loading

0 comments on commit 856d6da

Please sign in to comment.