Skip to content

Commit

Permalink
Merge remote-tracking branch 'osmosis/v0.42.9-osmo-v3' into faddat/v0…
Browse files Browse the repository at this point in the history
….42.x-modern-osmo
  • Loading branch information
faddat committed Jan 8, 2023
2 parents 64a4338 + 21486da commit aa5464a
Show file tree
Hide file tree
Showing 37 changed files with 63 additions and 55 deletions.
1 change: 1 addition & 0 deletions client/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func addHTTPDeprecationHeaders(h http.Handler) http.Handler {
// WithHTTPDeprecationHeaders returns a new *mux.Router, identical to its input
// but with the addition of HTTP Deprecation headers. This is used to mark legacy
// amino REST endpoints as deprecated in the REST API.
// nolint:gocritic
func WithHTTPDeprecationHeaders(r *mux.Router) *mux.Router {
subRouter := r.NewRoute().Subrouter()
subRouter.Use(addHTTPDeprecationHeaders)
Expand Down
14 changes: 8 additions & 6 deletions types/decimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func precisionMultiplier(prec int64) *big.Int {
return precisionMultipliers[prec]
}

// ______________________________________________________________________________________________
// _____________________________________________________________________________________________

// create a new Dec from integer assuming whole number
func NewDec(i int64) Dec {
Expand Down Expand Up @@ -201,7 +201,9 @@ func MustNewDecFromStr(s string) Dec {
return dec
}

// ______________________________________________________________________________________________
// _____________________________________________________________________________________________
//nolint

func (d Dec) IsNil() bool { return d.i == nil } // is decimal nil
func (d Dec) IsZero() bool { return (d.i).Sign() == 0 } // is equal to zero
func (d Dec) IsNegative() bool { return (d.i).Sign() == -1 } // is negative
Expand Down Expand Up @@ -643,7 +645,7 @@ func (d Dec) RoundInt() Int {
return NewIntFromBigInt(chopPrecisionAndRoundNonMutative(d.i))
}

// ___________________________________________________________________________________
// __________________________________________________________________________________

// similar to chopPrecisionAndRound, but always rounds down
func chopPrecisionAndTruncate(d *big.Int) *big.Int {
Expand Down Expand Up @@ -694,7 +696,7 @@ func (d Dec) Ceil() Dec {
return NewDecFromBigInt(quo.Add(quo, oneInt))
}

// ___________________________________________________________________________________
// __________________________________________________________________________________

// MaxSortableDec is the largest Dec that can be passed into SortableDecBytes()
// Its negative form is the least Dec that can be passed in.
Expand Down Expand Up @@ -734,7 +736,7 @@ func SortableDecBytes(dec Dec) []byte {
return []byte(fmt.Sprintf(fmt.Sprintf("%%0%ds", Precision*2+1), dec.String()))
}

// ___________________________________________________________________________________
// __________________________________________________________________________________

// reuse nil values
var nilJSON []byte
Expand Down Expand Up @@ -844,7 +846,7 @@ func (dp DecProto) String() string {
return dp.Dec.String()
}

// ___________________________________________________________________________________
// __________________________________________________________________________________
// helpers

// test if two decimal arrays are equal
Expand Down
2 changes: 1 addition & 1 deletion types/decimal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (s *decimalTestSuite) mustNewDecFromStr(str string) (d sdk.Dec) {
return d
}

// _______________________________________
// ______________________________________

func (s *decimalTestSuite) TestNewDecFromStr() {
largeBigInt, success := new(big.Int).SetString("3144605511029693144278234343371835", 10)
Expand Down
8 changes: 4 additions & 4 deletions types/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

// __________________________________________________________________________________________
// _________________________________________________________________________________________

// AppModuleBasic is the standard form for basic non-dependant elements of an application module.
type AppModuleBasic interface {
Expand Down Expand Up @@ -145,7 +145,7 @@ func (bm BasicManager) AddQueryCommands(rootQueryCmd *cobra.Command) {
}
}

// _________________________________________________________
// ________________________________________________________

// AppModuleGenesis is the standard form for an application module genesis functions
type AppModuleGenesis interface {
Expand Down Expand Up @@ -179,7 +179,7 @@ type AppModule interface {
EndBlock(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate
}

// ___________________________
// __________________________

// GenesisOnlyAppModule is an AppModule that only has import/export functionality
type GenesisOnlyAppModule struct {
Expand Down Expand Up @@ -216,7 +216,7 @@ func (GenesisOnlyAppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []ab
return []abci.ValidatorUpdate{}
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// Manager defines a module manager that provides the high level utility for managing and executing
// operations for a group of modules
Expand Down
2 changes: 1 addition & 1 deletion types/simulation/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (om OperationMsg) LogEvent(eventLogger func(route, op, evResult string)) {
eventLogger(om.Route, om.Name, pass)
}

// ________________________________________________________________________
// _______________________________________________________________________

// FutureOperation is an operation which will be ran at the beginning of the
// provided BlockHeight. If both a BlockHeight and BlockTime are specified, it
Expand Down
2 changes: 1 addition & 1 deletion types/uint.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (u *Uint) Size() int {
func (u Uint) MarshalAmino() ([]byte, error) { return u.Marshal() }
func (u *Uint) UnmarshalAmino(bz []byte) error { return u.Unmarshal(bz) }

// __________________________________________________________________________
// _________________________________________________________________________

// UintOverflow returns true if a given unsigned integer overflows and false
// otherwise.
Expand Down
4 changes: 2 additions & 2 deletions x/auth/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
types.RegisterInterfaces(registry)
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModule implements an application module for the auth module.
type AppModule struct {
Expand Down Expand Up @@ -156,7 +156,7 @@ func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.Validato
return []abci.ValidatorUpdate{}
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModuleSimulation functions

Expand Down
4 changes: 2 additions & 2 deletions x/auth/vesting/types/vesting_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ func (cva ContinuousVestingAccount) Validate() error {
}

// AddToOriginalVestedCoins adds more coins to an account that are subject to its initial vesting schedule
func (pva *ContinuousVestingAccount) AddToOriginalVestedCoins(coins sdk.Coins) {
func (cva *ContinuousVestingAccount) AddToOriginalVestedCoins(coins sdk.Coins) {
panic("AddToOriginalVestedCoins not implemented for ContinuousVestingAccount")
// pva.OriginalVesting = pva.OriginalVesting.Add(coins...)
// cva.OriginalVesting = cva.OriginalVesting.Add(coins...)
}

func (cva ContinuousVestingAccount) String() string {
Expand Down
4 changes: 2 additions & 2 deletions x/bank/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
types.RegisterInterfaces(registry)
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModule implements an application module for the bank module.
type AppModule struct {
Expand Down Expand Up @@ -160,7 +160,7 @@ func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.Validato
return []abci.ValidatorUpdate{}
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModuleSimulation functions

Expand Down
2 changes: 1 addition & 1 deletion x/crisis/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func createTestApp() (*simapp.SimApp, sdk.Context, []sdk.AccAddress) {
return app, ctx, addrs
}

// ____________________________________________________________________________
// ___________________________________________________________________________

func TestHandleMsgVerifyInvariant(t *testing.T) {
app, ctx, addrs := createTestApp()
Expand Down
2 changes: 1 addition & 1 deletion x/crisis/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (k Keeper) VerifyInvariant(goCtx context.Context, msg *types.MsgVerifyInvar
// logger := ctx.Logger().With("module", "x/crisis")
// logger.Error(fmt.Sprintf(
// "WARNING: insufficient funds to allocate to sender from fee pool, err: %s", err))
//}
// }

// TODO replace with circuit breaker
panic(res)
Expand Down
2 changes: 1 addition & 1 deletion x/crisis/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
types.RegisterInterfaces(registry)
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModule implements an application module for the crisis module.
type AppModule struct {
Expand Down
4 changes: 2 additions & 2 deletions x/distribution/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry)
types.RegisterInterfaces(registry)
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModule implements an application module for the distribution module.
type AppModule struct {
Expand Down Expand Up @@ -172,7 +172,7 @@ func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.Validato
return []abci.ValidatorUpdate{}
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModuleSimulation functions

Expand Down
2 changes: 1 addition & 1 deletion x/evidence/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val
return []abci.ValidatorUpdate{}
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModuleSimulation functions

Expand Down
2 changes: 1 addition & 1 deletion x/genutil/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil }
// GetQueryCmd returns no root query command for the genutil module.
func (AppModuleBasic) GetQueryCmd() *cobra.Command { return nil }

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModule implements an application module for the genutil module.
type AppModule struct {
Expand Down
4 changes: 2 additions & 2 deletions x/gov/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (a AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry
types.RegisterInterfaces(registry)
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModule implements an application module for the gov module.
type AppModule struct {
Expand Down Expand Up @@ -187,7 +187,7 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val
return []abci.ValidatorUpdate{}
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModuleSimulation functions

Expand Down
4 changes: 2 additions & 2 deletions x/ibc/applications/transfer/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.V
return []abci.ValidatorUpdate{}
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModuleSimulation functions

Expand Down Expand Up @@ -183,7 +183,7 @@ func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.Weig
return nil
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// ValidateTransferChannelParams does validation of a newly created transfer channel. A transfer
// channel must be UNORDERED, use the correct port (by default 'transfer'), and use the current
Expand Down
2 changes: 1 addition & 1 deletion x/ibc/core/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.V
return []abci.ValidatorUpdate{}
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModuleSimulation functions

Expand Down
2 changes: 1 addition & 1 deletion x/ibc/testing/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.V
return []abci.ValidatorUpdate{}
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// OnChanOpenInit implements the IBCModule interface.
func (am AppModule) OnChanOpenInit(
Expand Down
6 changes: 3 additions & 3 deletions x/mint/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewKeeper(
}
}

// ______________________________________________________________________
// _____________________________________________________________________

// Logger returns a module-specific logger.
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
Expand All @@ -71,7 +71,7 @@ func (k Keeper) SetMinter(ctx sdk.Context, minter types.Minter) {
store.Set(types.MinterKey, b)
}

// ______________________________________________________________________
// _____________________________________________________________________

// GetParams returns the total set of minting parameters.
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
Expand All @@ -84,7 +84,7 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramSpace.SetParamSet(ctx, &params)
}

// ______________________________________________________________________
// _____________________________________________________________________

// StakingTokenSupply implements an alias call to the underlying staking keeper's
// StakingTokenSupply to be used in BeginBlocker.
Expand Down
4 changes: 2 additions & 2 deletions x/mint/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command {
return cli.GetQueryCmd()
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModule implements an application module for the mint module.
type AppModule struct {
Expand Down Expand Up @@ -156,7 +156,7 @@ func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.Validato
return []abci.ValidatorUpdate{}
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModuleSimulation functions

Expand Down
2 changes: 1 addition & 1 deletion x/params/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (am AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistr
proposal.RegisterInterfaces(registry)
}

// ____________________________________________________________________________
// ___________________________________________________________________________

// AppModule implements an application module for the distribution module.
type AppModule struct {
Expand Down
2 changes: 1 addition & 1 deletion x/params/simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func SimulateParamChangeProposalContent(paramChangePool []simulation.ParamChange
title := fmt.Sprintf("title from SimulateParamChangeProposalContent-%d", numProposals)
desc := fmt.Sprintf("desc from SimulateParamChangeProposalContent-%d. Random short desc: %s",
numProposals, simulation.RandStringOfLength(r, 20))
numProposals += 1
numProposals++
return proposal.NewParameterChangeProposal(
title, // title
desc, // description
Expand Down
2 changes: 1 addition & 1 deletion x/simulation/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func createLogFile() *os.File {
return f
}

// _____________________
// ____________________
// dummy log writter
type DummyLogWriter struct{}

Expand Down
2 changes: 1 addition & 1 deletion x/simulation/mock_tendermint.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (vals mockValidators) getKeys() []string {
return keys
}

// _________________________________________________________________________________
// ________________________________________________________________________________

// randomProposer picks a random proposer from the current validator set
func (vals mockValidators) randomProposer(r *rand.Rand) tmbytes.HexBytes {
Expand Down
4 changes: 2 additions & 2 deletions x/simulation/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (oe OperationEntry) MustMarshal() json.RawMessage {
return out
}

// _____________________________________________________________________
// ____________________________________________________________________

// OperationQueue defines an object for a queue of operations
type OperationQueue map[int][]simulation.Operation
Expand Down Expand Up @@ -107,7 +107,7 @@ func queueOperations(queuedOps OperationQueue, queuedTimeOps []simulation.Future
}
}

// ________________________________________________________________________
// _______________________________________________________________________

// WeightedOperation is an operation with associated weight.
// This is used to bias the selection operation within the simulator.
Expand Down
2 changes: 1 addition & 1 deletion x/simulation/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func SimulateFromSeed(
return false, exportedParams, nil
}

// ______________________________________________________________________________
// _____________________________________________________________________________

type blockSimFn func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context,
accounts []simulation.Account, header tmproto.Header) (opCount int)
Expand Down
Loading

0 comments on commit aa5464a

Please sign in to comment.