<p>The Bitcoin Core JSON-RPC interface checks that the returned value matches the format specified in the documentation (doc for short). If you're adding a new field to <code>decoderawtransaction</code>, you also need to add the field to its documentation (called <code>DecodeTxDoc</code> in the code).</p>

CC BY-SA 4.0
2024-11-08T16:13:07.717Z
2024-11-08T16:13:07.717Z
Vojtěch Strnad
<p>I modified an RPC call response for a PR, but some functional tests are failing. The error I'm getting is:</p>
<pre><code>  File &quot;/home/sliv3r/Documentos/Projectes/BitcoinCore/bitcoin/build/test/functional/feature_fee_estimation.py&quot;, line 203, in initial_split
    self.confutxo = self.wallet.send_self_transfer_multi(
  File &quot;/home/sliv3r/Documentos/Projectes/BitcoinCore/bitcoin/test/functional/test_framework/wallet.py&quot;, line 295, in send_self_transfer_multi
    self.sendrawtransaction(from_node=from_node, tx_hex=tx[&quot;hex&quot;])
  File &quot;/home/sliv3r/Documentos/Projectes/BitcoinCore/bitcoin/test/functional/test_framework/wallet.py&quot;, line 397, in sendrawtransaction
    self.scan_tx(from_node.decoderawtransaction(tx_hex))
  File &quot;/home/sliv3r/Documentos/Projectes/BitcoinCore/bitcoin/test/functional/test_framework/coverage.py&quot;, line 50, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File &quot;/home/sliv3r/Documentos/Projectes/BitcoinCore/bitcoin/test/functional/test_framework/authproxy.py&quot;, line 146, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: Internal bug detected: RPC call &quot;decoderawtransaction&quot; returned incorrect type:
{
    &quot;vin&quot;: {
        &quot;0&quot;: {
            &quot;witScript&quot;: &quot;key returned that was not in doc&quot;
        },
        &quot;1&quot;: {
            &quot;witScript&quot;: &quot;key returned that was not in doc&quot;
        }
    }
}
</code></pre>
<p>I am unable to find where the expected answers for RPC are defined. Where can I find this &quot;doc&quot;?</p>

<json-rpc><bitcoin-core-development><functional-test>
Functional test error when modifying RPC response: "RPC key returned that was not in doc"
polespinasa
# Functional test error when modifying RPC response: "RPC key returned that was not in doc"

(Asked by: username_0 on 2024-11-08)

I modified an RPC call response for a PR, but some functional tests are failing. The error I'm getting is:

```
  File "/home/sliv3r/Documentos/Projectes/BitcoinCore/bitcoin/build/test/functional/feature_fee_estimation.py", line 203, in initial_split
    self.confutxo = self.wallet.send_self_transfer_multi(
  File "/home/sliv3r/Documentos/Projectes/BitcoinCore/bitcoin/test/functional/test_framework/wallet.py", line 295, in send_self_transfer_multi
    self.sendrawtransaction(from_node=from_node, tx_hex=tx["hex"])
  File "/home/sliv3r/Documentos/Projectes/BitcoinCore/bitcoin/test/functional/test_framework/wallet.py", line 397, in sendrawtransaction
    self.scan_tx(from_node.decoderawtransaction(tx_hex))
  File "/home/sliv3r/Documentos/Projectes/BitcoinCore/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/home/sliv3r/Documentos/Projectes/BitcoinCore/bitcoin/test/functional/test_framework/authproxy.py", line 146, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: Internal bug detected: RPC call "decoderawtransaction" returned incorrect type:
{
    "vin": {
        "0": {
            "witScript": "key returned that was not in doc"
        },
        "1": {
            "witScript": "key returned that was not in doc"
        }
    }
}

```

I am unable to find where the expected answers for RPC are defined. Where can I find this "doc"?

**Tags:** json-rpc, bitcoin-core-development, functional-test


---

## 1 answers

### Answer by username_1 on 2024-11-08. Score: 2 | Accepted answer

The Bitcoin Core JSON-RPC interface checks that the returned value matches the format specified in the documentation (doc for short). If you're adding a new field to `decoderawtransaction`, you also need to add the field to its documentation (called `DecodeTxDoc` in the code).


---

