-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More integration tests for construct tx endpoint #2751
Conversation
e40bef5
to
c66f572
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
bors r+ |
2751: More integration tests for construct tx endpoint r=piotr-iohk a=piotr-iohk # Issue Number ADP-909 # Overview Integration tests covering: - [x] More malformed examples - [x] Only validate_interval - [x] Tx with only metadata - [x] Tx with only withdrawal from self and external - [x] Only single output tx⚠️ `pending` - outputs are empty - [x] Only multi-output tx⚠️ `pending` - outputs are empty - [x] Multi asset transactions⚠️ `pending` - outputs are empty - [x] Join and quit pool - join⚠️ `pending` - deposits are empty - quit⚠️ `pending` - can quit when you didn't join - errMsg404NoSuchPool⚠️ `pending` - error not returned when should be - [ ] ~Minting~ - [x] validate_interval on different transactions (payments, delegations, mint) - invalid_before / invalid_hereafter⚠️ `pending` - can be < 0 but shouldn't - [x] Transaction with all (payments, delegations, mint, metadata, withdrawal, validate_interval) # Comments / Issues - Should construct ep return `200` instead of `202` (coin selection returns `200`) - `amount` field would be probably handy to have in the response - Output field on response is empty (`"output": []`) on payment transactions, which seems like a bug (to be addressed in ADP-985)... for now tests marked as `pendingWith` - Deposit is empty on construct tx response on joining pool and shouldn't - You can quit pool before even joining - errMsg404NoSuchPool is not returned when trying to join absent pool Co-authored-by: Piotr Stachyra <[email protected]>
Build failed:
|
- single/multi payments - assets payments - metadata - withdrawals - invalid payloads
ebda326
to
f95f65e
Compare
bors r+ |
2751: More integration tests for construct tx endpoint r=piotr-iohk a=piotr-iohk # Issue Number ADP-909 # Overview Integration tests covering: - [x] More malformed examples - [x] Only validate_interval - [x] Tx with only metadata - [x] Tx with only withdrawal from self and external - [x] Only single output tx⚠️ `pending` - outputs are empty - [x] Only multi-output tx⚠️ `pending` - outputs are empty - [x] Multi asset transactions⚠️ `pending` - outputs are empty - [x] Join and quit pool - join⚠️ `pending` - deposits are empty - quit⚠️ `pending` - can quit when you didn't join - errMsg404NoSuchPool⚠️ `pending` - error not returned when should be - [ ] ~Minting~ - [x] validate_interval on different transactions (payments, delegations, mint) - invalid_before / invalid_hereafter⚠️ `pending` - can be < 0 but shouldn't - [x] Transaction with all (payments, delegations, mint, metadata, withdrawal, validate_interval) # Comments / Issues - Should construct ep return `200` instead of `202` (coin selection returns `200`) - `amount` field would be probably handy to have in the response - Output field on response is empty (`"output": []`) on payment transactions, which seems like a bug (to be addressed in ADP-985)... for now tests marked as `pendingWith` - Deposit is empty on construct tx response on joining pool and shouldn't - You can quit pool before even joining - errMsg404NoSuchPool is not returned when trying to join absent pool Co-authored-by: Piotr Stachyra <[email protected]>
Build failed: #expected |
f95f65e
to
ad9cd19
Compare
bors r+ |
2751: More integration tests for construct tx endpoint r=piotr-iohk a=piotr-iohk # Issue Number ADP-909 # Overview Integration tests covering: - [x] More malformed examples - [x] Only validate_interval - [x] Tx with only metadata - [x] Tx with only withdrawal from self and external - [x] Only single output tx⚠️ `pending` - outputs are empty - [x] Only multi-output tx⚠️ `pending` - outputs are empty - [x] Multi asset transactions⚠️ `pending` - outputs are empty - [x] Join and quit pool - join⚠️ `pending` - deposits are empty - quit⚠️ `pending` - can quit when you didn't join - errMsg404NoSuchPool⚠️ `pending` - error not returned when should be - [ ] ~Minting~ - [x] validate_interval on different transactions (payments, delegations, mint) - invalid_before / invalid_hereafter⚠️ `pending` - can be < 0 but shouldn't - [x] Transaction with all (payments, delegations, mint, metadata, withdrawal, validate_interval) # Comments / Issues - Should construct ep return `200` instead of `202` (coin selection returns `200`) - `amount` field would be probably handy to have in the response - Output field on response is empty (`"output": []`) on payment transactions, which seems like a bug (to be addressed in ADP-985)... for now tests marked as `pendingWith` - Deposit is empty on construct tx response on joining pool and shouldn't - You can quit pool before even joining - errMsg404NoSuchPool is not returned when trying to join absent pool Co-authored-by: Piotr Stachyra <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks.
it "TRANS_NEW_CREATE_01b - Validity interval only is not allowed" $ \ctx -> runResourceT $ do | ||
wa <- fixtureWallet ctx | ||
let validityInterval = Json [json|{ | ||
"validity_interval": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paweljakubas We should also add a simple validation (invalid before <= invalid hereafter) of the validity interval to the API JSON parser.
let payload = Json [json|{ | ||
"withdrawal": "self", | ||
"validity_interval": { | ||
"invalid_before": "unspecified", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be that omission of the interval bound, or just setting it to null means "unspecified" -- no need to use a special string.
@@ -1363,7 +1363,7 @@ x-transactionTTL: &transactionTTL | |||
x-unspecified: &unspecified | |||
type: string | |||
enum: | |||
- uspecified | |||
- unspecified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paweljakubas we should remove this "unspecified" and use null/undefined/missing to denote unspecified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we've discussed this with Paweł and for now just added some tests (also covering other "failing" scenarios) and make them "pending"), such that then can be enabled later once the issues are fixed. Findings also listed here -> https://jira.iohk.io/browse/ADP-909.
Build failed: #expected (hlint) |
ad9cd19
to
3567a08
Compare
bors r+ |
Build succeeded: |
Issue Number
ADP-909
Overview
Integration tests covering:
pending
- outputs are emptypending
- outputs are emptypending
- outputs are emptypending
- deposits are emptypending
- can quit when you didn't joinpending
- error not returned when should beMintingpending
- can be < 0 but shouldn'tComments / Issues
200
instead of202
(coin selection returns200
)amount
field would be probably handy to have in the response"output": []
) on payment transactions, which seems like a bug (to be addressed in ADP-985)... for now tests marked aspendingWith