When you create a transaction calling a function in a smart contract the transaction status is true if it's executed correctly and false if it isn't
When testing in Hyperledger Besu, if a transaction calling a function in a smart contract which doesn't exists (IE: properly encoded tx to a wrong address), the transaction shows as successfully executed.
For example: I successfully deploy a smart contract, I create the smart contract instance with the ABI + address, and make a call to the smart contract like so:
myContract.methods.myMethod(123).call({from: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe'}, function(error, result){
...
});
When I recover the transaction receipt I can verify that the transaction status is true.
But if I send the same transaction to an address where there is nothing deployed, I don't get any logs the function may have, which makes sense because there is nothing deployed there. but I also get transaction status true:
result: {
transactionReceipt: {
blockHash: '0xea2a7a30fcba0359b76d93d1fe4bc9c97216a720d30022b53eb9111fada263ef',
blockNumber: 22,
contractAddress: null,
cumulativeGasUsed: 30424,
from: '0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1',
gasUsed: 30424,
logs: [],
logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Any idea why that happens? Why wouldn't the transaction get rejected?