polopolopolo
polopolopolo

Reputation: 11

No output in a transaction response

I'm making some tests on web3.py and there is a thing I don't undertand. I have a contract like this:

contract Test {
function add(uint x, uint y) returns(uint){
    return x + y;
}

When i make a transaction on it using

transaction = eth.sendTransaction({"from": some_address, "to": address_of_the_contract_Test, "data": formated_data})

and parse the result using

eth.getTransactionReceipt(transaction)

it gives me a json-formated response without "output" attribute... Can someone tell me why?

(I know that there exist a call function to get the output but I want to do it using a transaction).

Upvotes: 0

Views: 195

Answers (1)

user94559
user94559

Reputation: 60143

Transactions don't have return values. If you want to communicate something back to the client that sent the transaction, you'll probably want to log an event instead.

Upvotes: 1

Related Questions