Skip to content

Commit

Permalink
add function field to override SendMsgs (#3767) (#4449)
Browse files Browse the repository at this point in the history
Co-authored-by: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com>
(cherry picked from commit 0063319)

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
  • Loading branch information
mergify[bot] and Carlos Rodriguez authored Aug 24, 2023
1 parent cb7c323 commit e3faf70
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions testing/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ type TestChain struct {
SenderAccount authtypes.AccountI

SenderAccounts []SenderAccount

// Short-term solution to override the logic of the standard SendMsgs function.
// See issue https://github.com/cosmos/ibc-go/issues/3123 for more information.
SendMsgsOverride func(msgs ...sdk.Msg) (*sdk.Result, error)
}

// NewTestChainWithValSet initializes a new TestChain instance with the given validator set
Expand Down Expand Up @@ -314,6 +318,10 @@ func (chain *TestChain) sendMsgs(msgs ...sdk.Msg) error {
// number and updates the TestChain's headers. It returns the result and error if one
// occurred.
func (chain *TestChain) SendMsgs(msgs ...sdk.Msg) (*sdk.Result, error) {
if chain.SendMsgsOverride != nil {
return chain.SendMsgsOverride(msgs...)
}

// ensure the chain has the latest time
chain.Coordinator.UpdateTimeForChain(chain)

Expand Down

0 comments on commit e3faf70

Please sign in to comment.