-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increase fallback coverage for mint character (#119)
### Description Review frontend error handling for the mint flow and ensure the frontend does not get "stuck" when minting a character ### Validation and error handling The mint flow starts with the "Create character" input form, which takes a string as input (to pick a character name) and performs the following validation (showing errors when present): 1. Name adheres to the guidelines set on contract (special characters, length requirements, etc) 2. Name is unique 3. User has enough IST available to mint If no validation errors are present, the `mint` button is enabled. Pressing mint will form the mint proposal based on the input and trigger Agoric's `addOffer` method, which also accepts a callback set up to track offer updates. Should anything error out in the process of forming and executing `addOffer` the error will be caught and a generic error will be displayed to the user. If addOffer is triggered correctly, the following `offerStatus` updates are handled: 1. `seated`: indicates the offer was successfully parsed by the contract? (I couldn't find documentation around this, so this definition is from experience). We start a timer which will display an error to the user in case no further offer updates are received within 30s (typically the mint offer returns the "success" status within 10s of it being seated) 2. `error`: indicates an error occurred while minting. A generic error is displayed prompting the user to try again 3. `accepted`: indicates mint call was successful. We clear the timer set to error if the call takes too long. We do not yet give the user confirmation, as we want to wait until the new character is accessible from the user's wallet Finally, we have a useEffect in the create-character component that listens for updates in the user's wallet and shows confirmation to the user once the newly minted character is correctly parsed by KREAd's frontend
- Loading branch information
1 parent
e060ce3
commit d6982ec
Showing
11 changed files
with
1,496 additions
and
1,295 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8446,7 +8446,7 @@ prompts@^2.0.1: | |
kleur "^3.0.3" | ||
sisteransi "^1.0.5" | ||
|
||
prop-types@^15.5.8, prop-types@^15.7.2, prop-types@^15.8.1: | ||
prop-types@^15.5.8, prop-types@^15.8.1: | ||
version "15.8.1" | ||
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" | ||
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== | ||
|
@@ -8588,7 +8588,7 @@ react-error-boundary@^3.1.4: | |
dependencies: | ||
"@babel/runtime" "^7.12.5" | ||
|
||
react-fast-compare@^3.1.1, react-fast-compare@^3.2.2: | ||
react-fast-compare@^3.2.2: | ||
version "3.2.2" | ||
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49" | ||
integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ== | ||
|
@@ -8602,16 +8602,6 @@ react-helmet-async@^2.0.4: | |
react-fast-compare "^3.2.2" | ||
shallowequal "^1.1.0" | ||
|
||
react-helmet@^6.1.0: | ||
version "6.1.0" | ||
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726" | ||
integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw== | ||
dependencies: | ||
object-assign "^4.1.1" | ||
prop-types "^15.7.2" | ||
react-fast-compare "^3.1.1" | ||
react-side-effect "^2.1.0" | ||
|
||
react-hook-form@^7.31.3: | ||
version "7.47.0" | ||
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.47.0.tgz#a42f07266bd297ddf1f914f08f4b5f9783262f31" | ||
|
@@ -8688,11 +8678,6 @@ [email protected]: | |
dependencies: | ||
"@remix-run/router" "1.10.0" | ||
|
||
react-side-effect@^2.1.0: | ||
version "2.1.2" | ||
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.2.tgz#dc6345b9e8f9906dc2eeb68700b615e0b4fe752a" | ||
integrity sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw== | ||
|
||
react-vis@^1.12.1: | ||
version "1.12.1" | ||
resolved "https://registry.yarnpkg.com/react-vis/-/react-vis-1.12.1.tgz#2020c6025ceb10eace53d2366a6b8e9d90a47c54" | ||
|