Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump github.com/skip-mev/slinky from 1.0.13 to 1.1.0 #784

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
replace unsafe market query with the safe one
  • Loading branch information
pr0n00gler committed Jan 23, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit acba34a04d0ff3069edb94dbdf3a2692d1a67f45
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -477,6 +477,7 @@ func New(
overrideWasmVariables()

appCodec := encodingConfig.Marshaler

legacyAmino := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry

1 change: 0 additions & 1 deletion wasmbinding/bindings/query.go
Original file line number Diff line number Diff line change
@@ -67,7 +67,6 @@ type OracleQuery struct {
}

type MarketMapQuery struct {
MarketMap *marketmaptypes.MarketMapRequest `json:"market_map,omitempty"`
LastUpdated *marketmaptypes.LastUpdatedRequest `json:"last_updated,omitempty"`
Params *marketmaptypes.ParamsRequest `json:"params,omitempty"`
Market *marketmaptypes.MarketRequest `json:"market,omitempty"`
2 changes: 0 additions & 2 deletions wasmbinding/queries.go
Original file line number Diff line number Diff line change
@@ -231,8 +231,6 @@ func (qp *QueryPlugin) MarketMapQuery(ctx sdk.Context, query bindings.MarketMapQ
return processResponse(marketMapQueryServer.Params(ctx, query.Params))
case query.LastUpdated != nil:
return processResponse(marketMapQueryServer.LastUpdated(ctx, query.LastUpdated))
case query.MarketMap != nil:
return processResponse(marketMapQueryServer.MarketMap(ctx, query.MarketMap))
case query.Market != nil:
return processResponse(marketMapQueryServer.Market(ctx, query.Market))
default:
2 changes: 1 addition & 1 deletion wasmbinding/stargate_allowlist.go
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ func AcceptedStargateQueries() wasmkeeper.AcceptedQueries {
"/slinky.oracle.v1.Query/GetPrices": &oracletypes.GetPricesResponse{},

// marketmap
"/slinky.marketmap.v1.Query/MarketMap": &marketmaptypes.MarketMapResponse{},
"/slinky.marketmap.v1.Query/Markets": &marketmaptypes.MarketsResponse{},
"/slinky.marketmap.v1.Query/LastUpdated": &marketmaptypes.LastUpdatedResponse{},
"/slinky.marketmap.v1.Query/Params": &marketmaptypes.ParamsResponse{},
"/slinky.marketmap.v1.Query/Market": &marketmaptypes.MarketResponse{},
2 changes: 1 addition & 1 deletion x/dex/keeper/limit_order_tranche.go
Original file line number Diff line number Diff line change
@@ -212,7 +212,7 @@ func NewTrancheKey(ctx sdk.Context) string {
blockGas := utils.MustGetBlockGasUsed(ctx)
totalGas := blockGas + txGas

blockStr := utils.Uint64ToSortableString(uint64(blockHeight))
blockStr := utils.Uint64ToSortableString(uint64(blockHeight)) //nolint:gosec
gasStr := utils.Uint64ToSortableString(totalGas)

return fmt.Sprintf("%s%s", blockStr, gasStr)
2 changes: 1 addition & 1 deletion x/dex/types/keys.go
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ func KeyPrefix(p string) []byte {
func TickIndexToBytes(tickTakerToMaker int64) []byte {
key := make([]byte, 9)
if tickTakerToMaker < 0 {
copy(key[1:], sdk.Uint64ToBigEndian(uint64(tickTakerToMaker)))
copy(key[1:], sdk.Uint64ToBigEndian(uint64(tickTakerToMaker))) //nolint:gosec
} else {
copy(key[:1], []byte{0x01})
copy(key[1:], sdk.Uint64ToBigEndian(uint64(tickTakerToMaker)))
4 changes: 2 additions & 2 deletions x/dex/types/price.go
Original file line number Diff line number Diff line change
@@ -102,12 +102,12 @@ func CalcTickIndexFromPrice(price math_utils.PrecDec) (int64, error) {
invPrice := math_utils.OnePrecDec().Quo(price)
tick := BinarySearchPriceToTick(invPrice)
// flip the sign back the other direction
return int64(tick) * -1, nil
return int64(tick) * -1, nil //nolint:gosec
}

tick := BinarySearchPriceToTick(price)

return int64(tick), nil
return int64(tick), nil //nolint:gosec
}

func MustCalcPrice(relativeTickIndex int64) math_utils.PrecDec {
Loading