feat(BB): Decoding Txs before ProcessLane + IgnoreList (#170)
This commit is contained in:
+12
-1
@@ -295,7 +295,17 @@ func New(
|
||||
)
|
||||
|
||||
// Default lane accepts all other transactions.
|
||||
defaultLane := base.NewDefaultLane(config)
|
||||
defaultConfig := blockbuster.BaseLaneConfig{
|
||||
Logger: app.Logger(),
|
||||
TxEncoder: app.txConfig.TxEncoder(),
|
||||
TxDecoder: app.txConfig.TxDecoder(),
|
||||
MaxBlockSpace: sdk.ZeroDec(),
|
||||
IgnoreList: []blockbuster.Lane{
|
||||
tobLane,
|
||||
freeLane,
|
||||
},
|
||||
}
|
||||
defaultLane := base.NewDefaultLane(defaultConfig)
|
||||
lanes := []blockbuster.Lane{
|
||||
tobLane,
|
||||
freeLane,
|
||||
@@ -333,6 +343,7 @@ func New(
|
||||
// Set the proposal handlers on the BaseApp along with the custom antehandler.
|
||||
proposalHandlers := abci.NewProposalHandler(
|
||||
app.Logger(),
|
||||
app.txConfig.TxDecoder(),
|
||||
mempool,
|
||||
)
|
||||
app.App.SetPrepareProposal(proposalHandlers.PrepareProposalHandler())
|
||||
|
||||
+11
-11
@@ -364,9 +364,6 @@ func (s *IntegrationTestSuite) TestMultipleBids() {
|
||||
bundle2[i] = s.createMsgSendTx(accounts[1], accounts[0].Address.String(), defaultSendAmount, uint64(i), 1000)
|
||||
}
|
||||
|
||||
// Wait for a block to ensure all transactions are included in the same block
|
||||
s.waitForABlock()
|
||||
|
||||
// Create a bid transaction that includes the bundle and is valid
|
||||
bid := reserveFee
|
||||
height := s.queryCurrentHeight()
|
||||
@@ -376,6 +373,9 @@ func (s *IntegrationTestSuite) TestMultipleBids() {
|
||||
bid2 := reserveFee.Add(sdk.NewCoin(app.BondDenom, sdk.NewInt(10)))
|
||||
bidTx2 := s.createAuctionBidTx(accounts[3], bid2, bundle2, 0, height+5)
|
||||
|
||||
// Wait for a block to ensure all transactions are included in the same block
|
||||
s.waitForABlock()
|
||||
|
||||
// Broadcast the transactions to different validators
|
||||
s.broadcastTx(bidTx, 0)
|
||||
s.broadcastTx(bidTx2, 1)
|
||||
@@ -1066,14 +1066,6 @@ func (s *IntegrationTestSuite) TestFreeLane() {
|
||||
s.waitForABlock()
|
||||
height := s.queryCurrentHeight()
|
||||
|
||||
// Ensure that the transaction was executed
|
||||
balanceAfterFreeTx := s.queryBalanceOf(accounts[0].Address.String(), app.BondDenom)
|
||||
s.Require().True(balanceAfterFreeTx.Add(defaultStakeAmount).IsGTE(balanceBeforeFreeTx))
|
||||
|
||||
// The balance must be strictly less than to account for fees
|
||||
balanceAfterNormalTx := s.queryBalanceOf(accounts[1].Address.String(), app.BondDenom)
|
||||
s.Require().True(balanceAfterNormalTx.IsLT((balanceBeforeNormalTx.Sub(defaultSendAmount))))
|
||||
|
||||
hashes := s.normalTxsToTxHashes([][]byte{freeTx, normalTx})
|
||||
expectedExecution := map[string]bool{
|
||||
hashes[0]: true,
|
||||
@@ -1082,6 +1074,14 @@ func (s *IntegrationTestSuite) TestFreeLane() {
|
||||
|
||||
// Ensure that the block was built correctly
|
||||
s.verifyBlock(height, hashes, expectedExecution)
|
||||
|
||||
// Ensure that the transaction was executed
|
||||
balanceAfterFreeTx := s.queryBalanceOf(accounts[0].Address.String(), app.BondDenom)
|
||||
s.Require().True(balanceAfterFreeTx.Add(defaultStakeAmount).IsGTE(balanceBeforeFreeTx))
|
||||
|
||||
// The balance must be strictly less than to account for fees
|
||||
balanceAfterNormalTx := s.queryBalanceOf(accounts[1].Address.String(), app.BondDenom)
|
||||
s.Require().True(balanceAfterNormalTx.IsLT((balanceBeforeNormalTx.Sub(defaultSendAmount))))
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user