Skip to content

Commit

Permalink
Integrated CosmWasm v0.28.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Oct 9, 2022
1 parent 2ae2d41 commit 92832c4
Show file tree
Hide file tree
Showing 14 changed files with 356 additions and 541 deletions.
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
go install -mod=readonly -tags="${BUILD_TAGS}" -ldflags="${LD_FLAGS}" -trimpath ./cmd/sentinelhub

.PHONY: go-lint
go-lint:
Expand Down
14 changes: 10 additions & 4 deletions ante_handler.go → ante.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
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"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
Expand All @@ -10,18 +12,20 @@ import (

type HandlerOptions struct {
ante.HandlerOptions
IBCKeeper *ibckeeper.Keeper
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 AnteHandler")
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 AnteHandler")
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 builder")
return nil, errors.Wrap(errors.ErrLogic, "sign mode handler is required for ante handler")
}

var sigGasConsumer = opts.SigGasConsumer
Expand All @@ -31,6 +35,8 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(),
wasmkeeper.NewLimitSimulationGasDecorator(opts.WasmConfig.SimulationGasLimit),
wasmkeeper.NewCountTXDecorator(opts.TxCounterStoreKey),
ante.NewRejectExtensionOptionsDecorator(),
ante.NewMempoolFeeDecorator(),
ante.NewValidateBasicDecorator(),
Expand Down
Loading

0 comments on commit 92832c4

Please sign in to comment.