-
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
Tx metadata API integration tests #2096
Conversation
cc515c5
to
57297c4
Compare
57297c4
to
a4a6d6a
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
@@ -229,6 +241,7 @@ spec = do | |||
between (feeMin + amt, feeMax + amt) | |||
, expectField (#direction . #getApiT) (`shouldBe` Outgoing) | |||
, expectField (#status . #getApiT) (`shouldBe` Pending) | |||
, expectField (#metadata . #getApiTxMetadata) (`shouldBe` Nothing) |
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.
👍
, expectListField 0 | ||
(#metadata . #getApiTxMetadata) | ||
(`shouldBe` Just (ApiT expected)) | ||
] |
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.
👍
|
||
basePayload <- mkTxPayload ctx wb amt fixturePassphrase | ||
|
||
let txMeta = Aeson.object ["1" .= T.replicate 65 "a"] |
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.
👍
let txMeta = Aeson.object | ||
[ (toText @Int i, Aeson.String (T.replicate 64 "a")) | ||
| i <- [0..1023] ] | ||
let payload = addTxMetadata txMeta basePayload |
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.
👍
257ace1
to
937f1df
Compare
a4a6d6a
to
843fdd0
Compare
937f1df
to
5b2559e
Compare
843fdd0
to
d27f70e
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.
There are few other cases come to my mind, pertaining to invalid metadata but maybe a bit more subtle:
- top-level index > 2^64-1
{ 999999999999999999999999999999999999999999999999999999999999999999999999999999999: "ziemniak" }
- hex that is not hex
{ 1: { "hex": "ąćó" } }
- map that is not map
{ "1": [ [ "k1", "v1", "v2" ] ] }
I wonder would that produce invalid metadata error?
(Link.createTransaction @'Shelley wa) Default payload | ||
|
||
expectResponseCode @IO HTTP.status400 r | ||
expectErrorMessage "fixme: api validation error message" r |
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.
This message is unhappy, it's crying "fixme" ;)
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, I needed to run the tests first to find out what error message to expect. 🙂
Fixed now.
(Link.createTransaction @'Shelley wa) Default payload | ||
|
||
expectResponseCode @IO HTTP.status400 r | ||
expectErrorMessage "fixme: transaction rejected message" r |
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.
so does this one
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.
See latest update of the branch.
Turns out the error message for oversized transactions is not very good.
I think we should fix the error message - but in another PR.
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.
Too late. I've done it in this PR 😬
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.
Thanks
5b2559e
to
039372f
Compare
d27f70e
to
dabe9e2
Compare
c78df67
to
b8ae9ca
Compare
0a7665a
to
01be0de
Compare
bors r+ |
This PR was included in a batch with a merge conflict, it will be automatically retried |
2096: Tx metadata API integration tests r=KtorZ a=rvl ### Issue Number ADP-307 / #2074 / #2073. ### Overview - API test case for posting a transaction with metadata. - Test creating a transaction with invalid metadata. - Test creating a transaction that's too large due to metadata. - Test that the transaction fee estimate is higher when there's metadata in the transaction. ### Comments - Based on PR #2104 branch. Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: KtorZ <[email protected]>
This PR was included in a batch with a merge conflict, it will be automatically retried |
22 similar comments
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
This PR was included in a batch with a merge conflict, it will be automatically retried |
bors r- |
Canceled |
@piotr-iohk Thanks for the suggestions about test coverage for invalid metadata cases. I added a note to the QA section of #2073 about this. These cases are covered in |
Issue Number
ADP-307 / #2074 / #2073.
Overview
Comments