Skip to content

Commit

Permalink
Merge branch 'main' into reece/wasm-execute-err
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups authored Oct 25, 2023
2 parents cac7145 + 71fa3a9 commit 27aca5f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
jobs:
test-conformance:
name: test-conformance
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
# Install and setup go
- name: Set up Go 1.21
Expand All @@ -32,7 +32,7 @@ jobs:
run: (go test -race -timeout 30m -failfast -v -p 2 ./cmd/interchaintest) || (echo "\n\n*****CHAIN and RELAYER LOGS*****" && cat "$HOME/.interchaintest/logs/interchaintest.log" && exit 1)
test-ibc-examples:
name: test-ibc-examples
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
# Install and setup go
- name: Set up Go 1.21
Expand All @@ -54,7 +54,7 @@ jobs:
run: go test -race -timeout 30m -failfast -v -p 2 ./examples/ibc
test-cosmos-examples:
name: test-cosmos-examples
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
# Install and setup go
- name: Set up Go 1.21
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
jobs:
test-unit:
name: unit-tests
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
# Install and setup go
- name: Set up Go 1.21
Expand Down
26 changes: 16 additions & 10 deletions chain/cosmos/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keyring"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
authTx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/strangelove-ventures/interchaintest/v8/internal/dockerutil"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
Expand Down Expand Up @@ -224,16 +224,22 @@ func BroadcastTx(ctx context.Context, broadcaster *Broadcaster, broadcastingUser
return sdk.TxResponse{}, err
}

resp, err := authTx.QueryTx(cc, respWithTxHash.TxHash)
if err != nil {
// if we fail to query the tx, it means an error occurred with the original message broadcast.
// we should return this instead.
originalResp, err := broadcaster.UnmarshalTxResponseBytes(ctx, txBytes)
return getFullyPopulatedResponse(cc, respWithTxHash.TxHash)
}

// getFullyPopulatedResponse returns a fully populated sdk.TxResponse.
// the QueryTx function is periodically called until a tx with the given hash
// has been included in a block.
func getFullyPopulatedResponse(cc client.Context, txHash string) (sdk.TxResponse, error) {
var resp sdk.TxResponse
err := testutil.WaitForCondition(time.Second*60, time.Second*5, func() (bool, error) {
fullyPopulatedTxResp, err := authtx.QueryTx(cc, txHash)
if err != nil {
return sdk.TxResponse{}, err
return false, nil
}
return originalResp, nil
}

return *resp, nil
resp = *fullyPopulatedTxResp
return true, nil
})
return resp, err
}

0 comments on commit 27aca5f

Please sign in to comment.