preprod live-test fixes: 4 real bugs surfaced in real-koios + chain integration
discovered during preprod smoke 2026-05-04 — 7 txs submitted (3 sends, 2 mints, 1 cip68 nft mint, 1 burn). all confirmed on chain. unit-test coverage missed these because hand-crafted koios fixtures didn't match real-world response shapes. bugs: PREPROD-1 (HIGH) — KoiosUtxo::asset_list deserializer rejected `null`. real /address_utxos returns asset_list:null for ada-only utxos (vs /address_info which returns []). Vec<T> can't deserialize null, killing the entire utxo response. Option<Vec<T>>.unwrap_or_default fixes it + new regression test deserializes_utxo_with_null_asset_list locks it in. PREPROD-2 (HIGH) — /address_utxos needs `_extended: true` to populate asset_list. without it, koios returns asset_list:[] (or null) for asset-bearing utxos, making the wallet think it has zero of its own tokens. native-asset send fails with "insufficient asset". new AddressesExtendedBody serializer; get_utxos sets _extended=true. PREPROD-3 (MEDIUM) — wallet_mint_cip68_nft default lovelace was 1.5 ADA but the babbage min-utxo formula for inline-datum-bearing outputs clears ~1.79 ADA. chain rejected with BabbageOutputTooSmallUTxO. bumped default_token_lovelace 1_500_000 → 2_500_000 (covers typical cip-68 metadata; large metadata still requires caller override). PREPROD-4 (LOW, audit-process) — submit_tx error path called .error_for_status() which discards koios's response body. chain-rule rejections came through as bare HTTP codes, no diagnostic. now we capture status + body before checking; rejections include the actual ledger error (e.g. BabbageOutputTooSmallUTxO with the offending coin amounts) so future debugging is one-shot. 7 successful preprod txs: - e3e52cf9 self-send 3 ADA - 397fe6b7 self-send 5 ADA via cold-sign flow (build_unsigned → tx_summary → sign_partial → submit_signed_tx; predicted tx_hash matched submitted tx_hash, body invariant under signing confirmed) - d23e4c60 mint 100 ALDABRA_TEST with CIP-25 metadata - 25cc489c mint cip-68 nft pair (ref label 100 + user label 222) - 2ce72b6f mint 50 more ALDABRA_TEST via unsigned-mint flow - 19a909df native-asset send (25 ALDABRA_TEST + 5 ADA) - f949d29c burn 10 ALDABRA_TEST (negative-quantity mint) guards verified: - max_send_lovelace cap rejects 200 ADA without force ✓ - mint with insufficient holdings rejected with clear error ✓ - mcp tool names with dots silently dropped by Claude Code validator (already fixed in previous commit by renaming to underscore-only) 94 unit tests pass.
This commit is contained in:
parent
46be45cdf2
commit
67b86707e8
2 changed files with 78 additions and 8 deletions
|
|
@ -298,7 +298,14 @@ pub struct Cip68NftArgs {
|
|||
}
|
||||
|
||||
fn default_token_lovelace() -> u64 {
|
||||
1_500_000
|
||||
// 2.5 ADA — Babbage min-utxo for an inline-datum-bearing
|
||||
// multi-asset output is ~1.79 ADA (depends on datum size).
|
||||
// 1.5 was too low; 2.5 gives comfortable margin for typical
|
||||
// CIP-68 metadata (~150 bytes). Larger metadata still requires
|
||||
// the caller to override.
|
||||
// Discovered preprod 2026-05-04 via
|
||||
// BabbageOutputTooSmallUTxO chain rejection.
|
||||
2_500_000
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, schemars::JsonSchema)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue