-
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
Add CLI option for transaction TTL #2267
Conversation
lib/cli/src/Cardano/CLI.hs
Outdated
<> metavar "SECONDS" | ||
<> help "Time-to-live value in seconds. Default is 2 hours." | ||
where | ||
diffTime = fromIntegral <$> (auto :: ReadM Int) |
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 is slightly inconsistent with the --sync-tolerance
option that is already parsing time. This option requires an explicit suffix to disambiguate the argument: 14s
.
It relies on the FromText
instance of SyncTolerance
to do so, what about re-using that logic here too?
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.
OK I doubt that users would particularly like having to add s
when no other units are supported, but I have changed it anyway.
lib/cli/src/Cardano/CLI.hs
Outdated
@@ -685,16 +687,17 @@ cmdWalletGetUtxoStatistics mkClient = | |||
-- | cardano-wallet transaction | |||
cmdTransaction | |||
:: ToJSON wallet | |||
=> TransactionClient | |||
=> Bool -- ^ Enable Shelley transaction features |
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.
May I suggest a sum-type: Era = Byron | Shelley (Goguen Voltaire)
and a possible isShelley :: Era -> Bool
derived from it? This would be less cryptic at the call-site when reading: cmdTransaction True client ...
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.
OK I have added a sum type but kept it hidden in the CLI module.
2167: Add transaction TTL to payments API r=rvl a=rvl ### Issue Number ADP-93 / #1840 ### Overview - [x] Add transaction TTL to swagger spec. User provides the value in seconds. - [x] Add transaction TTL to API types - [x] Add TTL slot calculation to API handler function - [x] Adjust mkStdTx to make ttl easier - it now takes the expiry slot directly. - [x] Integration tests ### Comments Next PRs - [x] Allow deleting expired transactions ⇒ #2262 - [x] Add CLI option `cardano-wallet transaction create [--ttl=SECONDS]` ⇒ #2267 - [ ] Perhaps clean up the large number of function arguments and return values in transaction layer functions. Co-authored-by: Rodney Lorrimar <[email protected]>
[ "Cannot parse given time duration." | ||
, "Values must be given as whole positive seconds," | ||
, "and must finish with \"s\". For example: \"3s\", \"3600s\", \"42s\"." | ||
] |
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.
Alternatively, could be declared in the text-class
package directly to avoid the orphan instance?
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.
Yeah.
dae32f5
to
4e9c8a9
Compare
2167: Add transaction TTL to payments API r=rvl a=rvl ### Issue Number ADP-93 / #1840 ### Overview - [x] Add transaction TTL to swagger spec. User provides the value in seconds. - [x] Add transaction TTL to API types - [x] Add TTL slot calculation to API handler function - [x] Adjust mkStdTx to make ttl easier - it now takes the expiry slot directly. - [x] Integration tests ### Comments Next PRs - [x] Allow deleting expired transactions ⇒ #2262 - [x] Add CLI option `cardano-wallet transaction create [--ttl=SECONDS]` ⇒ #2267 - [ ] Perhaps clean up the large number of function arguments and return values in transaction layer functions. Co-authored-by: Rodney Lorrimar <[email protected]>
2167: Add transaction TTL to payments API r=rvl a=rvl ### Issue Number ADP-93 / #1840 ### Overview - [x] Add transaction TTL to swagger spec. User provides the value in seconds. - [x] Add transaction TTL to API types - [x] Add TTL slot calculation to API handler function - [x] Adjust mkStdTx to make ttl easier - it now takes the expiry slot directly. - [x] Integration tests ### Comments Next PRs - [x] Allow deleting expired transactions ⇒ #2262 - [x] Add CLI option `cardano-wallet transaction create [--ttl=SECONDS]` ⇒ #2267 - [ ] Perhaps clean up the large number of function arguments and return values in transaction layer functions. Co-authored-by: Rodney Lorrimar <[email protected]>
9580b98
to
737ffd3
Compare
4e9c8a9
to
8de219b
Compare
737ffd3
to
866e53f
Compare
8de219b
to
b5446ac
Compare
866e53f
to
eb74e0e
Compare
afed782
to
61ce155
Compare
f61495f
to
d9da868
Compare
61ce155
to
7d489fe
Compare
7d489fe
to
265678d
Compare
bors r+ |
2267: Add CLI option for transaction TTL r=rvl a=rvl ### Issue Number ADP-93 / #1840 ### Overview - [x] Hide shelley-specific CLI options in `cardano-wallet-jormungandr` (fixes #2169) - [x] Add option `cardano-wallet transaction create [--ttl=SECONDS]` - [ ] Update wiki page after merging. ### Comments - Based on PR #2262 branch - merge that first. 2297: Enable parallel integration tests in hydra r=Anviking a=Anviking # Issue Number ADP-466 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] Pass in `-j 8` - [x] Only run CLI tests in parallel if `CI` env var isn't set - [x] Clean up some debug printing in tests # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> 2302: Fix DB migration tests r=rvl a=piotr-iohk # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> # Overview - 098f6e5 Fix DB migration tests # Comments post release Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: Johannes Lund <[email protected]> Co-authored-by: Piotr Stachyra <[email protected]>
Build failed (retrying...): |
2267: Add CLI option for transaction TTL r=rvl a=rvl ### Issue Number ADP-93 / #1840 ### Overview - [x] Hide shelley-specific CLI options in `cardano-wallet-jormungandr` (fixes #2169) - [x] Add option `cardano-wallet transaction create [--ttl=SECONDS]` - [ ] Update wiki page after merging. ### Comments - Based on PR #2262 branch - merge that first. Co-authored-by: Rodney Lorrimar <[email protected]>
@rvl:
|
bors r- |
Canceled. |
Oops, thanks @piotr-iohk. It works now. bors r+ |
2267: Add CLI option for transaction TTL r=rvl a=rvl ### Issue Number ADP-93 / #1840 ### Overview - [x] Hide shelley-specific CLI options in `cardano-wallet-jormungandr` (fixes #2169) - [x] Add option `cardano-wallet transaction create [--ttl=SECONDS]` - [ ] Update wiki page after merging. ### Comments - Based on PR #2262 branch - merge that first. Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: Piotr Stachyra <[email protected]>
Build failed:
|
bors retry |
2267: Add CLI option for transaction TTL r=rvl a=rvl ### Issue Number ADP-93 / #1840 ### Overview - [x] Hide shelley-specific CLI options in `cardano-wallet-jormungandr` (fixes #2169) - [x] Add option `cardano-wallet transaction create [--ttl=SECONDS]` - [ ] Update wiki page after merging. ### Comments - Based on PR #2262 branch - merge that first. Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: Piotr Stachyra <[email protected]>
Build failed:
|
bors merge |
Build succeeded: |
Issue Number
ADP-93 / #1840
Overview
cardano-wallet-jormungandr
(fixes cardano-wallet-jormungandr --metadata option is redundant #2169)cardano-wallet transaction create [--ttl=SECONDS]
Comments