[ENG-653]: Rename to builder module (#41)
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/skip-mev/pob/mempool"
|
||||
testutils "github.com/skip-mev/pob/testutils"
|
||||
auctiontypes "github.com/skip-mev/pob/x/auction/types"
|
||||
buildertypes "github.com/skip-mev/pob/x/builder/types"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
@@ -158,7 +158,7 @@ func (suite *IntegrationTestSuite) TestAuctionMempoolSelect() {
|
||||
tx := auctionIterator.Tx()
|
||||
suite.Require().Len(tx.GetMsgs(), 1)
|
||||
|
||||
msgAuctionBid := tx.GetMsgs()[0].(*auctiontypes.MsgAuctionBid)
|
||||
msgAuctionBid := tx.GetMsgs()[0].(*buildertypes.MsgAuctionBid)
|
||||
if highestBid == nil {
|
||||
highestBid = msgAuctionBid.Bid
|
||||
prevBid = msgAuctionBid.Bid
|
||||
|
||||
+4
-4
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/signing"
|
||||
auctiontypes "github.com/skip-mev/pob/x/auction/types"
|
||||
buildertypes "github.com/skip-mev/pob/x/builder/types"
|
||||
)
|
||||
|
||||
// WrappedBidTx defines a wrapper around an sdk.Tx that contains a single
|
||||
@@ -28,10 +28,10 @@ func (wbtx *WrappedBidTx) GetBid() sdk.Coins { return wbtx.bid }
|
||||
// GetMsgAuctionBidFromTx attempts to retrieve a MsgAuctionBid from an sdk.Tx if
|
||||
// one exists. If a MsgAuctionBid does exist and other messages are also present,
|
||||
// an error is returned. If no MsgAuctionBid is present, <nil, nil> is returned.
|
||||
func GetMsgAuctionBidFromTx(tx sdk.Tx) (*auctiontypes.MsgAuctionBid, error) {
|
||||
auctionBidMsgs := make([]*auctiontypes.MsgAuctionBid, 0)
|
||||
func GetMsgAuctionBidFromTx(tx sdk.Tx) (*buildertypes.MsgAuctionBid, error) {
|
||||
auctionBidMsgs := make([]*buildertypes.MsgAuctionBid, 0)
|
||||
for _, msg := range tx.GetMsgs() {
|
||||
t, ok := msg.(*auctiontypes.MsgAuctionBid)
|
||||
t, ok := msg.(*buildertypes.MsgAuctionBid)
|
||||
if ok {
|
||||
auctionBidMsgs = append(auctionBidMsgs, t)
|
||||
}
|
||||
|
||||
+5
-5
@@ -7,7 +7,7 @@ import (
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
pobcodec "github.com/skip-mev/pob/codec"
|
||||
"github.com/skip-mev/pob/mempool"
|
||||
auctiontypes "github.com/skip-mev/pob/x/auction/types"
|
||||
buildertypes "github.com/skip-mev/pob/x/builder/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ func TestGetMsgAuctionBidFromTx_Valid(t *testing.T) {
|
||||
encCfg := pobcodec.CreateEncodingConfig()
|
||||
|
||||
txBuilder := encCfg.TxConfig.NewTxBuilder()
|
||||
txBuilder.SetMsgs(&auctiontypes.MsgAuctionBid{})
|
||||
txBuilder.SetMsgs(&buildertypes.MsgAuctionBid{})
|
||||
|
||||
msg, err := mempool.GetMsgAuctionBidFromTx(txBuilder.GetTx())
|
||||
require.NoError(t, err)
|
||||
@@ -27,8 +27,8 @@ func TestGetMsgAuctionBidFromTx_MultiMsgBid(t *testing.T) {
|
||||
|
||||
txBuilder := encCfg.TxConfig.NewTxBuilder()
|
||||
txBuilder.SetMsgs(
|
||||
&auctiontypes.MsgAuctionBid{},
|
||||
&auctiontypes.MsgAuctionBid{},
|
||||
&buildertypes.MsgAuctionBid{},
|
||||
&buildertypes.MsgAuctionBid{},
|
||||
&banktypes.MsgSend{},
|
||||
)
|
||||
|
||||
@@ -52,7 +52,7 @@ func TestGetUnwrappedTx(t *testing.T) {
|
||||
encCfg := pobcodec.CreateEncodingConfig()
|
||||
|
||||
txBuilder := encCfg.TxConfig.NewTxBuilder()
|
||||
txBuilder.SetMsgs(&auctiontypes.MsgAuctionBid{})
|
||||
txBuilder.SetMsgs(&buildertypes.MsgAuctionBid{})
|
||||
tx := txBuilder.GetTx()
|
||||
|
||||
bid := sdk.NewCoins(sdk.NewCoin("foo", sdk.NewInt(1000000)))
|
||||
|
||||
Reference in New Issue
Block a user