Skip to content

feat: add ledger subcommand#1640

Merged
p-shahi merged 10 commits intomasterfrom
pshahi/ledger
May 4, 2021
Merged

feat: add ledger subcommand#1640
p-shahi merged 10 commits intomasterfrom
pshahi/ledger

Conversation

@p-shahi
Copy link
Contributor

@p-shahi p-shahi commented May 4, 2021

Ledger commands

USAGE:
    dfx ledger [OPTIONS] <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --network <network>    Override the compute network to connect to. By default, the local
                               network is used

SUBCOMMANDS:
    account-id         Prints the selected identity's AccountIdentifier
    balance            Prints the account balance of the user
    create-canister    Create a canister from ICP
    help               Prints this message or the help of the given subcommand(s)
    top-up             Top up a canister with cycles minted from ICP
    transfer           Transfer ICP from the user to the destination AccountIdentifier
dfx-ledger-create-canister
Create a canister from ICP

USAGE:
    dfx ledger create-canister [OPTIONS] --controller <controller>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --amount <amount>            ICP to mint into cycles and deposit into destination canister
                                     Can be specified as a Decimal with the fractional portion up to
                                     8 decimal places i.e. 100.012
        --controller <controller>    Specify the controller of the new canister
        --e8s <e8s>                  Specify e8s as a whole number, helpful for use in conjunction
                                     with `--icp`
        --icp <icp>                  Specify ICP as a whole number, helpful for use in conjunction
                                     with `--e8s`

@p-shahi p-shahi requested review from a user and lsgunnlsgunn May 4, 2021 04:02
@p-shahi
Copy link
Contributor Author

p-shahi commented May 4, 2021

this should be tested against replica branch pshahi/ledger-v1

amount: Option<String>,

/// Specify ICP as a whole number, helpful for use in conjunction with `--e8s`
#[clap(long, validator(e8s_validator), conflicts_with("amount"))]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a bit puzzled by both icp and e8s being validated by e8s_validator. Would it make sense to call it something else, or is it really true that the same range constraints (none?) apply to both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same range constraints apply to both

pub struct ICPTs {
    e8s: u64,
}

@p-shahi p-shahi requested a review from a user May 4, 2021 06:09
@p-shahi p-shahi merged commit 1c63121 into master May 4, 2021
@p-shahi p-shahi deleted the pshahi/ledger branch May 4, 2021 14:52
dfinity-bot added a commit that referenced this pull request Mar 12, 2023
## Changelog for advisory-db:
Branch: main
Commits: [rustsec/advisory-db@292b3a84...fa80f680](rustsec/advisory-db@292b3a8...fa80f68)

* [`1d79443a`](rustsec/advisory-db@1d79443) Add unmaintained advisory for nphysics ([RustSec/advisory-db⁠#1624](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1624))
* [`bb831bb8`](rustsec/advisory-db@bb831bb) Assigned RUSTSEC-2021-0148 to nphysics3d, RUSTSEC-2021-0149 to nphysics2d ([RustSec/advisory-db⁠#1636](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1636))
* [`220fa871`](rustsec/advisory-db@220fa87) Add unmaintained advisory for ncollide ([RustSec/advisory-db⁠#1623](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1623))
* [`ffe539ba`](rustsec/advisory-db@ffe539b) Assigned RUSTSEC-2021-0150 to ncollide3d, RUSTSEC-2021-0151 to ncollide2d ([RustSec/advisory-db⁠#1637](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1637))
* [`84b7ddd2`](rustsec/advisory-db@84b7ddd) `out_reference::Out::from_raw` should be `unsafe` ([RustSec/advisory-db⁠#1627](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1627))
* [`eab0949b`](rustsec/advisory-db@eab0949) Assigned RUSTSEC-2021-0152 to out-reference ([RustSec/advisory-db⁠#1638](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1638))
* [`6fb0acde`](rustsec/advisory-db@6fb0acd) Add unmaintained advisory for mach ([RustSec/advisory-db⁠#1616](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1616))
* [`d1e7c68b`](rustsec/advisory-db@d1e7c68) Assigned RUSTSEC-2020-0168 to mach ([RustSec/advisory-db⁠#1639](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1639))
* [`4bb7a939`](rustsec/advisory-db@4bb7a93) Add boxfnonce informational advisory ([RustSec/advisory-db⁠#1609](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1609))
* [`10278a15`](rustsec/advisory-db@10278a1) Assigned RUSTSEC-2019-0040 to boxfnonce ([RustSec/advisory-db⁠#1640](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1640))
* [`2284b69d`](rustsec/advisory-db@2284b69) Add advisory encoding ([RustSec/advisory-db⁠#1608](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1608))
* [`fa80f680`](rustsec/advisory-db@fa80f68) Assigned RUSTSEC-2021-0153 to encoding ([RustSec/advisory-db⁠#1641](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1641))
mergify bot pushed a commit that referenced this pull request Mar 12, 2023
## Changelog for advisory-db:
Branch: main
Commits: [rustsec/advisory-db@292b3a84...fa80f680](rustsec/advisory-db@292b3a8...fa80f68)

* [`1d79443a`](rustsec/advisory-db@1d79443) Add unmaintained advisory for nphysics ([RustSec/advisory-db⁠#1624](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1624))
* [`bb831bb8`](rustsec/advisory-db@bb831bb) Assigned RUSTSEC-2021-0148 to nphysics3d, RUSTSEC-2021-0149 to nphysics2d ([RustSec/advisory-db⁠#1636](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1636))
* [`220fa871`](rustsec/advisory-db@220fa87) Add unmaintained advisory for ncollide ([RustSec/advisory-db⁠#1623](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1623))
* [`ffe539ba`](rustsec/advisory-db@ffe539b) Assigned RUSTSEC-2021-0150 to ncollide3d, RUSTSEC-2021-0151 to ncollide2d ([RustSec/advisory-db⁠#1637](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1637))
* [`84b7ddd2`](rustsec/advisory-db@84b7ddd) `out_reference::Out::from_raw` should be `unsafe` ([RustSec/advisory-db⁠#1627](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1627))
* [`eab0949b`](rustsec/advisory-db@eab0949) Assigned RUSTSEC-2021-0152 to out-reference ([RustSec/advisory-db⁠#1638](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1638))
* [`6fb0acde`](rustsec/advisory-db@6fb0acd) Add unmaintained advisory for mach ([RustSec/advisory-db⁠#1616](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1616))
* [`d1e7c68b`](rustsec/advisory-db@d1e7c68) Assigned RUSTSEC-2020-0168 to mach ([RustSec/advisory-db⁠#1639](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1639))
* [`4bb7a939`](rustsec/advisory-db@4bb7a93) Add boxfnonce informational advisory ([RustSec/advisory-db⁠#1609](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1609))
* [`10278a15`](rustsec/advisory-db@10278a1) Assigned RUSTSEC-2019-0040 to boxfnonce ([RustSec/advisory-db⁠#1640](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1640))
* [`2284b69d`](rustsec/advisory-db@2284b69) Add advisory encoding ([RustSec/advisory-db⁠#1608](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1608))
* [`fa80f680`](rustsec/advisory-db@fa80f68) Assigned RUSTSEC-2021-0153 to encoding ([RustSec/advisory-db⁠#1641](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1641))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments