Skip to content

Commit

Permalink
fix unmarshall output
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Jul 16, 2024
1 parent b223f18 commit 1aba755
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions hermes/integration/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,9 @@ func TestCustomIBCTx(t *testing.T) {
if execErr != nil {
return execErr
}
if err := json.Unmarshal(queryOutput.Bytes(), &queryResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", queryOutput.String())
out := queryOutput.Bytes()
if err := json.Unmarshal(out, &queryResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", string(out))
}
if len(queryResponse.Channels) == 0 ||
len(queryResponse.Channels[0].ConnectionHops) == 0 {
Expand Down Expand Up @@ -534,8 +535,9 @@ func TestCustomIBCTx(t *testing.T) {
if execErr != nil {
return execErr
}
if err := json.Unmarshal(txOutput.Bytes(), &txResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", txOutput.String())
out := txOutput.Bytes()
if err := json.Unmarshal(out, &txResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", string(out))
}
return cmdrunner.New().Run(ctx, step.New(
step.Exec(
Expand Down Expand Up @@ -594,8 +596,9 @@ func TestCustomIBCTx(t *testing.T) {
if execErr != nil {
return execErr
}
if err := json.Unmarshal(postOutput.Bytes(), &postResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", postOutput.String())
out := postOutput.Bytes()
if err := json.Unmarshal(out, &postResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", string(out))
}
if len(postResponse.Post) != 1 {
return errors.Errorf("invalid posts count %d", len(postResponse.Post))
Expand Down Expand Up @@ -745,8 +748,9 @@ func TestTransferIBCTx(t *testing.T) {
if execErr != nil {
return execErr
}
if err := json.Unmarshal(queryOutput.Bytes(), &queryResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", queryOutput.String())
out := queryOutput.Bytes()
if err := json.Unmarshal(out, &queryResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", string(out))
}
if len(queryResponse.Channels) == 0 ||
len(queryResponse.Channels[0].ConnectionHops) == 0 {
Expand Down Expand Up @@ -796,8 +800,9 @@ func TestTransferIBCTx(t *testing.T) {
if execErr != nil {
return execErr
}
if err := json.Unmarshal(txOutput.Bytes(), &txResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", txOutput.String())
out := txOutput.Bytes()
if err := json.Unmarshal(out, &txResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", string(out))
}
return cmdrunner.New().Run(ctx, step.New(
step.Exec(
Expand Down Expand Up @@ -857,8 +862,9 @@ func TestTransferIBCTx(t *testing.T) {
if execErr != nil {
return execErr
}
if err := json.Unmarshal(balanceOutput.Bytes(), &balanceResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", balanceOutput.String())
out := balanceOutput.Bytes()
if err := json.Unmarshal(out, &balanceResponse); err != nil {
return errors.Wrapf(err, "unmarshalling tx response: %s", string(out))
}
if balanceResponse.Balances.Empty() {
return errors.Errorf("empty balances")
Expand Down

0 comments on commit 1aba755

Please sign in to comment.