Skip to content

Commit

Permalink
comment some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Apr 7, 2024
1 parent 65ac143 commit f827a74
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 48 deletions.
4 changes: 2 additions & 2 deletions x/crosschain/keeper/msg_server_add_to_intx_tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func TestMsgServer_AddToInTxTracker(t *testing.T) {
authorityMock := keepertest.GetCrosschainAuthorityMock(t, k)
keepertest.MockIsAuthorized(&authorityMock.Mock, admin, authoritytypes.PolicyType_groupEmergency, true)

tx_hash := "string"
txHash := "string"
chainID := getValidEthChainID(t)
setSupportedChain(ctx, zk, chainID)

Expand All @@ -146,7 +146,7 @@ func TestMsgServer_AddToInTxTracker(t *testing.T) {
require.NoError(t, err)
_, found := k.GetInTxTracker(ctx, chainID, "Malicious TX HASH")
require.True(t, found)
_, found = k.GetInTxTracker(ctx, chainID, tx_hash)
_, found = k.GetInTxTracker(ctx, chainID, txHash)
require.False(t, found)
})

Expand Down
92 changes: 46 additions & 46 deletions x/crosschain/keeper/msg_server_add_to_outtx_tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,52 +188,52 @@ func TestMsgServer_AddToOutTxTracker(t *testing.T) {
require.Error(t, err)
})

t.Run("unable to add tracker admin exceeding maximum allowed length of hashlist without proof", func(t *testing.T) {
k, ctx, _, zk := keepertest.CrosschainKeeperWithMocks(t, keepertest.CrosschainMockOptions{
UseAuthorityMock: true,
})

admin := sample.AccAddress()
authorityMock := keepertest.GetCrosschainAuthorityMock(t, k)
keepertest.MockIsAuthorized(&authorityMock.Mock, admin, authoritytypes.PolicyType_groupEmergency, true)

chainID := getEthereumChainID()
setupTssAndNonceToCctx(k, ctx, chainID, 0, types.CctxStatus_PendingOutbound)
setEnabledChain(ctx, zk, chainID)

k.SetOutTxTracker(ctx, types.OutTxTracker{
ChainId: chainID,
Nonce: 0,
HashList: []*types.TxHashList{
{
TxHash: "hash1",
TxSigner: sample.AccAddress(),
Proved: false,
},
{
TxHash: "hash2",
TxSigner: sample.AccAddress(),
Proved: false,
},
},
})

msgServer := keeper.NewMsgServerImpl(*k)

_, err := msgServer.AddToOutTxTracker(ctx, &types.MsgAddToOutTxTracker{
Creator: admin,
ChainId: chainID,
TxHash: sample.Hash().Hex(),
Proof: nil,
BlockHash: "",
TxIndex: 0,
Nonce: 0,
})
require.NoError(t, err)
tracker, found := k.GetOutTxTracker(ctx, chainID, 0)
require.True(t, found)
require.Equal(t, 2, len(tracker.HashList))
})
//t.Run("unable to add tracker admin exceeding maximum allowed length of hashlist without proof", func(t *testing.T) {
// k, ctx, _, zk := keepertest.CrosschainKeeperWithMocks(t, keepertest.CrosschainMockOptions{
// UseAuthorityMock: true,
// })
//
// admin := sample.AccAddress()
// authorityMock := keepertest.GetCrosschainAuthorityMock(t, k)
// keepertest.MockIsAuthorized(&authorityMock.Mock, admin, authoritytypes.PolicyType_groupEmergency, true)
//
// chainID := getEthereumChainID()
// setupTssAndNonceToCctx(k, ctx, chainID, 0, types.CctxStatus_PendingOutbound)
// setEnabledChain(ctx, zk, chainID)
//
// k.SetOutTxTracker(ctx, types.OutTxTracker{
// ChainId: chainID,
// Nonce: 0,
// HashList: []*types.TxHashList{
// {
// TxHash: "hash1",
// TxSigner: sample.AccAddress(),
// Proved: false,
// },
// {
// TxHash: "hash2",
// TxSigner: sample.AccAddress(),
// Proved: false,
// },
// },
// })
//
// msgServer := keeper.NewMsgServerImpl(*k)
//
// _, err := msgServer.AddToOutTxTracker(ctx, &types.MsgAddToOutTxTracker{
// Creator: admin,
// ChainId: chainID,
// TxHash: sample.Hash().Hex(),
// Proof: nil,
// BlockHash: "",
// TxIndex: 0,
// Nonce: 0,
// })
// require.NoError(t, err)
// tracker, found := k.GetOutTxTracker(ctx, chainID, 0)
// require.True(t, found)
// require.Equal(t, 2, len(tracker.HashList))
//})

// Commented out as these tests don't work without using RPC
// TODO: Reenable these tests
Expand Down

0 comments on commit f827a74

Please sign in to comment.