Skip to content

Commit

Permalink
rm SimDeliver
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Mar 18, 2024
1 parent 36ea1a7 commit 9b60e34
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions app/ante/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ func (suite *AnteTestSuite) TestAuthzLimiterDecorator() {
}

func (suite *AnteTestSuite) TestRejectDeliverMsgsInAuthz() {
return
_, testAddresses, err := generatePrivKeyAddressPairs(10)
suite.Require().NoError(err)

Expand Down Expand Up @@ -278,7 +277,7 @@ func (suite *AnteTestSuite) TestRejectDeliverMsgsInAuthz() {
},
),
},
expectedCode: sdkerrors.ErrUnpackAny.ABCICode(),
expectedCode: sdkerrors.ErrUnauthorized.ABCICode(),
},
{
name: "a MsgExec with nested MsgExec messages that has invalid messages is blocked",
Expand All @@ -291,7 +290,7 @@ func (suite *AnteTestSuite) TestRejectDeliverMsgsInAuthz() {
},
),
},
expectedCode: sdkerrors.ErrUnpackAny.ABCICode(),
expectedCode: sdkerrors.ErrUnauthorized.ABCICode(),
},
{
name: "a MsgExec with more nested MsgExec messages than allowed and with valid messages is blocked",
Expand Down Expand Up @@ -338,9 +337,21 @@ func (suite *AnteTestSuite) TestRejectDeliverMsgsInAuthz() {
suite.Require().NoError(err)
suite.Require().Equal(resCheckTx.Code, tc.expectedCode, resCheckTx.Log)

_, _, err = suite.app.SimDeliver(txEncoder, tx)
header := suite.ctx.BlockHeader()
blockRes, err := suite.app.FinalizeBlock(
&abci.RequestFinalizeBlock{
Height: header.Height,
Txs: [][]byte{bz},
Hash: header.AppHash,
NextValidatorsHash: header.NextValidatorsHash,
ProposerAddress: header.ProposerAddress,
Time: header.Time.Add(time.Second),
},
)
suite.Require().NoError(err)
// suite.Require().Equal(resDeliverTx.Code, tc.expectedCode, resDeliverTx.Log)
suite.Require().Len(blockRes.TxResults, 1)
txRes := blockRes.TxResults[0]
suite.Require().Equal(txRes.Code, tc.expectedCode, txRes.Log)
})
}
}
Expand Down

0 comments on commit 9b60e34

Please sign in to comment.