Skip to content

Commit

Permalink
Update Docs (#2796)
Browse files Browse the repository at this point in the history
* use go1.18

* upgrade to v0.46-rc1

* fix app error

* fix app error

* fix test error

* support ics721

* fix error

* update ibc-go version

* upgrade to v0.46.1

* add authz&group module

* init module version

* replace ibc-go with v5.0.0-rc1 version

* add ibc interchain account

* upgrade docker go image versio

* fix export error when with flag --for-zero-height

* add changelog

* bump up irismod (#2760)

* bump up irismod (#2761)

* Bump up ibc-go to v5.0.0 (#2762)

* bump up ibc-go to v5.0.0

* fix compile error

* bump irismod (#2763)

Co-authored-by: sheldon <997166273@qq.com>

* ica: add gov v1 msg

* fix: nft transfer denom owner

* Bump cosmos-sdk version to v0.46.4

* fix: replace ics23

* bump: tendermint & tibc-go & irismod

* bump ibc-go version to v5.0.1 (#2768)

Co-authored-by: sheldon <997166273@qq.com>

* bump up irismod to v1.7.0 & bump up tibc-go to v0.4.0 (#2770)

Co-authored-by: sheldon <997166273@qq.com>

* update changelog for v1.4.0

* Bump up cosmos-sdk to v0.46.5

* chore: replace tendermint tag

* chore: update dep tag

* remove group module

* refactor nft mergration function

* bump irismod version to v1.7.2 (#2779)

Co-authored-by: sheldon <997166273@qq.com>

* add SetIAVLCacheSize and SetIAVLDisableFastNode (#2777)

Co-authored-by: sheldon <997166273@qq.com>

* Bump tibc-go version to v0.4.2

* Update CHANGELOG for v1.4.1

* Feature/githubaction (#2782)

* update makefile: set CGO_ENABLED=1

* update dockerfile: update secend stage baseimage to alpine:3.16

* docs: update join the mainnet

* fix swagger-ui

* update docs

* remove legacy rest

* add ibc api

* refactor

* update auth bech32 account prefix

Co-authored-by: Dreamer <745124335@qq.com>
Co-authored-by: aofengli <sheldon@bianjie.ai>
Co-authored-by: yuandu <taramaoriskykage@gmail.com>
Co-authored-by: sheldon <997166273@qq.com>
Co-authored-by: yuandu <103229163+taramakage@users.noreply.github.com>
Co-authored-by: Pancongwen <peter.pancongwen@gmail.com>
  • Loading branch information
7 people authored Jan 13, 2023
1 parent 845a9fd commit e4d43ba
Show file tree
Hide file tree
Showing 51 changed files with 56,858 additions and 36,805 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/TestUnit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v1
- name: Run unit tests
uses: cedrickring/golang-action/go1.16@1.7.0
env:
GO111MODULE: "on"
- name: Setup go
uses: actions/setup-go@v3
with:
args: make test-unit
go-version: '^1.18' # The Go version to download (if necessary) and use.
- run: make test-unit
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
# Changelog

## Unreleased
## 1.4.1

*November 28, 2022*

### Application

* [\#2780](https://github.com/irisnet/irishub/pull/2780) Bump tibc-go version to v0.4.2
* [\#2779](https://github.com/irisnet/irishub/pull/2779) Bump up irismod version to v1.7.2
* [\#2777](https://github.com/irisnet/irishub/pull/2777) Add SetIAVLCacheSize and SetIAVLDisableFastNode
* [\#2775](https://github.com/irisnet/irishub/pull/2775) Remove group module

## 1.4.0

*November 15, 2022*
### Application

* [\#2759](https://github.com/irisnet/irishub/pull/2759) Fix export error when with flag `--for-zero-height`
* [\#2766](https://github.com/irisnet/irishub/pull/2766) Bump up cosmos sdk to v0.46.4
* [\#2768](https://github.com/irisnet/irishub/pull/2768) Bump up ibc-go to v5.0.1
* [\#2770](https://github.com/irisnet/irishub/pull/2770) Bump up irismod to v1.7.0 & Bump up tibc-go to v0.4.0
* [irismod \#309](https://github.com/irisnet/irismod/pull/309) Refactor nft with cosmos-sdk nft module.
* [irismod \#308](https://github.com/irisnet/irismod/pull/308) Coinswap module adds unilateral injection liquidity function.

### API Breaking Changes

* [irismod \#309](https://github.com/irisnet/irismod/pull/309) GRPC method `Owner` rename to `NFTsOfOwner`, Remove deprecated `Queries` api
### Bug Fixes

* [irismod \#304](https://github.com/irisnet/irismod/pull/304) Fix nft module import error.
* [irismod \#314](https://github.com/irisnet/irismod/pull/314) Fix `addLiquidity` panic error.

## 1.3.0

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Build image: docker build -t irisnet/irishub .
#
FROM golang:1.16.9-alpine3.14 as builder
FROM golang:1.18-alpine3.16 as builder

# Set up dependencies
ENV PACKAGES make gcc git libc-dev bash linux-headers eudev-dev
Expand All @@ -18,7 +18,7 @@ RUN make build

# ----------------------------

FROM alpine:3.12
FROM alpine:3.16

# p2p port
EXPOSE 26656
Expand Down
37 changes: 32 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ LEDGER_ENABLED ?= true
BINDIR ?= $(GOPATH)/bin
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
NetworkType := $(shell if [ -z ${NetworkType} ]; then echo "mainnet"; else echo ${NetworkType}; fi)
CURRENT_DIR = $(shell pwd)
PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git)

export GO111MODULE = on

Expand Down Expand Up @@ -82,9 +84,9 @@ build-linux: go.sum
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build

build-all-binary: go.sum
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 go build $(BUILD_FLAGS) CGO_ENABLED=0 -o build/iris-linux-amd64 ./cmd/iris
LEDGER_ENABLED=false GOOS=linux GOARCH=arm64 go build $(BUILD_FLAGS) CGO_ENABLED=0 -o build/iris-linux-arm64 ./cmd/iris
LEDGER_ENABLED=false GOOS=windows GOARCH=amd64 go build $(BUILD_FLAGS) CGO_ENABLED=0 -o build/iris-windows-amd64.exe ./cmd/iris
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 go build $(BUILD_FLAGS) CGO_ENABLED=1 -o build/iris-linux-amd64 ./cmd/iris
LEDGER_ENABLED=false GOOS=linux GOARCH=arm64 go build $(BUILD_FLAGS) CGO_ENABLED=1 -o build/iris-linux-arm64 ./cmd/iris
LEDGER_ENABLED=false GOOS=windows GOARCH=amd64 go build $(BUILD_FLAGS) CGO_ENABLED=1 -o build/iris-windows-amd64.exe ./cmd/iris

build-contract-tests-hooks:
ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -128,24 +130,49 @@ clean:
distclean: clean
rm -rf vendor/

###############################################################################
### Protobuf ###
###############################################################################

protoVer=v0.7
protoImageName=tendermintdev/sdk-proto-gen:$(protoVer)
containerProtoGen=$(PROJECT_NAME)-proto-gen-$(protoVer)
containerProtoGenAny=$(PROJECT_NAME)-proto-gen-any-$(protoVer)
containerProtoGenSwagger=$(PROJECT_NAME)-proto-gen-swagger-$(protoVer)
containerProtoFmt=$(PROJECT_NAME)-proto-fmt-$(protoVer)
proto-all: proto-tools proto-gen proto-swagger-gen

proto-gen:
@./scripts/protocgen.sh

proto-swagger-gen:
@./scripts/protoc-swagger-gen.sh
@echo "Generating Protobuf Swagger"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then docker start -a $(containerProtoGenSwagger); else docker run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protoc-swagger-gen.sh; fi

########################################
### Testing


test: test-unit test-build
test: test-unit
test-all: test-race test-cover

test-unit:
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ${PACKAGES_UNITTEST}

test-sim-nondeterminism-fast:
@echo "Running non-determinism test..."
@cd ${CURRENT_DIR}/app && go test -mod=readonly -run TestAppStateDeterminism -Enabled=true \
-NumBlocks=10 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h

test-sim-import-export: runsim
@echo "Running application import/export simulation. This may take several minutes..."
@cd ${CURRENT_DIR}/app && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 5 TestAppImportExport

test-sim-after-import: runsim
@echo "Running application simulation-after-import. This may take several minutes..."
@cd ${CURRENT_DIR}/app && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 5 TestAppSimulationAfterImport

test-race:
@VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' ./...

Expand Down
51 changes: 51 additions & 0 deletions ante/ante.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package app

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"

guardiankeeper "github.com/irisnet/irishub/modules/guardian/keeper"

oraclekeeper "github.com/irisnet/irismod/modules/oracle/keeper"
tokenkeeper "github.com/irisnet/irismod/modules/token/keeper"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
// channel keeper.
type HandlerOptions struct {
ante.HandlerOptions
BankKeeper bankkeeper.Keeper
TokenKeeper tokenkeeper.Keeper
OracleKeeper oraclekeeper.Keeper
GuardianKeeper guardiankeeper.Keeper
BypassMinFeeMsgTypes []string
}

// NewAnteHandler returns an AnteHandler that checks and increments sequence
// numbers, checks signatures & account numbers, and deducts fees from the first
// signer.
func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {
var sigGasConsumer = opts.SigGasConsumer
if sigGasConsumer == nil {
sigGasConsumer = ante.DefaultSigVerificationGasConsumer
}
return sdk.ChainAnteDecorators(
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
ante.NewExtensionOptionsDecorator(opts.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(opts.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(opts.AccountKeeper),
ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, opts.TxFeeChecker),
ante.NewSetPubKeyDecorator(opts.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(opts.AccountKeeper),
ante.NewSigGasConsumeDecorator(opts.AccountKeeper, sigGasConsumer),
ante.NewSigVerificationDecorator(opts.AccountKeeper, opts.SignModeHandler),
NewValidateTokenDecorator(opts.TokenKeeper),
tokenkeeper.NewValidateTokenFeeDecorator(opts.TokenKeeper, opts.BankKeeper),
oraclekeeper.NewValidateOracleAuthDecorator(opts.OracleKeeper, opts.GuardianKeeper),
NewValidateServiceDecorator(),
ante.NewIncrementSequenceDecorator(opts.AccountKeeper),
), nil
}
8 changes: 4 additions & 4 deletions app/decorators.go → ante/decorators.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
ibctransfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types"
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
ibctransfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"

coinswaptypes "github.com/irisnet/irismod/modules/coinswap/types"
servicetypes "github.com/irisnet/irismod/modules/service/types"
Expand Down Expand Up @@ -38,11 +38,11 @@ func (vtd ValidateTokenDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulat
if _, err := vtd.tk.GetToken(ctx, msg.Symbol); err != nil {
return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "burnt failed, only native tokens can be burnt")
}
case *govtypes.MsgSubmitProposal:
case *govv1.MsgSubmitProposal:
if containSwapCoin(msg.InitialDeposit...) {
return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "can't deposit coinswap liquidity token for proposal")
}
case *govtypes.MsgDeposit:
case *govv1.MsgDeposit:
if containSwapCoin(msg.Amount...) {
return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "can't deposit coinswap liquidity token for proposal")
}
Expand Down
48 changes: 0 additions & 48 deletions app/ante.go

This file was deleted.

Loading

0 comments on commit e4d43ba

Please sign in to comment.