The AchievementTester.tsx
component serves as a development tool for testing achievement creation and validation on the Sui blockchain.
- Provides a UI for creating test achievements
- Validates achievement data structure
- Tests blockchain interaction flow
- Demonstrates proper type handling for Sui Move objects
-
When you create an achievement:
- The transaction may appear successful (no errors)
- Your SUI balance might not change immediately
- You need to verify the transaction completed
-
How to Verify Success:
- Check the transaction in Sui Explorer
- Copy your wallet address from the Sui wallet
- Paste it in the explorer search
- Look for your recent transaction
- Check the transaction status and effects
-
Expected Results:
- Transaction should show "Success"
- You should see a new Achievement object created
- Gas fees should be deducted (very small amount)
- The achievement should appear in your app's list
-
Transaction Not Found
- The transaction might not have been submitted
- Try creating the achievement again
-
Transaction Failed
- Check the error message in explorer
- Verify package address is correct
- Ensure move call arguments match contract
-
Achievement Not Showing
- Refresh your app
- Check the achievements list
- Verify wallet is still connected
- Open browser console for errors
- Check
useAchievements
hook response - Verify contract package address
- Try disconnecting and reconnecting wallet
-
Verify Package Address
- Check your
.env
file forVITE_PACKAGE_ADDRESS
- Ensure it matches your deployed contract on devnet
- Package address format should be like:
0x...
- Check your
-
Verify Network
- Make sure you're checking the correct network in Sui Explorer
- Select "Devnet" from the network dropdown (top-right)
- Your wallet and explorer network must match
-
No Data Found Issues Common reasons:
- Wrong network selected in explorer
- Package not deployed to devnet
- Incorrect package address in
.env
- Transaction didn't complete
-
How to Find Your Package
- Go to Sui Explorer Devnet
- Use the search bar to find:
- Your wallet address
- Your package address
- Recent transactions
- Check "Published" tab for your package
-
Next Steps if Package Not Found
- Verify package deployment status
- Check deployment logs
- Try redeploying the package
- Update
.env
with new package address
For deployment instructions, see docs/sui-deployment-guide.md
.
- Uses TypeScript to ensure proper data structure
- Implements type guards for Sui Move object fields
- Validates data before blockchain submission
- Displays user-friendly error messages
- Handles wallet connection states
- Manages transaction failures gracefully
-
Wallet States
- Test with connected/disconnected wallet
- Verify proper error handling
- Check transaction feedback
-
Data Validation
- Ensure required fields are present
- Verify data type consistency
- Check field length limits
-
Transaction Flow
- Monitor gas usage
- Verify object creation
- Check achievement ownership
For implementation details, see src/components/AchievementTester.tsx
.