Skip to content

Commit

Permalink
resolve conflict@
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuvubk committed Sep 19, 2024
2 parents d045f14 + 313b4bd commit d4bd8b5
Show file tree
Hide file tree
Showing 34 changed files with 2,583 additions and 223 deletions.
20 changes: 20 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
queue_rules:
- name: default
conditions:
- "#approved-reviews-by>=1"
- base=main
- label=automerge

pull_request_rules:
- name: automerge to main with label automerge and branch protection passing
conditions:
- "#approved-reviews-by>=1"
- base=main
- label=automerge
actions:
queue:
name: default
method: merge
commit_message_template: |
{{ title }} (#{{ number }})
{{ body }}
26 changes: 26 additions & 0 deletions .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.2'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.7.0
with:
version: v1.54.2
args: --timeout 10m
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Tests / Code Coverage
# Tests / Code Coverage workflow runs unit tests and uploads a code coverage report
# This workflow is run on pushes to main & every Pull Requests where a .go, .mod, .sum have been changed
on:
pull_request:
push:
branches:
- main

jobs:

split-test-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create a file with all the pkgs
run: go list ./... | grep -v e2e > pkgs.txt
- name: Split pkgs into 2 files
run: split -d -n l/2 pkgs.txt pkgs.txt.part.
# cache multiple
- uses: actions/upload-artifact@v4
with:
name: '${{ github.sha }}-00'
path: ./pkgs.txt.part.00
- uses: actions/upload-artifact@v4
with:
name: '${{ github.sha }}-01'
path: ./pkgs.txt.part.01

tests:
runs-on: ubuntu-latest
needs: split-test-files
strategy:
fail-fast: false
matrix:
part: ['00', '01']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.2'
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- uses: actions/download-artifact@v4
with:
name: '${{ github.sha }}-${{ matrix.part }}'
if: env.GIT_DIFF
- name: test & coverage report creation
run: |
cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='ledger test_ledger_mock'
if: env.GIT_DIFF
- uses: actions/upload-artifact@v4
with:
name: '${{ github.sha }}-${{ matrix.part }}-coverage'
path: ./${{ matrix.part }}profile.out

7 changes: 5 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ import (
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"

oraclemodulekeeper "github.com/onomyprotocol/reserve/x/oracle/keeper"
// this line is used by starport scaffolding # stargate/app/moduleImport

vaultskeeper "github.com/onomyprotocol/reserve/x/vaults/keeper"

"github.com/onomyprotocol/reserve/docs"
)
Expand Down Expand Up @@ -142,6 +143,7 @@ type App struct {
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper

OracleKeeper oraclemodulekeeper.Keeper
VaultsKeeper vaultskeeper.Keeper
// this line is used by starport scaffolding # stargate/app/keeperDeclaration

// simulation manager
Expand Down Expand Up @@ -295,6 +297,7 @@ func New(
&app.GroupKeeper,
&app.CircuitBreakerKeeper,
&app.OracleKeeper,
&app.VaultsKeeper,
// this line is used by starport scaffolding # stargate/app/keeperDefinition
); err != nil {
panic(err)
Expand Down Expand Up @@ -335,7 +338,7 @@ func New(
app.App = appBuilder.Build(db, traceStore, baseAppOptions...)

// Register legacy modules
if err := app.registerIBCModules(appOpts); err != nil {
if err := app.registerIBCModules(); err != nil {
return nil, err
}

Expand Down
4 changes: 2 additions & 2 deletions app/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"time"

oraclemodulev1 "github.com/onomyprotocol/reserve/api/reserve/oracle/module"
vaultsmodulev1 "github.com/onomyprotocol/reserve/api/reserve/vaults/module"
_ "github.com/onomyprotocol/reserve/x/oracle/module" // import for side-effects
oraclemoduletypes "github.com/onomyprotocol/reserve/x/oracle/types"
_ "github.com/onomyprotocol/reserve/x/vaults/module" // import for side-effects
Expand Down Expand Up @@ -124,6 +123,7 @@ var (
ibcfeetypes.ModuleName,
// chain modules
oraclemoduletypes.ModuleName,
vaultsmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/beginBlockers
}

Expand Down Expand Up @@ -307,7 +307,7 @@ var (
},
{
Name: vaultsmoduletypes.ModuleName,
Config: appconfig.WrapAny(&vaultsmodulev1.Module{}),
Config: appconfig.WrapAny(&vaultsmoduletypes.Module{}),
},
// this line is used by starport scaffolding # stargate/app/moduleConfig
},
Expand Down
5 changes: 2 additions & 3 deletions app/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"cosmossdk.io/core/appmodule"
storetypes "cosmossdk.io/store/types"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/types/module"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
Expand All @@ -28,7 +27,7 @@ import (
ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v8/modules/core"
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint: staticcheck
ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
Expand All @@ -42,7 +41,7 @@ import (
)

// registerIBCModules register IBC keepers and non dependency inject modules.
func (app *App) registerIBCModules(appOpts servertypes.AppOptions) error {
func (app *App) registerIBCModules() error {
// set up non depinject support modules store keys
if err := app.RegisterStores(
storetypes.NewKVStoreKey(capabilitytypes.StoreKey),
Expand Down
26 changes: 13 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ require (
cosmossdk.io/api v0.7.3
cosmossdk.io/client/v2 v2.0.0-beta.1
cosmossdk.io/collections v0.4.0
cosmossdk.io/core v0.11.0
cosmossdk.io/depinject v1.0.0-alpha.4
cosmossdk.io/core v0.11.1
cosmossdk.io/depinject v1.0.0
cosmossdk.io/errors v1.0.1
cosmossdk.io/log v1.3.1
cosmossdk.io/math v1.3.0
Expand All @@ -28,9 +28,9 @@ require (
github.com/bufbuild/buf v1.30.0
github.com/cometbft/cometbft v0.38.6
github.com/cosmos/cosmos-db v1.0.2
github.com/cosmos/cosmos-proto v1.0.0-beta.4
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/cosmos-sdk v0.50.5
github.com/cosmos/gogoproto v1.4.11
github.com/cosmos/gogoproto v1.5.0
github.com/cosmos/ibc-go/modules/capability v1.0.0
github.com/cosmos/ibc-go/v8 v8.1.1
github.com/golang/protobuf v1.5.4
Expand All @@ -41,9 +41,9 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.9.0
golang.org/x/tools v0.19.0
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8
google.golang.org/grpc v1.64.0
google.golang.org/grpc v1.64.1
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
google.golang.org/protobuf v1.34.2
)
Expand Down Expand Up @@ -231,19 +231,19 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/api v0.169.0 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // 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 d4bd8b5

Please sign in to comment.