fix(rpc): preserve RPC errors in transfer_transaction source ATA lookup#373
Conversation
Greptile SummaryThis PR partially fixes RPC error propagation in Key observations:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["transfer_transaction()"] --> B["CacheUtil::get_account(source_ata)"]
B -->|"Ok"| C["CacheUtil::get_account(dest_ata)"]
B -->|"Err(AccountNotFound)"| E1["KoraError::AccountNotFound(source_ata) ✅ fixed"]
B -->|"Err(RpcError / other)"| E2["Propagate original error ✅ fixed"]
C -->|"Ok"| D["Build transfer instruction"]
C -->|"is_err() — any error"| F["Create ATA instruction ⚠️ swallows RPC errors"]
D --> G["Build & encode transaction"]
F --> G
G --> H["Return TransferTransactionResponse"]
style E2 fill:#c8f0c8,stroke:#2e7d32
style E1 fill:#c8f0c8,stroke:#2e7d32
style F fill:#ffe0b2,stroke:#e65100
|
|
Fixed the dest_ata check at line 118 as well — replaced .is_err() with a |
|
✅ Fork external live tests passed. fork-external-live-pass:aac08be5ee9e85224c60cff1caa471d31ccd6a68 |
fda0342
into
solana-foundation:release/2.2.0
Source ATA lookup was discarding the real error and always returning
AccountNotFound — RPC failures like rate limits or timeouts now surface
correctly instead of misleading operators.