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

Commit

Permalink
fix(mempool): allow sdk.Tx's to not fail checkTx (backport #1318) (#…
Browse files Browse the repository at this point in the history
…1321)

This is an automatic backport of pull request #1318 done by
[Mergify](https://mergify.com).


---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the
[documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on
`<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com) you
can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>

Co-authored-by: Devon Bear <[email protected]>
  • Loading branch information
mergify[bot] and itsdevbear authored Nov 20, 2023
1 parent 3e9a6b6 commit c97ec53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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
} else if errs := m.txpool.Add(
[]*coretypes.Transaction{wet.Unwrap()}, false, false,
); len(errs) != 0 {
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

0 comments on commit c97ec53

Please sign in to comment.