-
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
Lenient SealedTx decoding #2946
Conversation
I guess the PR fails because of the commits it is based on? Will try to rebase on master |
1328e62
to
2a068d8
Compare
bors r+ |
👎 Rejected by too few approved reviews |
forAll selectFromPreparedBinaries $ \ bs -> | ||
let result = parseJSONSealedTx $ Aeson.encode $ ApiBytesT @'Base64 bs | ||
in result == Right bs & | ||
counterexample ("Parse result: " <> show result) |
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.
👍 convincing properties.
parseJSON = fmap ApiT . parseSealedTxBytes @'Base64 | ||
parseJSON v = do | ||
tx <- parseSealedTxBytes @'Base16 v <|> parseSealedTxBytes @'Base64 v | ||
pure $ ApiT tx |
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.
👍
I did not run all unit tests before pushing and some of them are failing. Will revert to draft status, apologies for the inconvenience. |
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. The properties will be even better when selectFromPreparedBinaries
is replaced with genTx
from cardano-api:gen soon (@sevanspowell is working on this)
bors r+ |
2946: Lenient SealedTx decoding r=paweljakubas a=abailly-iohk > This is my very first PR in cardano-wallet so my apologies if I broke some rules of the land :) This simple PR allows clients to provide either a base16 or base64 encoding when submitting a transaction for signing and other endpoints relevant for the new signing process. It is based off of @KtorZ's #2943 PR as this strand of work was triggered by us tripping ourselves in the foot trying to sign a base16 encoded transaction. Co-authored-by: Arnaud Bailly <[email protected]> Co-authored-by: Pawel Jakubas <[email protected]>
Build failed: |
Need to fix a unit test, will push soon... |
cbc6ae0
to
f1b28ae
Compare
bors r+ |
2946: Lenient SealedTx decoding r=paweljakubas a=abailly-iohk > This is my very first PR in cardano-wallet so my apologies if I broke some rules of the land :) This simple PR allows clients to provide either a base16 or base64 encoding when submitting a transaction for signing and other endpoints relevant for the new signing process. It is based off of @KtorZ's #2943 PR as this strand of work was triggered by us tripping ourselves in the foot trying to sign a base16 encoded transaction. Co-authored-by: Arnaud Bailly <[email protected]> Co-authored-by: Pawel Jakubas <[email protected]>
bors r- |
Canceled. |
bors r+ |
2946: Lenient SealedTx decoding r=paweljakubas a=abailly-iohk > This is my very first PR in cardano-wallet so my apologies if I broke some rules of the land :) This simple PR allows clients to provide either a base16 or base64 encoding when submitting a transaction for signing and other endpoints relevant for the new signing process. It is based off of @KtorZ's #2943 PR as this strand of work was triggered by us tripping ourselves in the foot trying to sign a base16 encoded transaction. Co-authored-by: Arnaud Bailly <[email protected]> Co-authored-by: Pawel Jakubas <[email protected]>
Sorry for the confusion, PR now complete with test fixed and documentation added in swagger.yaml. |
Build failed: |
018dadf
to
6e3d825
Compare
bors r+ |
Build succeeded: |
This simple PR allows clients to provide either a base16 or base64 encoding when submitting a transaction for signing and other endpoints relevant for the new signing process. It is based off of @KtorZ's #2943 PR as this strand of work was triggered by us tripping ourselves in the foot trying to sign a base16 encoded transaction.