These are chat archives for Nethereum/Nethereum

12th
May 2018
Enigmatic
@EnigmaticUnreal_twitter
May 12 2018 02:54

@snowycrypto_twitter - I believe this shows an offline transaction signing that calls a function (setTopScore)

https://github.com/Nethereum/Nethereum.Game.Sample/blob/master/Forms/Core/Ethereum/GameScoreService.cs

On SubmitScoreAsync

Speaking of which... Just realised I haven't used this in my projects yet. Will make a sample for VB. :D
Juan Blanco
@juanfranblanco
May 12 2018 05:50
Thanks @EnigmaticUnreal_twitter for the rescue my internet has been down since yesterday :(
snowycrypto
@snowycrypto_twitter
May 12 2018 06:04
@EnigmaticUnreal_twitter awesome, will check it out
What/who is VB?
Vitalik?
Juan Blanco
@juanfranblanco
May 12 2018 07:07
Vb.net
stasnadi
@stasnadi
May 12 2018 09:13
Dear Juan, I could need some help. I couldn't find documentation or sample code about how to access the function output after a TransactionSignedUnityRequest in Unity3d? The TransactionSignedUnityRequest.Result gives the transaction hash back unlike EthCallUnityRequest, where EthCallUnityRequest.Result contains the function output. Where can I find the function output in case of a transaction? Thanks in advance!
Juan Blanco
@juanfranblanco
May 12 2018 09:14
@stasnadi transactions do not output a result
only the transaction hash
then that transaction needs to be mined
so when you have a transaction receipt
you can check the contract state
stasnadi
@stasnadi
May 12 2018 09:19
Does that mean, that the function output shall be retrieved with an EthGetTransactionReceiptUnityRequest? Is it in EthGetTransactionReceiptUnityRequest.Result?
Juan Blanco
@juanfranblanco
May 12 2018 09:20
no
you need an extra step
once you have a receipt (The transaction is in the blockchain)
you can then query your smart contract
using a call
the receipt just returns the confirmation of the transaction
being in the chain
stasnadi
@stasnadi
May 12 2018 09:28
Sorry, but I am still struggling. What input do this call (EthCallUnityRequest) require to get to the original transaction's output?
Juan Blanco
@juanfranblanco
May 12 2018 09:30
transactions don't output anything
so you just query for the state changes the transaction has done
ie.. Transfer X
You cold check the balance
of X afterwards
(very bad example, but you get the idea)
another option will be to raise an event
and extract the data from it log
of the transction receipt
but as I can see you are experimenting and learning
start with the other and move to this if you needed it
stasnadi
@stasnadi
May 12 2018 09:44
I think the events will do it. Thanks a lot!
you can do something like this
btw this is slightly new so the syntax won't be the same
but you get the idea
stasnadi
@stasnadi
May 12 2018 10:22
Thanks!
I am using TransactionSignedUnityRequest-s to call a contract function, which make changes in the state, and shall give back a return value (e.g.: Adding a new element to the contract, and returning the new element's index).
"function AddNew Element(bytes32 _elementData)
returns (address gameaddress) {
newelement = tickets.push(Element(_elementData) - 1;
return newelement;
}"
My problem is, that I can not access the return value of this function.
Juan Blanco
@juanfranblanco
May 12 2018 10:23
yes you won't get any return value from there
stasnadi
@stasnadi
May 12 2018 10:24
That's my problem :)
Juan Blanco
@juanfranblanco
May 12 2018 10:24
you either raise an event
event AddedNewElement(uint newelement)
stasnadi
@stasnadi
May 12 2018 10:24
I will try with events.
Juan Blanco
@juanfranblanco
May 12 2018 10:25
and at the emit
then extract it from the TransactionReceipt logs
stasnadi
@stasnadi
May 12 2018 10:28
Will I find it than in EthGetTransactionReceiptUnityRequest.Result.Logs?
Juan Blanco
@juanfranblanco
May 12 2018 10:45
yes you just need to decoded it
stasnadi
@stasnadi
May 12 2018 10:46
cool, Thanks again!!!!