Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
Signed-off-by: yihuang <[email protected]>
  • Loading branch information
yihuang authored Aug 7, 2024
2 parents b81642c + 9054a2d commit c502c3b
Show file tree
Hide file tree
Showing 146 changed files with 24,382 additions and 18,738 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,17 @@ jobs:
if: github.event_name == 'issue_comment'
env:
COMMENT_BODY: ${{ github.event.comment.body }}
COMMENT_DATE: ${{ github.event.comment.created_at }}
run: |
echo "repo_name=${{ fromJson(steps.request.outputs.data).head.repo.full_name }}" >> $GITHUB_OUTPUT
PR_PUSHED_AT="${{ fromJson(steps.request.outputs.data).pushed_at }}"
comment_hash=`echo "$COMMENT_BODY" | cut -d' ' -f2` # get commit hash if any
if [[ "${comment_hash}" == "/runsim" ]]; then
# use default head ref
echo "ref=${{ fromJson(steps.request.outputs.data).head.ref }}" >> $GITHUB_OUTPUT
# use default head ref, if the PR hasn't changed since the comment
if [[ $(date -d "$PR_PUSHED_AT" +%s) -gt $(date -d "$COMMENT_AT" +%s) ]]; then
echo "The PR has changed since the comment, and is therefore not safe to use. Exiting."
exit 1
fi
echo "ref=${{ fromJson(steps.request.outputs.data).head.sha }}" >> $GITHUB_OUTPUT
else
# use comment provided ref
echo "ref=${comment_hash}" >> $GITHUB_OUTPUT
Expand All @@ -90,7 +95,6 @@ jobs:
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ steps.pr_data.outputs.repo_name }}
ref: ${{ steps.pr_data.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v3
Expand All @@ -115,7 +119,7 @@ jobs:
run: make test
if: "steps.changed-files.outputs.any_changed == 'true' || github.event_name == 'issue_comment'"
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
Expand All @@ -137,6 +141,10 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v23
Expand Down Expand Up @@ -206,7 +214,6 @@ jobs:
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ needs.build.outputs.repo_name }}
ref: ${{ needs.build.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v3
Expand Down Expand Up @@ -253,7 +260,6 @@ jobs:
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ needs.build.outputs.repo_name }}
ref: ${{ needs.build.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v3
Expand Down Expand Up @@ -300,7 +306,6 @@ jobs:
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ needs.build.outputs.repo_name }}
ref: ${{ needs.build.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: steps.changed-files.outputs.any_changed == 'true'

# - name: Upload coverage report
# uses: codecov/codecov-action@v3
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.txt
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
nix profile install nixpkgs#go_1_22
go tool covdata textfmt -i=coverage -o profile.txt
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./profile.txt
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
nix profile install nixpkgs#go_1_22
go tool covdata textfmt -i=coverage -o profile.txt
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./profile.txt
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
nix profile install nixpkgs#go_1_22
go tool covdata textfmt -i=coverage -o profile.txt
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./profile.txt
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
nix profile install nixpkgs#go_1_22
go tool covdata textfmt -i=coverage -o profile.txt
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./profile.txt
Expand Down Expand Up @@ -217,7 +217,7 @@ jobs:
nix profile install nixpkgs#go_1_22
go tool covdata textfmt -i=coverage -o profile.txt
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./profile.txt
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:
nix profile install nixpkgs#go_1_22
go tool covdata textfmt -i=coverage -o profile.txt
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./profile.txt
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
nix profile install nixpkgs#go_1_22
go tool covdata textfmt -i=coverage -o profile.txt
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./profile.txt
Expand Down Expand Up @@ -322,7 +322,7 @@ jobs:
nix profile install nixpkgs#go_1_22
go tool covdata textfmt -i=coverage -o profile.txt
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./profile.txt
Expand Down Expand Up @@ -358,7 +358,7 @@ jobs:
nix profile install nixpkgs#go_1_22
go tool covdata textfmt -i=coverage -o profile.txt
- name: Upload coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./profile.txt
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ pystarport/proto_python/cosmos_proto
pystarport/proto_python/gogoproto
pystarport/proto_python/google
pystarport/proto_python/tendermint

# direnv
/.direnv
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ issues:

linters-settings:
exclude: ./pystarport/*
govet:
check-shadowing: true
errcheck:
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- [#1023](https://github.com/crypto-org-chain/chain-main/pull/1023) Integrate sdk 0.47
- [#1044](https://github.com/crypto-org-chain/chain-main/pull/1044) Revert the protobuf package name changes introduced in #1023.
- [#1060](https://github.com/crypto-org-chain/chain-main/pull/1060) Upgrade rocksdb to `v9.2.1` and bump versiondb.
- [#1061](https://github.com/crypto-org-chain/chain-main/pull/1061) Integrate sdk 0.50.
- [#1068](https://github.com/crypto-org-chain/chain-main/pull/1068) Upgrade ibc-go to `v8.3.2` and remove icaauth module.

*Dec 6, 2023*

Expand Down
10 changes: 5 additions & 5 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Code of Conduct

## Conduct
### Contact: chain@crypto.org
### Contact: contact@cronoslabs.org

* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.

Expand All @@ -26,7 +26,7 @@
## Moderation
These are the policies for upholding our community’s standards of conduct. If you feel that a thread needs moderation, please contact the above mentioned person.

1. Remarks that violate the Crypto.org Chain standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)
1. Remarks that violate the Cronos.org standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)

2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed.

Expand All @@ -42,10 +42,10 @@ These are the policies for upholding our community’s standards of conduct. If

8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others.

In the Crypto.org Chain developer community we strive to go the extra step to look out for each other. Don’t just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they’re off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely.
In the Cronos POS Chain developer community we strive to go the extra step to look out for each other. Don’t just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they’re off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely.

And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could’ve communicated better — remember that it’s your responsibility to make your fellow Crypto.org Chain developer community members comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could’ve communicated better — remember that it’s your responsibility to make your fellow Cronos POS Chain developer community members comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.

The enforcement policies listed above apply to all official Crypto.org Chain venues. For other projects adopting the Crypto.org Chain Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
The enforcement policies listed above apply to all official Cronos.org venues. For other projects adopting the Cronos.org Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.

* Adapted from the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html), the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](http://contributor-covenant.org/version/1/3/0/).
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing

Thank you for your interest in contributing to Chain! The goal of the chain-main repository is to develop the implementation
of Crypto.org Chain to best power its network use cases in payments, finance and digital assets.
Thank you for your interest in contributing to the Cronos POS Chain! The goal of the chain-main repository is to develop the implementation
of Cronos POS Chain to best power its network use cases in payments, finance and digital assets.
Good places to start are this document and [the official documentation](https://github.com/crypto-org-chain/chain-docs). If you have any questions, feel free to ask on [Discord](https://discord.gg/pahqHz26q4).

All work on the code base tries to adhere to the "Development Process" described in [The Collective Code Construction Contract (C4)](https://rfc.zeromq.org/spec/42/#24-development-process).
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2018-present Crypto.org
Copyright 2018-present Cronos.org

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -10,4 +10,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
25 changes: 4 additions & 21 deletions MakefileDoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,28 @@
# include third_party/cosmos-sdk/contrib/devtools/Makefile

DOCKER := $(shell which docker)
protoVer=0.11.6
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
BINDIR ?= ~/go/bin

all: update-swagger-docs

proto-swagger-gen:
@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 $(containerProtoImage) \
sh ./scripts/protoc-swagger-gen.sh; fi
@echo "Patch swagger documentations"
@sed -i".bak" "s/cosmosvaloper16xyempempp92x9hyzz9wrgf94r6j9h5f2w4n2l/crocncl16xyempempp92x9hyzz9wrgf94r6j9h5f2w4n2l/" app/docs/swagger-ui/swagger.yaml
@sed -i".bak" "s/cosmos16xyempempp92x9hyzz9wrgf94r6j9h5f06pxxv/cro16xyempempp92x9hyzz9wrgf94r6j9h5f06pxxv/" app/docs/swagger-ui/swagger.yaml
@sed -i".bak" "s/cosmosvalconspub1zcjduepq0vu2zgkgk49efa0nqwzndanq5m4c7pa3u4apz4g2r9gspqg6g9cs3k9cuf/crocnclconspub1zcjduepq0vu2zgkgk49efa0nqwzndanq5m4c7pa3u4apz4g2r9gspqg6g9cs3k9cuf/" app/docs/swagger-ui/swagger.yaml
@sed -i".bak" "s/example: Cosmos-Hub/example: crypto-org-chain-mainnet/" app/docs/swagger-ui/swagger.yaml
@rm app/docs/swagger-ui/swagger.yaml.bak
$(protoImage) sh ./scripts/protoc-swagger-gen.sh

proto-gen:
@echo "Generating Protobuf files"
$(protoImage) sh ./scripts/protocgen.sh

proto-lint:
@echo "Linting Protobuf files"
@$(protoImage) buf lint --error-format=json
@$(protoImage) buf lint ./proto --error-format=json

proto-format:
@echo "Formatting Protobuf files"
@$(protoImage) find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \;

proto-all: proto-format proto-gen proto-swagger-gen

update-swagger-docs: statik
$(BINDIR)/statik -src=app/docs/swagger-ui -dest=app/docs -f -m
@if [ -n "$(git status --porcelain)" ]; then \
echo "\033[91mSwagger docs are out of sync!!!\033[0m";\
exit 1;\
else \
echo "\033[92mSwagger docs are in sync\033[0m";\
fi

.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint update-swagger-docs
.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint
4 changes: 2 additions & 2 deletions app/ante.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"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
"github.com/cosmos/ibc-go/v7/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
"github.com/cosmos/ibc-go/v8/modules/core/keeper"
nfttypes "github.com/crypto-org-chain/chain-main/v4/x/nft-transfer/types"
)

Expand Down
Loading

0 comments on commit c502c3b

Please sign in to comment.