Skip to content

Commit

Permalink
Merge branch 'main' into update_twap_response
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuvubk committed Nov 1, 2022
2 parents 6d2e6a3 + 8cd07fd commit 460f106
Show file tree
Hide file tree
Showing 127 changed files with 6,550 additions and 9,448 deletions.
7 changes: 5 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
- app/wasm/**/*
"C:x/claim":
- x/claim/**/*
"C:x/concentrated-liquidity":
- x/concentrated-liquidity/**/*
"C:x/epochs":
- x/epochs/**/*
"C:x/gamm":
Expand All @@ -34,6 +36,8 @@
- x/pool-incentives/**/*
"C:x/superfluid":
- x/superfluid/**/*
"C:x/swaprouter":
- x/swaprouter/**/*
"C:x/txfees":
- x/txfees/**/*
"C:x/tokenfactory":
Expand All @@ -52,7 +56,7 @@
"C:CLI":
- client/**/*
- x/*/client/**/*
# Add "C:docs" label to documented related files and directories.
# Add "C:docs" label to documented related files and directories.
"C:docs":
- bug.md
- issue.md
Expand All @@ -61,4 +65,3 @@
- x/**/*.md
- x/**/*/*.md
- tests/**/*.md

32 changes: 8 additions & 24 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ pull_request_rules:
backport:
branches:
- v4.x
- name: backport patches to v5.x branch
conditions:
- base=main
- label=A:backport/v5.x
actions:
backport:
branches:
- v5.x
- name: backport patches to v6.x branch
conditions:
- base=main
Expand All @@ -54,14 +46,6 @@ pull_request_rules:
backport:
branches:
- v6.x
- name: backport patches to v7.x branch
conditions:
- base=main
- label=A:backport/v7.x
actions:
backport:
branches:
- v7.x
- name: backport patches to v8.x branch
conditions:
- base=main
Expand All @@ -70,14 +54,6 @@ pull_request_rules:
backport:
branches:
- v8.x
- name: backport patches to v9.x branch
conditions:
- base=main
- label=A:backport/v9.x
actions:
backport:
branches:
- v9.x
- name: backport patches to v10.x branch
conditions:
- base=main
Expand Down Expand Up @@ -110,3 +86,11 @@ pull_request_rules:
backport:
branches:
- v13.x
- name: backport patches to concentrated-liquidity-main
conditions:
- base=main
- label=A:backport/cl
actions:
backport:
branches:
- concentrated-liquidity-main
38 changes: 38 additions & 0 deletions .github/workflows/auto-update-upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# When new major release is created this workflow will be triggered and will do 3 things:
# 1) it will create a directory with an empty upgrade handler in app/upgrades folder
# 2) will increase an E2E_UPGRADE_VERSION variable in Makefile
# 3) create a pull request with these changes to main

name: On Release Auto Upgrade

on:
release:
types: [published]

jobs:
post_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Run version script
run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }}

- name: Run post release script
if: env.MAJOR == 1 # 1 means vX of existing upgrade handler is smaller than A in tag vA.B.C
run: bash ./scripts/empty_upgrade_handler_gen.sh

- name: Create PR
if: env.MAJOR == 1
uses: peter-evans/create-pull-request@v4
with:
base: ${{ github.event.repository.default_branch }}
body: |
Update report
- Created a new empty upgrade handler
- Increased E2E_UPGRADE_VERSION in Makefile by 1
labels: |
T:auto
C:e2e
C:app-wiring
12 changes: 6 additions & 6 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ jobs:
path: ${{ matrix.contract.workdir }}${{ matrix.contract.build }}
retention-days: 1

# - name: Check Test Data
# working-directory: ${{ matrix.contract.workdir }}
# if: ${{ matrix.contract.output != null }}
# run: >
# diff ${{ matrix.contract.output }} ${{ matrix.contract.build }}
- name: Check Test Data
working-directory: ${{ matrix.contract.workdir }}
if: ${{ matrix.contract.output != null }}
run: >
diff ${{ matrix.contract.output }} ${{ matrix.contract.build }}

lints:
Expand All @@ -107,7 +107,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: stable
override: true
components: rustfmt, clippy

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- concentrated-liquidity-main

jobs:
golangci:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/state-compatibility-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ on:
env:
GOLANG_VERSION: 1.18
GENESIS_URL: https://github.com/osmosis-labs/networks/raw/main/osmosis-1/genesis.json
ADDRBOOK_URL: https://dl2.quicksync.io/json/addrbook.osmosis.json
SNAPSHOT_BUCKET: https://osmosis-snapshot.sfo3.cdn.digitaloceanspaces.com
RPC_ENDPOINT: https://rpc.osmosis.zone
LCD_ENDPOINT: https://lcd.osmosis.zone
Expand Down Expand Up @@ -147,6 +148,9 @@ jobs:
dasel put string -f $CONFIG_FOLDER/app.toml '.halt-height' $HALT_HEIGHT
dasel put string -f $CONFIG_FOLDER/app.toml '.pruning' everything
dasel put string -f $CONFIG_FOLDER/app.toml '.state-sync.snapshot-interval' 0
# Download addrbook
wget -O $CONFIG_FOLDER/addrbook.json ${{ env.ADDRBOOK_URL }}
-
name: 🧪 Start Osmosis Node
run: build/osmosisd start
Expand Down
21 changes: 1 addition & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,12 @@ on:
push:
branches:
- "main"
- "concentrated-liquidity-main"
- "v[0-9]**"
workflow_dispatch:

jobs:
should_run_go_test:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
-
id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: "true" # workflow-runs from outdated commits will be cancelled.
concurrent_skipping: "same_content"
skip_after_successful_duplicate: "true"
paths: '["**/*.go", "**/*.mod", "**/*.sum"]'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
-
name: Skipping test
run: echo Should I skip tests? ${{ steps.skip_check.outputs.should_skip }}

go:
needs: should_run_go_test
if: ${{ needs.should_run_test.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
-
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,7 @@ Cargo.lock
.beaker
blocks.db
**/blocks.db*

# Ignore e2e test artifacts (which clould leak information if commited)
.ash_history
.bash_history
30 changes: 30 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "E2E: (make test-e2e-short)",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/tests/e2e",
"args": [
"-test.timeout",
"30m",
"-test.run",
"IntegrationTestSuite",
"-test.v"
],
"buildFlags": "-tags e2e",
"env": {
"OSMOSIS_E2E": "True",
"OSMOSIS_E2E_SKIP_IBC": "true",
"OSMOSIS_E2E_SKIP_UPGRADE": "true",
"OSMOSIS_E2E_SKIP_CLEANUP": "true",
"OSMOSIS_E2E_SKIP_STATE_SYNC": "true",
"OSMOSIS_E2E_UPGRADE_VERSION": "v13",
"OSMOSIS_E2E_DEBUG_LOG": "true",
},
"preLaunchTask": "e2e-setup"
}
]
}
12 changes: 12 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "e2e-setup",
"type": "shell",
"command": "make e2e-setup"
}
]
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

* [#2788](https://github.com/osmosis-labs/osmosis/pull/2788) Add logarithm base 2 implementation.
* [#2739](https://github.com/osmosis-labs/osmosis/pull/2739) Add pool type query

### Bug fixes
Expand All @@ -55,6 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Misc Improvements

* [#2804](https://github.com/osmosis-labs/osmosis/pull/2804) Improve error handling and messages when parsing pool assets.
* [#3035](https://github.com/osmosis-labs/osmosis/pull/3035) Remove `PokePool` from `PoolI` interface. Define on a new WeightedPoolExtension` instead.

## v12.0.0

Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)
DOCKER := $(shell which docker)
BUILDDIR ?= $(CURDIR)/build
E2E_UPGRADE_VERSION := "v12"
E2E_UPGRADE_VERSION := "v13"


export GO111MODULE = on
Expand Down Expand Up @@ -224,7 +224,7 @@ run-querygen:
###############################################################################

PACKAGES_UNIT=$(shell go list ./... | grep -E -v 'tests/simulator|e2e')
PACKAGES_E2E=$(shell go list -tags e2e ./... | grep '/e2e')
PACKAGES_E2E=$(shell go list ./... | grep '/e2e')
PACKAGES_SIM=$(shell go list ./... | grep '/tests/simulator')
TEST_PACKAGES=./...

Expand Down Expand Up @@ -261,25 +261,25 @@ test-sim-bench:
# In that case, run `make e2e-remove-resources`
# manually.
# Utilizes Go cache.
test-e2e: e2e-setup test-e2e-ci
test-e2e: OSMOSIS_E2E=True e2e-setup test-e2e-ci

# test-e2e-ci runs a full e2e test suite
# does not do any validation about the state of the Docker environment
# As a result, avoid using this locally.
test-e2e-ci:
@VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E)
@VERSION=$(VERSION) OSMOSIS_E2E=True OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E)

# test-e2e-debug runs a full e2e test suite but does
# not attempt to delete Docker resources at the end.
test-e2e-debug: e2e-setup
@VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1
@VERSION=$(VERSION) OSMOSIS_E2E=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) OSMOSIS_E2E_SKIP_CLEANUP=True go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1

# test-e2e-short runs the e2e test with only short tests.
# Does not delete any of the containers after running.
# Deletes any existing containers before running.
# Does not use Go cache.
test-e2e-short: e2e-setup
@VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_SKIP_UPGRADE=True OSMOSIS_E2E_SKIP_IBC=True OSMOSIS_E2E_SKIP_STATE_SYNC=True OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1
@VERSION=$(VERSION) OSMOSIS_E2E=True OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_SKIP_UPGRADE=True OSMOSIS_E2E_SKIP_IBC=True OSMOSIS_E2E_SKIP_STATE_SYNC=True OSMOSIS_E2E_SKIP_CLEANUP=True go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1

test-mutation:
@bash scripts/mutation-test.sh $(MODULES)
Expand Down
3 changes: 2 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (
v10 "github.com/osmosis-labs/osmosis/v12/app/upgrades/v10"
v11 "github.com/osmosis-labs/osmosis/v12/app/upgrades/v11"
v12 "github.com/osmosis-labs/osmosis/v12/app/upgrades/v12"
v13 "github.com/osmosis-labs/osmosis/v12/app/upgrades/v13"
v3 "github.com/osmosis-labs/osmosis/v12/app/upgrades/v3"
v4 "github.com/osmosis-labs/osmosis/v12/app/upgrades/v4"
v5 "github.com/osmosis-labs/osmosis/v12/app/upgrades/v5"
Expand Down Expand Up @@ -88,7 +89,7 @@ var (

// _ sdksimapp.App = (*OsmosisApp)(nil)

Upgrades = []upgrades.Upgrade{v4.Upgrade, v5.Upgrade, v7.Upgrade, v9.Upgrade, v11.Upgrade, v12.Upgrade}
Upgrades = []upgrades.Upgrade{v4.Upgrade, v5.Upgrade, v7.Upgrade, v9.Upgrade, v11.Upgrade, v12.Upgrade, v13.Upgrade}
Forks = []upgrades.Fork{v3.Fork, v6.Fork, v8.Fork, v10.Fork}
)

Expand Down
6 changes: 6 additions & 0 deletions app/apptesting/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ func (s *KeeperTestHelper) AssertEventEmitted(ctx sdk.Context, eventTypeExpected

func (s *KeeperTestHelper) FindEvent(events []sdk.Event, name string) sdk.Event {
index := slices.IndexFunc(events, func(e sdk.Event) bool { return e.Type == name })
if index == -1 {
return sdk.Event{}
}
return events[index]
}

func (s *KeeperTestHelper) ExtractAttributes(event sdk.Event) map[string]string {
attrs := make(map[string]string)
if event.Attributes == nil {
return attrs
}
for _, a := range event.Attributes {
attrs[string(a.Key)] = string(a.Value)
}
Expand Down
Loading

0 comments on commit 460f106

Please sign in to comment.