Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jayy04 committed Oct 3, 2024
1 parent c65e3b9 commit d1d3aff
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions protocol/x/clob/e2e/permissioned_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,76 @@ func TestPlaceOrder_PermissionedKeys_Failures(t *testing.T) {
constants.Order_Bob_Num0_Id11_Clob1_Buy5_Price40_GTB20.OrderId: false,
},
},
"Txn has authenticators specified, but it was removed": {
smartAccountEnabled: true,
blocks: []TestBlockWithMsgs{
{
Block: 2,
Msgs: []TestSdkMsg{
{
Msg: &aptypes.MsgAddAuthenticator{
Sender: constants.BobAccAddress.String(),
AuthenticatorType: "MessageFilter",
Data: []byte("/cosmos.bank.v1beta1.MsgSend"),
},

Fees: constants.TestFeeCoins_5Cents,
Gas: 300_000,
AccountNum: []uint64{1},
SeqNum: []uint64{1},
Signers: []cryptotypes.PrivKey{constants.BobPrivateKey},

ExpectedRespCode: 0,
},
},
},
{
Block: 4,
Msgs: []TestSdkMsg{
{
Msg: &aptypes.MsgRemoveAuthenticator{
Sender: constants.BobAccAddress.String(),
Id: 0,
},

Fees: constants.TestFeeCoins_5Cents,
Gas: 300_000,
AccountNum: []uint64{1},
SeqNum: []uint64{2},
Signers: []cryptotypes.PrivKey{constants.BobPrivateKey},

ExpectedRespCode: 0,
},
},
},
{
Block: 6,
Msgs: []TestSdkMsg{
{
Msg: clobtypes.NewMsgPlaceOrder(
testapp.MustScaleOrder(
constants.Order_Bob_Num0_Id11_Clob1_Buy5_Price40_GTB20,
testapp.DefaultGenesis(),
),
),
Authenticators: []uint64{0},

Fees: constants.TestFeeCoins_5Cents,
Gas: 0,
AccountNum: []uint64{1},
SeqNum: []uint64{0},
Signers: []cryptotypes.PrivKey{constants.BobPrivateKey},

ExpectedRespCode: aptypes.ErrAuthenticatorNotFound.ABCICode(),
ExpectedLog: aptypes.ErrAuthenticatorNotFound.Error(),
},
},
},
},
expectedOrderIdsInMemclob: map[clobtypes.OrderId]bool{
constants.Order_Bob_Num0_Id11_Clob1_Buy5_Price40_GTB20.OrderId: false,
},
},
"Txn rejected by signature verification authenticator": {
smartAccountEnabled: true,
blocks: []TestBlockWithMsgs{
Expand Down

0 comments on commit d1d3aff

Please sign in to comment.