-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release v0.10.0
- Loading branch information
Showing
131 changed files
with
2,921 additions
and
3,384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,25 @@ | ||
# v1.27.0 | ||
|
||
run: | ||
concurrency: 16 | ||
timeout: 5m | ||
tests: false | ||
allow-parallel-runners: true | ||
|
||
linters-settings: | ||
funlen: | ||
lines: 180 | ||
statements: 120 | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- performance | ||
- style | ||
gocyclo: | ||
min-complexity: 16 | ||
goimports: | ||
local-prefixes: github.com/sentinel-official/hub | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- asciicheck | ||
- bodyclose | ||
- deadcode | ||
- depguard | ||
- dogsled | ||
#- dupl | ||
- errcheck | ||
- funlen | ||
#- gochecknoglobals | ||
#- gochecknoinits | ||
#- gocognit | ||
#- goconst | ||
#- gocritic | ||
#- gocyclo | ||
- godot | ||
- godox | ||
#- goerr113 | ||
- gofmt | ||
- goimports | ||
- golint | ||
#- gomnd | ||
- gomodguard | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
#- lll | ||
- maligned | ||
- misspell | ||
- nakedret | ||
#- nestif | ||
#- nolintlint | ||
- prealloc | ||
- rowserrcheck | ||
- scopelint | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- testpackage | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
disable: | ||
- gochecknoglobals | ||
- varnamelen | ||
presets: | ||
- bugs | ||
- comment | ||
- complexity | ||
- error | ||
- format | ||
- import | ||
- metalinter | ||
- module | ||
- performance | ||
- sql | ||
- style | ||
- test | ||
- unused | ||
- varcheck | ||
- whitespace | ||
#- wsl | ||
fast: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,22 +16,13 @@ LD_FLAGS := -s -w \ | |
benchmark: | ||
@go test -mod=readonly -v -bench ${PACKAGES} | ||
|
||
.PHONY: build | ||
build: | ||
GOOS=darwin GOARCH=amd64 go build -mod=readonly -tags="${BUILD_TAGS}" -ldflags="${LD_FLAGS}" \ | ||
-o ./build/sentinelhub-${VERSION}-darwin-amd64 ./cmd/sentinelhub | ||
GOOS=linux GOARCH=amd64 go build -mod=readonly -tags="${BUILD_TAGS}" -ldflags="${LD_FLAGS}" \ | ||
-o ./build/sentinelhub-${VERSION}-linux-amd64 ./cmd/sentinelhub | ||
GOOS=windows GOARCH=amd64 go build -mod=readonly -tags="${BUILD_TAGS}" -ldflags="${LD_FLAGS}" \ | ||
-o ./build/sentinelhub-${VERSION}-windows-amd64.exe ./cmd/sentinelhub | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf ./bin ./vendor | ||
rm -rf ./vendor | ||
|
||
.PHONY: install | ||
install: mod-vendor | ||
go install -mod=readonly -tags="${BUILD_TAGS}" -ldflags="${LD_FLAGS}" ./cmd/sentinelhub | ||
install: | ||
go install -mod=readonly -tags="${BUILD_TAGS}" -ldflags="${LD_FLAGS}" -trimpath ./cmd/sentinelhub | ||
|
||
.PHONY: go-lint | ||
go-lint: | ||
|
@@ -60,7 +51,6 @@ test-coverage: | |
|
||
.PHONY: tools | ||
tools: | ||
@go install github.com/bufbuild/buf/cmd/[email protected] | ||
@go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
@go install github.com/goware/[email protected] | ||
@go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
@go install github.com/goware/[email protected] | ||
@go install github.com/grpc-ecosystem/grpc-gateway/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package hub | ||
|
||
import ( | ||
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" | ||
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/errors" | ||
authante "github.com/cosmos/cosmos-sdk/x/auth/ante" | ||
ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante" | ||
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" | ||
) | ||
|
||
type HandlerOptions struct { | ||
authante.HandlerOptions | ||
IBCKeeper *ibckeeper.Keeper | ||
TxCounterStoreKey sdk.StoreKey | ||
WasmConfig wasmtypes.WasmConfig | ||
} | ||
|
||
func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { | ||
if opts.AccountKeeper == nil { | ||
return nil, errors.Wrap(errors.ErrLogic, "account keeper is required for ante handler") | ||
} | ||
if opts.BankKeeper == nil { | ||
return nil, errors.Wrap(errors.ErrLogic, "bank keeper is required for ante handler") | ||
} | ||
if opts.SignModeHandler == nil { | ||
return nil, errors.Wrap(errors.ErrLogic, "sign mode handler is required for ante handler") | ||
} | ||
|
||
var sigGasConsumer = opts.SigGasConsumer | ||
if sigGasConsumer == nil { | ||
sigGasConsumer = authante.DefaultSigVerificationGasConsumer | ||
} | ||
|
||
anteDecorators := []sdk.AnteDecorator{ | ||
authante.NewSetUpContextDecorator(), | ||
wasmkeeper.NewLimitSimulationGasDecorator(opts.WasmConfig.SimulationGasLimit), | ||
wasmkeeper.NewCountTXDecorator(opts.TxCounterStoreKey), | ||
authante.NewRejectExtensionOptionsDecorator(), | ||
authante.NewMempoolFeeDecorator(), | ||
authante.NewValidateBasicDecorator(), | ||
authante.NewTxTimeoutHeightDecorator(), | ||
authante.NewValidateMemoDecorator(opts.AccountKeeper), | ||
authante.NewConsumeGasForTxSizeDecorator(opts.AccountKeeper), | ||
authante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper), | ||
authante.NewSetPubKeyDecorator(opts.AccountKeeper), | ||
authante.NewValidateSigCountDecorator(opts.AccountKeeper), | ||
authante.NewSigGasConsumeDecorator(opts.AccountKeeper, sigGasConsumer), | ||
authante.NewSigVerificationDecorator(opts.AccountKeeper, opts.SignModeHandler), | ||
authante.NewIncrementSequenceDecorator(opts.AccountKeeper), | ||
ibcante.NewAnteDecorator(opts.IBCKeeper), | ||
} | ||
|
||
return sdk.ChainAnteDecorators(anteDecorators...), nil | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.