mlabs-haskell / hydra-auction

An auction system running on Hydra L2 solution
Apache License 2.0
7 stars 5 forks source link

Better error messages for invalid user actions in demo #108

Closed GeorgeFlerovsky closed 1 year ago

GeorgeFlerovsky commented 1 year ago

For example:

uhbif19 commented 1 year ago

@GeorgeFlerovsky You mean the scope is only timing issues? Then we need to rephrase the title I think.

GeorgeFlerovsky commented 1 year ago

@GeorgeFlerovsky You mean the scope is only timing issues? Then we need to rephrase the title I think.

Yes, I think it's mostly just about timing issues. Although, we may also want to add error messages like this:

uhbif19 commented 1 year ago

@GeorgeFlerovsky This issue is related: https://github.com/mlabs-haskell/hydra-auction/issues/44

GeorgeFlerovsky commented 1 year ago

@GeorgeFlerovsky This issue is related: https://github.com/mlabs-haskell/hydra-auction/issues/44

I would differentiate between the two:

  1. User errors
  2. System errors
uhbif19 commented 1 year ago

@GeorgeFlerovsky #44 is about user errors too. Then you provide wrong nonce UTxO or taking some step then no proper UTxOs for that step is present.

uhbif19 commented 1 year ago

As for code, I think that creating some AuctionTimeframe datatype may be usable. Like we can associate them to intervals with function and check them uniformingly. Maybe we can even share code with OnChain.

GeorgeFlerovsky commented 1 year ago

@GeorgeFlerovsky #44 is about user errors too. Then you provide wrong nonce UTxO or taking some step then no proper UTxOs for that step is present.

Actually, for the demo, I would like to remove the need for the CLI user to specify the nonce utxo. (Maybe this should be a separate GH issue)

It would be cleaner to:

The more general mechanism to select arbitrary auction lot tokens will be needed in production, but it's kind of irrelevant to our development for now. On the other, requiring users to copy-paste utxo refs in CLI is really ugly UX — reminds me of the early Alonzo days.

When we do need this general functionality in the future, we'll probably be replacing the CLI interface with a wallet-based web interface, which has a better UX for selecting tokens/utxos.

uhbif19 commented 1 year ago

The more general mechanism to select arbitrary auction lot tokens will be needed in production, but it's kind of irrelevant to our development for now.

We can just make nonce CLI param optional and have both.

On the other, requiring users to copy-paste utxo refs in CLI is really ugly UX — reminds me of the early Alonzo days.

For now I feel searching for UTxO automatically hides the real thing too much.

uhbif19 commented 1 year ago

@GeorgeFlerovsky @nazrhom

Not sure where better to place time check. I can place checks it in CLI actions separately or in check inside Tx.* functions and return error using Either.

GeorgeFlerovsky commented 1 year ago

@GeorgeFlerovsky @nazrhom

Not sure where better to place time check. I can place checks it in CLI actions separately or in check inside Tx.* functions and return error using Either.

Time checking should be done in CLI actions. We're basically simulating how the frontend web UI would tell a user that certain actions are not available at a particular time (e.g. by graying out the buttons).