Repository navigation
fix(automint): username errors, marketplace getters, admin getter names, not-found page - #1469
Merged
ada-nwali merged 4 commits intoOct 24, 2026
Conversation
…loses ada-nwali#1218) register() reported UsernameTaken when the username was empty or longer than 32 bytes, so the frontend told users a valid name was already in use. Add a distinct InvalidUsername error (code 12) for those cases and keep UsernameTaken for real collisions. - Update the register doc comment, the registry contract doc, and the two affected tests. - Map InvalidUsername in the frontend error table, reword the UsernameTaken message to "already in use", and add the missing entry for ImplausiblePoints (code 11), which the table test requires. - Add InvalidUsername to the generated registry binding error table.
…g and bot_nft (Closes ada-nwali#1195) config() and bot_nft() unwrapped the stored Config, so calling them before initialize trapped with an opaque host error. They now return Result<_, MarketplaceError> with NotInitialized, matching accrual::config(). This commit also adds marketplace admin(), which returns the admin recorded in Config, so every contract exposes the same getter for the admin address. The admin getter name is standardized across contracts in the next commit. Updates the generated marketplace binding to the new return types.
…da-nwali#1193) The admin address was exposed under three different names: registry get_admin(), accrual get_accrual_admin(), and admin() on token and bot_nft. deploy.sh's verify_contract() calls admin() on every contract, so it already failed for registry and accrual. - registry: rename get_admin() to admin() - accrual: rename get_accrual_admin() to admin() - marketplace: admin() was added in the previous commit Updates the registry and accrual bindings and the frontend preflight check to the new name. Test snapshots are regenerated for the renamed calls. Redeploy registry and accrual before relying on the new names.
Unknown routes and notFound() calls, such as a missing bot id, fell back to Next.js's default 404, which dropped the AutoMint layout and styling. app/not-found.tsx renders inside the root layout, so the header and footer stay mounted. It reuses the RouteError panel style and links back to the dashboard and marketplace. A small test covers the heading and both links.
|
@precious-akpan is attempting to deploy a commit to the Ada's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1218
Closes #1195
Closes #1193
Closes #1161
Summary
register()returnedUsernameTakenfor empty or over-long usernames. It now returns a newInvalidUsername(code 12).UsernameTakenonly means a real collision.config()andbot_nft()unwrapped storage and trapped beforeinitialize. They now returnNotInitialized, likeaccrual::config(). Also adds marketplaceadmin().get_admin()and accrualget_accrual_admin()are nowadmin(), matching token, bot_nft, and marketplace.deploy.sh'sverify_contract()callsadmin()on every contract.app/not-found.tsx, styled likeRouteErrorand linking to the dashboard and marketplace. Unknown routes now keep the AutoMint layout.One commit per issue. The commits target
testnet-implementation, the repo's default branch.Test evidence
cargo test -p automint-registry: 109 passed.cargo test -p automint-accrual: 72 passed.cargo test -p automint-marketplace: 126 passed, 3 failed. The same three fail on the base branch, so they predate this PR:set_bot_nft_succeeds_once_every_listing_has_settled,test_error_variant_overflow,test_fee_boundary_prices.npx tsc --noEmitinfrontend: clean.frontendJest: the newnotFound.test.tsxanderrors.test.tspass except for one test (below). TheerrorBoundariessuite passes. Five frontend suites fail with 12 tests in total (useMarketplace,transaction,dashboard.integration,TierSupplyBadge, anderrors). The same five fail on the base branch.Notes for reviewers
get_admin→admin,get_accrual_admin→admin, and the marketplaceconfig/bot_nftreturn types change the contract interfaces. Redeploy registry, accrual, and marketplace before the frontend uses the new names.frontend/src/lib/bindingswere edited by hand to match. They should be regenerated withstellar contract bindings typescriptfrom the built wasm so they match the contracts exactly.errors.test.ts("has a message for every explicitly numbered Rust contract error") still fails on the base branch. It is missing entries for bot_nft codes 16–19, accrual code 14, and marketplace code 34. This PR adds the registry gap (ImplausiblePoints, code 11), which is also what the test needed for the registry enum.rust-toolchain.tomlpins Rust 1.95.0, which I installed to run the tests.