Skip to content

Commit

Permalink
feat: SDK v0.46.0 (#192)
Browse files Browse the repository at this point in the history
* update go mod

* use storetypes package

* fix cmd package

* fix sdk.Coins Sub operations:

* resolve gov changes

* resolve remaining changes in app

* remaining build errors

* fix remaining errors

* format

* update to go 1.18

* fix workflow go versions

* update lint workflow

* use go install instead of go get

* update test-coverage to use go1.18

* add .clang-format

* add scripts

* update make targets

* init buf

* make proto-format

* make proto-gen

* fix test

* fix test

* fix test

* format

* format

* test: update golangci-lint workflow

* revert: use ModuleAccountAddr

Co-authored-by: kogisin <[email protected]>
  • Loading branch information
Alex Johnson and jaybxyz authored Aug 26, 2022
1 parent 833b580 commit bf26b82
Show file tree
Hide file tree
Showing 37 changed files with 1,611 additions and 646 deletions.
115 changes: 115 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
Language: Proto
BasedOnStyle: Google
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: "^ IWYU pragma:"
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: ".*"
Priority: 1
IncludeIsMainRegex: "(Test)?$"
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
RawStringFormats:
- Delimiters:
- pb
Language: TextProto
BasedOnStyle: Google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
---
23 changes: 16 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,21 @@ jobs:
golangci:
name: golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- uses: actions/checkout@v2
- uses: golangci/golangci-lint-action@master
- uses: actions/setup-go@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.40
args: --timeout 10m
github-token: ${{ secrets.github_token }}
go-version: 1.18
- uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --out-format=tab
skip-go-installation: true
if: env.GIT_DIFF
12 changes: 6 additions & 6 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- run: make build
Expand All @@ -26,11 +26,11 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- name: Install runsim
run: export GO111MODULE="on" && go get github.com/cosmos/tools/cmd/[email protected]
run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/[email protected]
- uses: actions/[email protected]
with:
path: ~/go/bin
Expand All @@ -43,7 +43,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- uses: technote-space/get-diff-action@v4
Expand All @@ -69,7 +69,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- uses: technote-space/get-diff-action@v4
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- uses: technote-space/get-diff-action@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
go-version: 1.17
go-version: 1.18
- uses: technote-space/get-diff-action@v4
id: git_diff
with:
Expand All @@ -50,7 +50,7 @@ jobs:
${{ runner.os }}-go-
- uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: Run unit tests
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: display go version
run: go version
- name: test & coverage report creation
Expand All @@ -107,7 +107,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: display go version
run: go version
- name: test & coverage report creation
Expand Down
18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,17 @@ test-sim-benchmark
### Protobuf ###
###############################################################################

containerProtoVer=v0.2
containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer)
containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer)
containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer)
containerProtoFmt=cosmos-sdk-proto-fmt-$(containerProtoVer)
protoVer=v0.7
protoImageName=tendermintdev/sdk-proto-gen:$(protoVer)
containerProtoGen=tendermint-fundraising-proto-gen-$(protoVer)
containerProtoFmt=tendermint-fundraising-proto-fmt-$(protoVer)

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

proto-gen:
ignite generate proto-go

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

proto-format:
@echo "Formatting Protobuf files"
Expand Down
Loading

0 comments on commit bf26b82

Please sign in to comment.