Skip to content

Commit

Permalink
fix: MsgUpsertMarketsResponse (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Johnson authored Aug 8, 2024
1 parent 2ab99d5 commit bf43357
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 127 deletions.
1 change: 1 addition & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -959,3 +959,4 @@ zerolog
ZFvy
zondax
zstd
sortkeys
22 changes: 13 additions & 9 deletions proto/slinky/marketmap/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ service Msg {
rpc RemoveMarketAuthorities(MsgRemoveMarketAuthorities)
returns (MsgRemoveMarketAuthoritiesResponse);

// UpsertMarkets wraps both Create / Update markets into a single message. Specifically
// if a market does not exist it will be created, otherwise it will be updated. The response
// will be a map between ticker -> updated.
// UpsertMarkets wraps both Create / Update markets into a single message.
// Specifically if a market does not exist it will be created, otherwise it
// will be updated. The response will be a map between ticker -> updated.
rpc UpsertMarkets(MsgUpsertMarkets) returns (MsgUpsertMarketsResponse);
}

// MsgUpsertMarkets defines a message carrying a payload for performing market upserts (update or
// create if does not exist) in the x/marketmap module.
// MsgUpsertMarkets defines a message carrying a payload for performing market
// upserts (update or create if does not exist) in the x/marketmap module.
message MsgUpsertMarkets {
option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "slinky/x/marketmap/MsgUpsertMarkets";
Expand All @@ -49,13 +49,17 @@ message MsgUpsertMarkets {

// CreateMarkets is the list of all markets to be created for the given
// transaction.
repeated Market markets = 2 [ (gogoproto.nullable) = false ];
repeated Market markets = 2 [ (gogoproto.nullable) = false ];
}

// MsgUpsertMarketsResponse is the response from the UpsertMarkets API in the x/marketmap module.
// MsgUpsertMarketsResponse is the response from the UpsertMarkets API in the
// x/marketmap module.
message MsgUpsertMarketsResponse {
// UpdatedMarkets is a map between the ticker and whether the market was updated.
map<string, bool> market_updates = 1;
option (gogoproto.stable_marshaler) = true;
// UpdatedMarkets is a map between the ticker and whether the market was
// updated.
// Deprecated: This field will be empty in all responses.
map<string, bool> market_updates = 1 [ deprecated = true ];
}

// MsgCreateMarkets defines a message carrying a payload for creating markets in
Expand Down
1 change: 0 additions & 1 deletion providers/apis/defi/osmosis/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"time"

"github.com/stretchr/testify/mock"

"github.com/stretchr/testify/require"
"go.uber.org/zap"

Expand Down
16 changes: 8 additions & 8 deletions tests/integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ go 1.22.5
require (
cosmossdk.io/math v1.3.0
github.com/cometbft/cometbft v0.38.10
github.com/cosmos/cosmos-sdk v0.50.8
github.com/cosmos/cosmos-sdk v0.50.9
github.com/pelletier/go-toml/v2 v2.2.2
github.com/skip-mev/slinky v1.0.4
github.com/strangelove-ventures/interchaintest/v8 v8.5.0
Expand All @@ -31,14 +31,14 @@ require (
cloud.google.com/go/storage v1.38.0 // indirect
cosmossdk.io/api v0.7.5 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/core v0.11.0 // indirect
cosmossdk.io/core v0.11.1 // indirect
cosmossdk.io/depinject v1.0.0 // indirect
cosmossdk.io/errors v1.0.1 // indirect
cosmossdk.io/log v1.3.1 // indirect
cosmossdk.io/log v1.4.0 // indirect
cosmossdk.io/store v1.1.0 // indirect
cosmossdk.io/x/evidence v0.1.0 // indirect
cosmossdk.io/x/feegrant v0.1.0 // indirect
cosmossdk.io/x/tx v0.13.3 // indirect
cosmossdk.io/x/tx v0.13.4 // indirect
cosmossdk.io/x/upgrade v0.1.4 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
Expand Down Expand Up @@ -75,7 +75,7 @@ require (
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/gogoproto v1.5.0 // indirect
github.com/cosmos/gogoproto v1.6.0 // indirect
github.com/cosmos/iavl v1.1.3 // indirect
github.com/cosmos/ibc-go/modules/capability v1.0.1 // indirect
github.com/cosmos/ibc-go/v8 v8.3.2 // indirect
Expand Down Expand Up @@ -201,14 +201,14 @@ require (
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/cors v1.11.0 // indirect
github.com/rs/zerolog v1.32.0 // indirect
github.com/rs/zerolog v1.33.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.19.0 // indirect
Expand All @@ -235,7 +235,7 @@ require (
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
Expand Down
32 changes: 16 additions & 16 deletions tests/integration/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ cosmossdk.io/client/v2 v2.0.0-beta.4 h1:LGIzWbVTOof/IHQZeoWwxPX0fq607ONXhsfA7eUr
cosmossdk.io/client/v2 v2.0.0-beta.4/go.mod h1:c753d0sBv3AQRx6X+BOKL1aGpKjZMTZAHGiLPbVi5TE=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA=
cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0=
cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050=
cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8=
cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0=
cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U=
cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI=
cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM=
cosmossdk.io/log v1.4.0 h1:Ttt9d6fQ0GlktwhcysOeNiIjixW7l0rYBocmoXOb11k=
cosmossdk.io/log v1.4.0/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU=
cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE=
cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k=
cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk=
Expand All @@ -210,8 +210,8 @@ cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk=
cosmossdk.io/x/evidence v0.1.0/go.mod h1:hTaiiXsoiJ3InMz1uptgF0BnGqROllAN8mwisOMMsfw=
cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk=
cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU=
cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g=
cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys=
cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y=
cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk=
cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38=
cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
Expand Down Expand Up @@ -370,16 +370,16 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK
github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA=
github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA=
github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec=
github.com/cosmos/cosmos-sdk v0.50.8 h1:2UJHssUaGHTl4/dFp8xyREKAnfiRU6VVfqtKG9n8w5g=
github.com/cosmos/cosmos-sdk v0.50.8/go.mod h1:Zb+DgHtiByNwgj71IlJBXwOq6dLhtyAq3AgqpXm/jHo=
github.com/cosmos/cosmos-sdk v0.50.9 h1:gt2usjz0H0qW6KwAxWw7ZJ3XU8uDwmhN+hYG3nTLeSg=
github.com/cosmos/cosmos-sdk v0.50.9/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI=
github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU=
github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o=
github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I=
github.com/cosmos/gogoproto v1.6.0 h1:Xm0F/96O5Ox4g6xGgjA41rWaaPjYtOdTi59uBcV2qEE=
github.com/cosmos/gogoproto v1.6.0/go.mod h1:Y+g956rcUf2vr4uwtCcK/1Xx9BWVluCtcI9vsh0GHmk=
github.com/cosmos/iavl v1.1.3 h1:MnROShfUCkQTM3N9aPK/qPYMRaPxh7e3AzM7dejfYr8=
github.com/cosmos/iavl v1.1.3/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM=
github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI=
Expand Down Expand Up @@ -1003,8 +1003,8 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po=
github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0=
github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
Expand Down Expand Up @@ -1038,8 +1038,8 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w=
github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
Expand Down Expand Up @@ -1314,8 +1314,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/slinky_ccv_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
oracletypes "github.com/skip-mev/slinky/x/oracle/types"
)

// Type SlinkyCCVSuite is a testing-suite for testing slinky's integration with ics consumer chains
// SlinkyCCVSuite is a testing-suite for testing slinky's integration with ics consumer chains
type SlinkyCCVSuite struct {
*SlinkyIntegrationSuite
}
Expand Down
13 changes: 5 additions & 8 deletions tests/integration/slinky_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
"testing"
"time"

"github.com/skip-mev/slinky/providers/static"

abcitypes "github.com/cometbft/cometbft/abci/types"
cmtabci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/rand"
Expand All @@ -24,26 +22,25 @@ import (
interchaintest "github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testreporter"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"

"github.com/strangelove-ventures/interchaintest/v8/testreporter"

compression "github.com/skip-mev/slinky/abci/strategies/codec"
slinkyabci "github.com/skip-mev/slinky/abci/ve/types"
oracleconfig "github.com/skip-mev/slinky/oracle/config"
slinkytypes "github.com/skip-mev/slinky/pkg/types"
"github.com/skip-mev/slinky/providers/static"
mmtypes "github.com/skip-mev/slinky/x/marketmap/types"
oracletypes "github.com/skip-mev/slinky/x/oracle/types"
)

const (
oracleConfigPath = "oracle.json"
marketMapPath = "market.json"
appConfigPath = "config/app.toml"
)

Expand Down Expand Up @@ -407,9 +404,9 @@ func (s *SlinkyIntegrationSuite) AddCurrencyPairs(chain *cosmos.CosmosChain, use
}

func (s *SlinkyIntegrationSuite) UpdateCurrencyPair(chain *cosmos.CosmosChain, markets []mmtypes.Market) error {
msg := &mmtypes.MsgUpdateMarkets{
Authority: s.user.FormattedAddress(),
UpdateMarkets: markets,
msg := &mmtypes.MsgUpsertMarkets{
Authority: s.user.FormattedAddress(),
Markets: markets,
}

tx := CreateTx(s.T(), s.chain, s.user, gasPrice, msg)
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/slinky_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"syscall"
"time"

"github.com/skip-mev/slinky/providers/apis/marketmap"

"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/bech32"
Expand All @@ -25,6 +23,7 @@ import (
oracleconfig "github.com/skip-mev/slinky/oracle/config"
"github.com/skip-mev/slinky/oracle/types"
slinkytypes "github.com/skip-mev/slinky/pkg/types"
"github.com/skip-mev/slinky/providers/apis/marketmap"
"github.com/skip-mev/slinky/providers/static"
mmtypes "github.com/skip-mev/slinky/x/marketmap/types"
oracletypes "github.com/skip-mev/slinky/x/oracle/types"
Expand Down
8 changes: 1 addition & 7 deletions x/marketmap/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ func (ms msgServer) UpsertMarkets(goCtx context.Context, msg *types.MsgUpsertMar
return nil, fmt.Errorf("unable to verify market authorities: %w", err)
}

resp := &types.MsgUpsertMarketsResponse{
MarketUpdates: make(map[string]bool),
}

// iterate over all markets and either create them (if no market exists), or update them
for _, market := range msg.Markets {
// check if market exists
Expand All @@ -59,7 +55,6 @@ func (ms msgServer) UpsertMarkets(goCtx context.Context, msg *types.MsgUpsertMar
return nil, err
}

resp.MarketUpdates[market.Ticker.String()] = false
eventType = types.EventTypeCreateMarket
} else {
err = ms.k.UpdateMarket(ctx, market)
Expand All @@ -72,7 +67,6 @@ func (ms msgServer) UpsertMarkets(goCtx context.Context, msg *types.MsgUpsertMar
return nil, err
}

resp.MarketUpdates[market.Ticker.String()] = true
eventType = types.EventTypeUpdateMarket
}

Expand All @@ -91,7 +85,7 @@ func (ms msgServer) UpsertMarkets(goCtx context.Context, msg *types.MsgUpsertMar
return nil, err
}

return resp, ms.k.SetLastUpdated(ctx, uint64(ctx.BlockHeight()))
return &types.MsgUpsertMarketsResponse{}, ms.k.SetLastUpdated(ctx, uint64(ctx.BlockHeight()))
}

// CreateMarkets updates the marketmap by creating markets from the given message. All updates are made to the market
Expand Down
9 changes: 2 additions & 7 deletions x/marketmap/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,7 @@ func (s *KeeperTestSuite) TestMsgServerUpsertMarkets() {
s.Require().NoError(err)
s.Require().NotNil(resp)

// expect response to contain the market
s.Require().Len(resp.MarketUpdates, 1)
s.Require().False(resp.MarketUpdates[btcusdt.String()])
s.Require().Len(resp.MarketUpdates, 0)

// check that the market now exists
found, err := s.keeper.HasMarket(s.ctx, btcusdt.Ticker.String())
Expand Down Expand Up @@ -465,10 +463,7 @@ func (s *KeeperTestSuite) TestMsgServerUpsertMarkets() {
s.Require().NoError(err)
s.Require().NotNil(resp)

// expect response to contain the market
s.Require().Len(resp.MarketUpdates, 2)
s.Require().True(resp.MarketUpdates[btcusdt.Ticker.String()])
s.Require().False(resp.MarketUpdates[ethusdt.Ticker.String()])
s.Require().Len(resp.MarketUpdates, 0)

// check that the market still exists
found, err := s.keeper.HasMarket(s.ctx, btcusdt.Ticker.String())
Expand Down
Loading

0 comments on commit bf43357

Please sign in to comment.