metaplex-foundation / sugar

Candy Machine Rust CLI.
Apache License 2.0
206 stars 117 forks source link

Minting from wrong keypair doesn't fail #167

Closed samuelvanderwaal closed 2 years ago

samuelvanderwaal commented 2 years ago

To Duplicate:

Expected: it should fail to allow minting and command should fail.

Actual: No NFTs are minted but the command cycles through the mint progress bar and finishes with "Command successful".

Additionally, sugar mint help says that the command requires the candy machine id as an arg but it is not actually required.

febo commented 2 years ago

The output of sugar help mint is:

...
USAGE:
    sugar mint [OPTIONS] [CANDY_MACHINE]

ARGS:
    <CANDY_MACHINE>    Address of candy machine to mint from
...

According to clap docs, "[] has the dual notation of meaning the argument is optional" so it seems that this is ok. The idea of having a [CANDY_MACHINE] is that you can mint from the command line without a cache file. Although I agree that it is a bit confusing - we could wither be explicit on the description to say that is it optional:

<CANDY_MACHINE>    Address of candy machine to mint from (optional)

or move it to the a flag:

--candy-machine <ID>    Address of candy machine to mint from

This issue is also present in update and withdraw commands.

febo commented 2 years ago

The transaction does not fail because of the recent changes for bot protection. The transaction succeeds but you get a non-nft token as a result. This is the log from the candy machine: Screenshot from 2022-05-02 09-20-54