Skip to content

Commit

Permalink
Formatting with gofumpt (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat authored May 4, 2022
1 parent 56293b0 commit 83f7935
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 22 deletions.
9 changes: 9 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
# and commit this file to your remote git repository to share the goodness with others.

tasks:
- init: go get && go build ./... && go test ./... && make
command: go run


5 changes: 3 additions & 2 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ func NewMinCommissionDecorator(cdc codec.BinaryCodec) MinCommissionDecorator {

func (min MinCommissionDecorator) AnteHandle(
ctx sdk.Context, tx sdk.Tx,
simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
simulate bool, next sdk.AnteHandler,
) (newCtx sdk.Context, err error) {
msgs := tx.GetMsgs()
minCommissionRate := sdk.NewDecWithPrec(5, 2)

Expand Down Expand Up @@ -113,7 +114,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}

var sigGasConsumer = options.SigGasConsumer
sigGasConsumer := options.SigGasConsumer
if sigGasConsumer == nil {
sigGasConsumer = ante.DefaultSigVerificationGasConsumer
}
Expand Down
3 changes: 1 addition & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ func New(
appOpts servertypes.AppOptions,
baseAppOptions ...func(*baseapp.BaseApp),
) cosmoscmd.App {

appCodec := encodingConfig.Marshaler
cdc := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry
Expand Down Expand Up @@ -453,7 +452,7 @@ func New(

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
// we prefer to be more strict in what arguments the modules expect.
var skipGenesisInvariants = cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))
skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))

// NOTE: Any module instantiated in the module manager that is later modified
// must be passed by reference here.
Expand Down
1 change: 0 additions & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
func (app *App) ExportAppStateAndValidators(
forZeroHeight bool, jailAllowedAddrs []string,
) (servertypes.ExportedApp, error) {

// as if they could withdraw from the start of the next block
ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})

Expand Down
4 changes: 1 addition & 3 deletions app/upgrade/upgrade_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func ClawbackCoinFromAccount(ctx sdk.Context, accAddr sdk.AccAddress, staking *s
now := ctx.BlockHeader().Time

// this loop will complete all delegator's active redelegations
for _, activeRedelegation:= range staking.GetRedelegations(ctx, accAddr, 65535) {
for _, activeRedelegation := range staking.GetRedelegations(ctx, accAddr, 65535) {
// src/dest validator addresses of this redelegation
redelegationSrc, _ := sdk.ValAddressFromBech32(activeRedelegation.ValidatorSrcAddress)
redelegationDst, _ := sdk.ValAddressFromBech32(activeRedelegation.ValidatorDstAddress)
Expand Down Expand Up @@ -57,7 +57,6 @@ func ClawbackCoinFromAccount(ctx sdk.Context, accAddr sdk.AccAddress, staking *s
}
}


// this loop will complete all delegator's unbonding delegations
for _, unbondingDelegation := range staking.GetAllUnbondingDelegations(ctx, accAddr) {
// validator address of this unbonding delegation
Expand Down Expand Up @@ -133,5 +132,4 @@ func CreateUpgradeHandler(mm *module.Manager, configurator module.Configurator,
// override here
return newVM, err
}

}
2 changes: 0 additions & 2 deletions app/upgrade/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ func (suite *UpgradeTestSuite) TestAdjustFunds() {
tc.pre_adjust_funds()
tc.adjust_funds()
tc.post_adjust_funds()

})
}
}
Expand All @@ -144,7 +143,6 @@ func checkDelegation(
t *testing.T, app *junoapp.App, delegatorAddr sdk.AccAddress,
validatorAddr sdk.ValAddress, expFound bool, expShares sdk.Dec,
) {

ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{})
delegation, found := app.StakingKeeper.GetDelegation(ctxCheck, delegatorAddr, validatorAddr)
if expFound {
Expand Down
3 changes: 0 additions & 3 deletions x/mint/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func GetCmdQueryParams() *cobra.Command {

params := &types.QueryParamsRequest{}
res, err := queryClient.Params(cmd.Context(), params)

if err != nil {
return err
}
Expand Down Expand Up @@ -75,7 +74,6 @@ func GetCmdQueryInflation() *cobra.Command {

params := &types.QueryInflationRequest{}
res, err := queryClient.Inflation(cmd.Context(), params)

if err != nil {
return err
}
Expand Down Expand Up @@ -105,7 +103,6 @@ func GetCmdQueryAnnualProvisions() *cobra.Command {

params := &types.QueryAnnualProvisionsRequest{}
res, err := queryClient.AnnualProvisions(cmd.Context(), params)

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion x/mint/simulation/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ func TestParamChangest(t *testing.T) {
require.Equal(t, expected[i].simValue, p.SimValue()(r))
require.Equal(t, expected[i].subspace, p.Subspace())
}

}
4 changes: 1 addition & 3 deletions x/mint/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import (
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
)

var (
amino = codec.NewLegacyAmino()
)
var amino = codec.NewLegacyAmino()

func init() {
cryptocodec.RegisterCrypto(amino)
Expand Down
1 change: 0 additions & 1 deletion x/mint/types/minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func (m Minter) PhaseInflationRate(phase uint64) sdk.Dec {

// NextPhase returns the new phase.
func (m Minter) NextPhase(params Params, currentBlock uint64) uint64 {

nonePhase := m.Phase == 0
if nonePhase {
return 1
Expand Down
2 changes: 0 additions & 2 deletions x/mint/types/minter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ func BenchmarkPhaseInflation(b *testing.B) {
for n := 0; n < b.N; n++ {
minter.PhaseInflationRate(phase)
}

}

// Next annual provisions benchmarking
Expand All @@ -163,5 +162,4 @@ func BenchmarkNextAnnualProvisions(b *testing.B) {
for n := 0; n < b.N; n++ {
minter.NextAnnualProvisions(params, totalSupply)
}

}
2 changes: 0 additions & 2 deletions x/mint/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func ParamKeyTable() paramtypes.KeyTable {
func NewParams(
mintDenom string, blocksPerYear uint64,
) Params {

return Params{
MintDenom: mintDenom,
BlocksPerYear: blocksPerYear,
Expand All @@ -50,7 +49,6 @@ func (p Params) Validate() error {
}

return nil

}

// String implements the Stringer interface.
Expand Down

0 comments on commit 83f7935

Please sign in to comment.