Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions MANUAL_TEST_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Manual Testing Checklist for Zano DFX Integration

## Prerequisites
- [ ] Cake Wallet app builds successfully
- [ ] Zano wallet created/restored
- [ ] Test device/emulator ready
- [ ] Internet connection available

## Test Scenarios

### 1. Zano DFX Buy Flow
- [ ] Open Cake Wallet with Zano wallet
- [ ] Navigate to Buy/Sell screen
- [ ] Select "Buy" action
- [ ] Select Zano as cryptocurrency
- [ ] Select USD as fiat currency
- [ ] Enter amount (e.g., $100)
- [ ] Check if DFX appears as provider
- [ ] Select DFX provider
- [ ] Verify authentication process starts
- [ ] Check if signMessage is called
- [ ] Verify signature is generated
- [ ] Confirm DFX website opens with correct parameters

### 2. EUR Fallback Test
- [ ] Select a cryptocurrency with no USD providers
- [ ] Enter amount in USD
- [ ] Observe automatic fallback to EUR
- [ ] Check for notification message: "Automatically switched from USD to EUR"
- [ ] Verify EUR quotes are displayed
- [ ] Confirm transaction can proceed with EUR

### 3. DFX Authentication Test
- [ ] Use Zano wallet
- [ ] Initiate DFX buy flow
- [ ] Monitor logs for:
- `ZANO signMessage called`
- `Sign message response`
- `Signature validated successfully`
- [ ] Verify no authentication errors
- [ ] Check DFX accepts the signature

### 4. Error Handling
- [ ] Test with no internet connection
- [ ] Test with invalid amounts
- [ ] Test timeout scenarios (wait >10 seconds)
- [ ] Verify error messages are user-friendly

### 5. Cross-Currency Purchase
- [ ] Use Bitcoin wallet
- [ ] Try to buy Ethereum via DFX
- [ ] Verify wallet address is still provided for auth
- [ ] Confirm authentication succeeds

## Expected Behaviors

### Successful Flow
1. **Zano Wallet + DFX:**
- signMessage executes without errors
- Signature is 128 hex characters
- DFX authentication succeeds
- User redirected to DFX website

2. **EUR Fallback:**
- Automatic switch from USD to EUR
- User notification displayed
- Quotes fetched successfully
- No infinite loops

3. **Logging:**
- All operations logged with appropriate levels
- No sensitive data in logs
- Clear error messages

## Debug Commands

### Check Logs
```bash
# For iOS
xcrun simctl spawn booted log stream --level debug | grep -E "DFX|Zano|Currency"

# For Android
adb logcat | grep -E "DFX|Zano|Currency"
```

### Verify Signature Format
- Zano: 128 hex characters
- Bitcoin: Base64 or hex format
- Ethereum: 0x + 130 hex characters

## Common Issues & Solutions

| Issue | Solution |
|-------|----------|
| "This currency pair isn't supported" | EUR fallback should trigger automatically |
| DFX authentication fails | Check signature format and wallet address |
| Timeout errors | Increase timeout in BuyProviderConfig |
| No providers available | Check internet and provider status |

## Sign-off

- [ ] All test scenarios completed
- [ ] No critical bugs found
- [ ] Performance acceptable
- [ ] Error handling works correctly
- [ ] Ready for production

## Notes
- Test on both iOS and Android if possible
- Test with different network speeds
- Document any unexpected behaviors
- Save logs for debugging
83 changes: 83 additions & 0 deletions PRODUCTION_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Production Readiness Checklist

## Code Quality
- [ ] All feedback requirements implemented
- [x] Zano signMessage in zano_wallet_api.dart
- [x] Modular architecture
- [x] Better abstraction
- [x] Maintainable code
- [ ] No test code in production files
- [ ] No debugging/console logs in production
- [ ] All TODOs resolved or documented

## Security
- [ ] No sensitive data in logs
- [ ] Remove response logging in signMessage
- [ ] Remove detailed error logging
- [ ] Input validation present
- [ ] No hardcoded secrets/keys

## Error Handling
- [ ] User-friendly error messages
- [ ] Proper exception handling
- [ ] Fallback mechanisms tested

## Configuration
- [ ] All magic numbers as constants
- [ ] Timeouts configurable
- [ ] Currency fallbacks configurable

## Documentation
- [ ] Code comments where needed
- [ ] Public API documented
- [ ] Breaking changes documented

## Testing
- [ ] Manual testing completed
- [ ] All scenarios from MANUAL_TEST_CHECKLIST.md tested
- [ ] Edge cases handled

## Files to Include in PR

### Core Implementation
✅ cw_zano/lib/zano_wallet_api.dart - signMessage implementation
✅ cw_zano/lib/zano_wallet.dart - delegation to API
✅ lib/buy/dfx/dfx_authentication_service.dart
✅ lib/buy/dfx/dfx_signature_validator.dart
✅ lib/buy/dfx/dfx_buy_provider.dart - updated to use services
✅ lib/buy/currency_fallback_handler.dart
✅ lib/buy/provider_wallet_address_manager.dart
✅ lib/buy/buy_provider_config.dart
✅ lib/core/logger_service.dart
✅ lib/core/resource_manager.dart
✅ lib/view_model/buy/buy_sell_view_model.dart - updated logic

### DO NOT Include
❌ Test files (test/buy/*.dart)
❌ Test documentation (TEST_SETUP.md)
❌ Development notes

## Final Checks
- [ ] Code compiles without warnings
- [ ] No merge conflicts
- [ ] PR description updated
- [ ] Reviewer requirements met

## Recommended Changes Before PR

1. **Remove verbose logging:**
- Line 267 in zano_wallet_api.dart
- Line 36 in dfx_authentication_service.dart

2. **Add constants for magic numbers:**
```dart
// In zano_wallet_api.dart
static const int ZANO_SIGNATURE_LENGTH = 128;
```

3. **Improve error messages:**
- Make them user-friendly
- Remove technical details

4. **Remove test artifacts:**
- Ensure no test-only code in production files
Loading
Loading