Skip to content

Commit

Permalink
add function field to override SendMsgs (#3767)
Browse files Browse the repository at this point in the history
Co-authored-by: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com>
  • Loading branch information
crodriguezvega and DimitrisJim authored Jun 10, 2023
1 parent 13af862 commit 0063319
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 0063319

Please sign in to comment.