Skip to content

Commit

Permalink
Add more detailed tx error messages in docker test framework
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed May 3, 2024
1 parent 77dbc80 commit 22c1355
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
github.com/iotaledger/hive.go/stringify v0.0.0-20240425095808-113b21573349
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20240425100742-5c85b6d16701
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240425100432-05e1bf8fc089
github.com/iotaledger/iota.go/v4 v4.0.0-20240425100055-540c74851d65
github.com/iotaledger/iota.go/v4 v4.0.0-20240503105040-c86882e71808
github.com/labstack/echo/v4 v4.12.0
github.com/labstack/gommon v0.4.2
github.com/libp2p/go-libp2p v0.33.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240425100432-05e1bf8fc089 h1:+NRPSb
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240425100432-05e1bf8fc089/go.mod h1:+iSOmdi7LSd1pXMThZsQk4YDbCSlvVomJUqbRhp3+Nk=
github.com/iotaledger/iota-crypto-demo v0.0.0-20240419094816-40260bb800f7 h1:R7ogCKTQ2D5SfVoE6n9GQUsKwm4dcxqwnU863JVlVbw=
github.com/iotaledger/iota-crypto-demo v0.0.0-20240419094816-40260bb800f7/go.mod h1:ntqq5J5Fu2SijiqPsjjdFkMm96UhGU/K0z3j6ARpHec=
github.com/iotaledger/iota.go/v4 v4.0.0-20240425100055-540c74851d65 h1:cKn39WbYZrBbGIeK5SZyu1Eukh1IOq8ZdBh7jC2/9Gg=
github.com/iotaledger/iota.go/v4 v4.0.0-20240425100055-540c74851d65/go.mod h1:2/gBFmGlXzZLcpOqTQTl2GqXtoe/aec6Fu9QTooQPZQ=
github.com/iotaledger/iota.go/v4 v4.0.0-20240503105040-c86882e71808 h1:ruI9Xk8g4xbCFsXBBvIXkOi03WprGJyHkmERGSizFTk=
github.com/iotaledger/iota.go/v4 v4.0.0-20240503105040-c86882e71808/go.mod h1:2/gBFmGlXzZLcpOqTQTl2GqXtoe/aec6Fu9QTooQPZQ=
github.com/ipfs/boxo v0.19.0 h1:UbX9FBJQF19ACLqRZOgdEla6jR/sC4H1O+iGE0NToXA=
github.com/ipfs/boxo v0.19.0/go.mod h1:V5gJzbIMwKEXrg3IdvAxIdF7UPgU4RsXmNGS8MQ/0D4=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
Expand Down
9 changes: 6 additions & 3 deletions tools/docker-network/tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (d *DockerTestFramework) AwaitTransactionPayloadAccepted(ctx context.Contex
}
}

return ierrors.Errorf("transaction %s is pending or having errors, state: %s, failure reason: %d", txID.ToHex(), resp.TransactionState.String(), resp.TransactionFailureReason)
return ierrors.Errorf("transaction %s is pending or having errors, state: %s, failure reason: %s, failure details: %s", txID.ToHex(), resp.TransactionState, resp.TransactionFailureReason, resp.TransactionFailureDetails)
})
}

Expand All @@ -234,7 +234,10 @@ func (d *DockerTestFramework) AwaitTransactionState(ctx context.Context, txID io
if expectedState == resp.TransactionState {
return nil
} else {
return ierrors.Errorf("expected transaction %s to have state %s, got %s instead", txID, expectedState, resp.TransactionState)
if resp.TransactionState == api.TransactionStateFailed {
return ierrors.Errorf("expected transaction %s to have state '%s', got '%s' instead, failure reason: %s, failure details: %s", txID, expectedState, resp.TransactionState, resp.TransactionFailureReason, resp.TransactionFailureDetails)
}
return ierrors.Errorf("expected transaction %s to have state '%s', got '%s' instead", txID, expectedState, resp.TransactionState)
}
})
}
Expand All @@ -249,7 +252,7 @@ func (d *DockerTestFramework) AwaitTransactionFailure(ctx context.Context, txID
if expectedReason == resp.TransactionFailureReason {
return nil
} else {
return ierrors.Errorf("expected transaction %s to have failure reason %T, got %s instead, failure details: %s", txID, expectedReason, resp.TransactionState, resp.TransactionFailureDetails)
return ierrors.Errorf("expected transaction %s to have failure reason '%s', got '%s' instead, failure details: %s", txID, expectedReason, resp.TransactionFailureReason, resp.TransactionFailureDetails)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion tools/gendoc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ require (
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20240425100742-5c85b6d16701 // indirect
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240425100432-05e1bf8fc089 // indirect
github.com/iotaledger/iota-crypto-demo v0.0.0-20240419094816-40260bb800f7 // indirect
github.com/iotaledger/iota.go/v4 v4.0.0-20240425100055-540c74851d65 // indirect
github.com/iotaledger/iota.go/v4 v4.0.0-20240503105040-c86882e71808 // indirect
github.com/ipfs/boxo v0.19.0 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/ipfs/go-datastore v0.6.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions tools/gendoc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240425100432-05e1bf8fc089 h1:+NRPSb
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240425100432-05e1bf8fc089/go.mod h1:+iSOmdi7LSd1pXMThZsQk4YDbCSlvVomJUqbRhp3+Nk=
github.com/iotaledger/iota-crypto-demo v0.0.0-20240419094816-40260bb800f7 h1:R7ogCKTQ2D5SfVoE6n9GQUsKwm4dcxqwnU863JVlVbw=
github.com/iotaledger/iota-crypto-demo v0.0.0-20240419094816-40260bb800f7/go.mod h1:ntqq5J5Fu2SijiqPsjjdFkMm96UhGU/K0z3j6ARpHec=
github.com/iotaledger/iota.go/v4 v4.0.0-20240425100055-540c74851d65 h1:cKn39WbYZrBbGIeK5SZyu1Eukh1IOq8ZdBh7jC2/9Gg=
github.com/iotaledger/iota.go/v4 v4.0.0-20240425100055-540c74851d65/go.mod h1:2/gBFmGlXzZLcpOqTQTl2GqXtoe/aec6Fu9QTooQPZQ=
github.com/iotaledger/iota.go/v4 v4.0.0-20240503105040-c86882e71808 h1:ruI9Xk8g4xbCFsXBBvIXkOi03WprGJyHkmERGSizFTk=
github.com/iotaledger/iota.go/v4 v4.0.0-20240503105040-c86882e71808/go.mod h1:2/gBFmGlXzZLcpOqTQTl2GqXtoe/aec6Fu9QTooQPZQ=
github.com/ipfs/boxo v0.19.0 h1:UbX9FBJQF19ACLqRZOgdEla6jR/sC4H1O+iGE0NToXA=
github.com/ipfs/boxo v0.19.0/go.mod h1:V5gJzbIMwKEXrg3IdvAxIdF7UPgU4RsXmNGS8MQ/0D4=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
Expand Down

0 comments on commit 22c1355

Please sign in to comment.