Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

fix(mempool): allow sdk.Tx's to not fail checkTx #1318

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cosmos/runtime/txpool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ func (m *Mempool) Insert(ctx context.Context, sdkTx sdk.Tx) error {
}

if wet, ok := utils.GetAs[*types.WrappedEthereumTransaction](msgs[0]); !ok {
return errors.New("only WrappedEthereumTransactions are supported")
// We have to return nil for non-ethereum transactions as to not fail check-tx.
return nil
itsdevbear marked this conversation as resolved.
Show resolved Hide resolved
} else if errs := m.txpool.Add(
[]*coretypes.Transaction{wet.Unwrap()}, false, false,
); len(errs) != 0 {
itsdevbear marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
4 changes: 2 additions & 2 deletions cosmos/runtime/txpool/mempool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ var _ = Describe("", func() {
})
})
When("we use an that is not an ethereum msg", func() {
It("errors", func() {
It("does not error", func() {
sdkTx.On("GetMsgs").Return([]sdk.Msg{nil}).Once()
Expect(mempool.Insert(ctx, sdkTx)).To(HaveOccurred())
Expect(mempool.Insert(ctx, sdkTx)).ToNot(HaveOccurred())
})
})
})
Expand Down
Loading