Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

feat: Implement the new sale payment flow for the ticketing system #33

Closed
wants to merge 12 commits into from

Conversation

lwshang
Copy link
Contributor

@lwshang lwshang commented Jan 24, 2023

Close SDK-953

The related argument/response types are not available in the mono-repo yet.
I manually defined the argument types which have been checked with the candid interface.
In Send subcommand, I defined dummy structs for the response types.

When the sale canister MR merged in the mono-repo, I will need to update the ic-* dependencies and replace all definitions above with the formal ones.

@lwshang lwshang marked this pull request as ready for review January 26, 2023 15:20
@DanielThurau
Copy link
Contributor

I also think that the subcommands should be used within the swap command so that user's aren't copying and pasting the values emitted. You can see how mutliple messages are chained together already in that command.

@lwshang lwshang requested a review from DanielThurau February 2, 2023 01:01
}

#[derive(candid::CandidType, candid::Deserialize)]
struct GetOpenTicketArg {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
struct GetOpenTicketArg {}
struct GetOpenTicketRequest {}

Comment on lines +51 to +56
let req2 = sign_ingress_with_request_status_query(
pem,
"new_sale_ticket",
Encode!(&message)?,
TargetCanister::Swap(sns_canister_ids.swap_canister_id.get().0),
)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like sns-quill makes this conditional message execution pretty difficult. I.e. if get_open_ticket does return a ticket id, then the subsequent call to new_sale_ticket will fail. This may be a confusing experience for users so I've asked Mario if he can introduce a third API to get_or_create. You can see the slack thread here https://dfinity.slack.com/archives/C03H6QEPW5D/p1675465230570649?thread_ts=1675169129.448279&cid=C03H6QEPW5D. If that change is impossible, I only see two ways of proceeding:

  1. Continue with what is already implemented. The user will have to parse the results.
  2. Separate these into two separate commands and have user understand the sale payment flow.

I think (1) is the best option right now but less than ideal. Lets see how he responds on Monday.

@lwshang
Copy link
Contributor Author

lwshang commented Feb 8, 2023

Since we merged sns-quill into quill, this feature will be implemented in quill.
See dfinity/quill#156.

@lwshang lwshang closed this Feb 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants