fix(rpc): emit null for absent Morph receipt fee fields - #192
Conversation
morph-geth serializes unset feeTokenID/feeRate/tokenScale/feeLimit as JSON null, not "0x0". The previous unwrap_or_default made every standard tx look like MorphTx paying with token 0, which breaks viem/indexer checks of `feeTokenID != null`. Keep Some(0) for MorphTx v1 ETH-fee.
|
Warning Review limit reachedNext included review available in 27 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| let (mut nodes, wallet) = TestNodeBuilder::new().build().await?; | ||
| let mut node = nodes.pop().unwrap(); | ||
|
|
||
| let raw_tx = make_transfer_tx(wallet.chain_id, wallet.inner.clone(), 0).await; |
Summary
eth_getTransactionReceiptnow serializes unset Morph fee pointers (feeTokenID,feeRate,tokenScale,feeLimit) as JSONnull, matching morph-geth. Previouslyunwrap_or_default()turned every Legacy/EIP-1559/L1-message receipt into"0x0"."feeTokenID": "0x0"(storedSome(0)), so clients can distinguish “not a MorphTx” (null) from “MorphTx, pay with ETH” ("0x0").@morph-network/viemand indexers that usereceipt.feeTokenID != nullwere misclassifying every standard transaction as alt-fee.Test plan
cargo nextest run -p morph-rpc eth::receiptstandard_transaction_receipt_exposes_null_fee_fields_over_rpctransaction_receipt_exposes_morph_fields_over_rpc(MorphTx still"0x1")0x0