feat(docs): rename x/builder -> x/auction (#55)

* rename x/builder -> x/auction

* update proto / etc.

* integratino fix

---------

Co-authored-by: David Terpay <david.terpay@gmail.com>
This commit is contained in:
Nikhil Vasan
2023-09-12 14:37:25 -04:00
committed by GitHub
co-authored by David Terpay
parent 21b9b6f882
commit 3c6f319ff1
57 changed files with 845 additions and 846 deletions
+7 -7
View File
@@ -26,7 +26,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
buildertypes "github.com/skip-mev/block-sdk/x/builder/types"
auctiontypes "github.com/skip-mev/block-sdk/x/auction/types"
)
// ChainBuilderFromChainSpec creates an interchaintest chain builder factory given a ChainSpec
@@ -149,7 +149,7 @@ type Tx struct {
}
// CreateAuctionBidMsg creates a new AuctionBid tx signed by the given user, the order of txs in the MsgAuctionBid will be determined by the contents + order of the MessageForUsers
func CreateAuctionBidMsg(t *testing.T, ctx context.Context, searcher cosmos.User, chain *cosmos.CosmosChain, bid sdk.Coin, txsPerUser []Tx) (*buildertypes.MsgAuctionBid, [][]byte) {
func CreateAuctionBidMsg(t *testing.T, ctx context.Context, searcher cosmos.User, chain *cosmos.CosmosChain, bid sdk.Coin, txsPerUser []Tx) (*auctiontypes.MsgAuctionBid, [][]byte) {
// for each MessagesForUser get the signed bytes
txs := make([][]byte, len(txsPerUser))
for i, tx := range txsPerUser {
@@ -161,7 +161,7 @@ func CreateAuctionBidMsg(t *testing.T, ctx context.Context, searcher cosmos.User
require.NoError(t, err)
// create a message auction bid
return buildertypes.NewMsgAuctionBid(
return auctiontypes.NewMsgAuctionBid(
accAddr,
bid,
txs,
@@ -221,8 +221,8 @@ func BroadcastTxs(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain,
return txs
}
// QueryBuilderParams queries the x/builder module's params
func QueryBuilderParams(t *testing.T, chain ibc.Chain) buildertypes.Params {
// QueryAuctionParams queries the x/auction module's params
func QueryAuctionParams(t *testing.T, chain ibc.Chain) auctiontypes.Params {
// cast chain to cosmos-chain
cosmosChain, ok := chain.(*cosmos.CosmosChain)
require.True(t, ok)
@@ -230,11 +230,11 @@ func QueryBuilderParams(t *testing.T, chain ibc.Chain) buildertypes.Params {
nodes := cosmosChain.Nodes()
require.True(t, len(nodes) > 0)
// make params query to first node
resp, _, err := nodes[0].ExecQuery(context.Background(), "builder", "params")
resp, _, err := nodes[0].ExecQuery(context.Background(), "auction", "params")
require.NoError(t, err)
// unmarshal params
var params buildertypes.Params
var params auctiontypes.Params
err = json.Unmarshal(resp, &params)
require.NoError(t, err)
return params
+4 -4
View File
@@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/suite"
"github.com/skip-mev/block-sdk/tests/integration"
buildertypes "github.com/skip-mev/block-sdk/x/builder/types"
auctiontypes "github.com/skip-mev/block-sdk/x/auction/types"
)
var (
@@ -31,7 +31,7 @@ var (
genesisKV = []cosmos.GenesisKV{
{
Key: "app_state.builder.params.max_bundle_size",
Key: "app_state.auction.params.max_bundle_size",
Value: 3,
},
}
@@ -70,8 +70,8 @@ var (
func MakeEncodingConfig() *testutil.TestEncodingConfig {
cfg := cosmos.DefaultEncoding()
// register builder types
buildertypes.RegisterInterfaces(cfg.InterfaceRegistry)
// register auction types
auctiontypes.RegisterInterfaces(cfg.InterfaceRegistry)
return &cfg
}
+5 -5
View File
@@ -76,7 +76,7 @@ func (s *IntegrationTestSuite) SetupSubTest() {
func (s *IntegrationTestSuite) TestQueryParams() {
// query params
params := QueryBuilderParams(s.T(), s.chain)
params := QueryAuctionParams(s.T(), s.chain)
// expect validate to pass
require.NoError(s.T(), params.Validate())
@@ -90,7 +90,7 @@ func (s *IntegrationTestSuite) TestQueryParams() {
// 3. The balance of the escrow account should be updated correctly.
// 4. Top of block bids will be included in block proposals before other transactions
func (s *IntegrationTestSuite) TestValidBids() {
params := QueryBuilderParams(s.T(), s.chain)
params := QueryAuctionParams(s.T(), s.chain)
escrowAddr := sdk.AccAddress(params.EscrowAccountAddress).String()
s.Run("Valid Auction Bid", func() {
@@ -322,7 +322,7 @@ func (s *IntegrationTestSuite) TestValidBids() {
// 5. If there is a block that has multiple valid bids with timeouts that are sufficiently far apart,
// the bids should be executed respecting the highest bids until the timeout is reached.
func (s *IntegrationTestSuite) TestMultipleBids() {
params := QueryBuilderParams(s.T(), s.chain)
params := QueryAuctionParams(s.T(), s.chain)
escrowAddr := sdk.AccAddress(params.EscrowAccountAddress).String()
s.Run("broadcasting bids to two different validators (both should execute over several blocks) with same bid", func() {
@@ -664,7 +664,7 @@ func (s *IntegrationTestSuite) TestMultipleBids() {
}
func (s *IntegrationTestSuite) TestInvalidBids() {
params := QueryBuilderParams(s.T(), s.chain)
params := QueryAuctionParams(s.T(), s.chain)
escrowAddr := sdk.AccAddress(params.EscrowAccountAddress).String()
s.Run("searcher is attempting to submit a bundle that includes another bid tx", func() {
@@ -1001,7 +1001,7 @@ func (s *IntegrationTestSuite) TestLanes() {
delegation := sdk.NewCoin(s.denom, sdk.NewInt(100))
params := QueryBuilderParams(s.T(), s.chain)
params := QueryAuctionParams(s.T(), s.chain)
s.Run("block with mev, free, and normal tx", func() {
user2BalanceBefore := QueryAccountBalance(s.T(), s.chain.(*cosmos.CosmosChain), s.user2.FormattedAddress(), s.denom)