feat(bb): Defer in proposal handlers, more interfaces for lanes, clean up (#165)

This commit is contained in:
David Terpay
2023-06-07 13:47:34 +00:00
committed by GitHub
parent 61b6759e92
commit b7780a3140
41 changed files with 1798 additions and 3320 deletions
+2 -2
View File
@@ -4,11 +4,11 @@ import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/skip-mev/pob/mempool"
"github.com/skip-mev/pob/x/builder/types"
)
// ValidateBidInfo validates that the bid can be included in the auction.
func (k Keeper) ValidateBidInfo(ctx sdk.Context, highestBid sdk.Coin, bidInfo *mempool.AuctionBidInfo) error {
func (k Keeper) ValidateBidInfo(ctx sdk.Context, highestBid sdk.Coin, bidInfo *types.BidInfo) error {
// Validate the bundle size.
maxBundleSize, err := k.GetMaxBundleSize(ctx)
if err != nil {
+3 -4
View File
@@ -5,10 +5,9 @@ import (
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/skip-mev/pob/mempool"
testutils "github.com/skip-mev/pob/testutils"
"github.com/skip-mev/pob/x/builder/keeper"
buildertypes "github.com/skip-mev/pob/x/builder/types"
"github.com/skip-mev/pob/x/builder/types"
)
func (suite *KeeperTestSuite) TestValidateBidInfo() {
@@ -162,7 +161,7 @@ func (suite *KeeperTestSuite) TestValidateBidInfo() {
suite.stakingKeeper,
suite.authorityAccount.String(),
)
params := buildertypes.Params{
params := types.Params{
MaxBundleSize: maxBundleSize,
ReserveFee: reserveFee,
EscrowAccountAddress: escrowAddress.String(),
@@ -191,7 +190,7 @@ func (suite *KeeperTestSuite) TestValidateBidInfo() {
signers[index] = txSigners
}
bidInfo := &mempool.AuctionBidInfo{
bidInfo := &types.BidInfo{
Bidder: bidder.Address,
Bid: bid,
Transactions: bundle,
-5
View File
@@ -7,7 +7,6 @@ import (
"github.com/cosmos/cosmos-sdk/testutil"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/golang/mock/gomock"
"github.com/skip-mev/pob/mempool"
testutils "github.com/skip-mev/pob/testutils"
"github.com/skip-mev/pob/x/builder/keeper"
"github.com/skip-mev/pob/x/builder/types"
@@ -28,8 +27,6 @@ type KeeperTestSuite struct {
msgServer types.MsgServer
key *storetypes.KVStoreKey
authorityAccount sdk.AccAddress
mempool *mempool.AuctionMempool
}
func TestKeeperTestSuite(t *testing.T) {
@@ -64,7 +61,5 @@ func (suite *KeeperTestSuite) SetupTest() {
err := suite.builderKeeper.SetParams(suite.ctx, types.DefaultParams())
suite.Require().NoError(err)
config := mempool.NewDefaultAuctionFactory(suite.encCfg.TxConfig.TxDecoder())
suite.mempool = mempool.NewAuctionMempool(suite.encCfg.TxConfig.TxDecoder(), suite.encCfg.TxConfig.TxEncoder(), 0, config)
suite.msgServer = keeper.NewMsgServerImpl(suite.builderKeeper)
}